TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 05:24:54 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,105
  • Total Topics: 21,213
  • Online today: 310
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 303
  • Total: 303

Problems with blocks and languages

Started by bobzr, August 11, 2007, 12:25:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bobzr

We would like to make a bi-lingual site (English/French).

- When I create a center block to show in a particular category, it works fine (language selected: -none-)

- If I create a new block in French and select FRENCH on the "show for this language" options, it shows in ALL pages, not only a particular cat, when viewed by a French user.

- If I create a new block in English and select ENGLISH on the "show for this language" options, it shows in ALL pages, not only a particular cat, when viewed by an English user.

Moreover, if a user select a language in his profile, other than English or French, all menus disappear and it's impossible to reverse the choice.
How REMOVE the useless languages from the drop-down menu??

Hope somebody can help, thanks.

agridoc

There is a misfunction here, language takes priority over other block options.

Language option works better in Frontpage blocks.

Remove unwanted language by deleting ???.[unwanted language].php files in /Themes/default/languages. If not added by you, they are probably added by an update SMF version patch. This is not a TP issue. In the last case many language files are missing, that's why no menus appear.

If you accidentally change language in profile use ..../index.php?language=english (or french) to have a functional forum and modify profile.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF

bobzr

Thanks so much for the useful info...
very much appreciated!

bobzr

do you have any suggestion on how to show an article/ page either in French or English depending on the language chosen by the user?

IchBin

That type of feature is not built into TP. YOu could however do it with a PHP article.

global $user_info;
if ($user_info['language'] == 'english')
    echo 'all your html stuff in between these single quotes for the article for english';

elseif ( $user_info['language'] == 'spanish')
    echo 'all your html stuff in between these single quotes for the article for spanish';

else
    echo 'This is what would echo by default if their language is not english or spanish';

bobzr

Thanks IchBin! your suggestion is great and it works fine for simple articles. But when I try to copy/paste more complex pages (images, flash, ...) I get an error like this:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/content/ xxxxxxxxxxxxxxxxxxx /html/Sources/Load.php(1736) : eval()'d code(209) : eval()'d code on line xxxxxxxx

or

Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/content/ xxxxxxxxxxxxxxxxxxxx /html/Sources/Load.php(1736) : eval()'d code(209) : eval()'d code on line xxxxxxx

May be I should use an html editor that can provide clean html code to be pasted on that php article? Any advice?    ------thanks!

bobzr

no problem, I found the solution
It is necessary to find and replace every ' (apostrophe) in the htlm article with \'    before pasting it on the php article.
that's all and it works!!!
thanks a lot   :D

IchBin

Glad you figured it out! Glad I could help too! :)