Hi all,
I need to set up a bilingual site.
No problem for the site messages (menus and viart messages)
But how can I present a product description in 2 different languages?
I would like to show description in language 1 to user that choose language 1 and description in language 2 to users that choose language 2.
Is this possible?
Ned
17 May 2008 10:24 AM
Just do the following using the start and finish language tags [xx]..[/xx]
[en]Blue with ten legs[/en][fr]Bleu avec dix jambes[/fr][it]Azzurro con dieci piedini[/it][sp]Azul con diez piernas[/sp][ru]Синь с 10 ногами[/ru]
You can select the language from the language selector block on the home page or use an index page with a couple of flags and use a map to select the input language ...
..or use an index page.. I should have said "...or use an index.html page.."
(If you need an index.html page with a <map> to select the language as the front page to your site you also have to add
DirectoryIndex index.html
to an 'htaccess file so visitors pick the index.html page _before_ the index.php page.)
Giuseppe (Guest)
17 May 2008 10:47 AM
Thanks very much
Already tried and it works smoothly!
emresonmez
21 May 2008 3:03 PM
Ned, which file are you talking about here? I want English to be by default, and I want to represent 2 other languages. If a user select a language other then English, I do not want them to see any English at all. How can I for example edit the IntroMessage, Custom blocks etc. for non-english page visitors? Which file needed to be edit? Thanks
Just do the following using the start and finish language tags [xx]..[/xx]
[en]Blue with ten legs[/en][fr]Bleu avec dix jambes[/fr][it]Azzurro con dieci piedini[/it][sp]Azul con diez piernas[/sp][ru]Синь с 10 ногами[/ru]
Ned
22 May 2008 8:53 AM
Create each page or article or description with the languages you want for example -
"[en]Blue with ten legs[/en][fr]Bleu avec dix jambes[/fr][it]Azzurro con dieci piedini[/it]"
gives you English, French and Italian descriptions.
The initial language setting is in "includes/var_definition.php" as "$default_language" and this is set to English (en) when you install ViArt.
So when a visitor accesses your site they will _only_ see all text between the [en]..[/en] markers on every page that has it because the default language is "en".
Go to "Administration > Static Tables > Languages" and select the two other languages you want along with English and you have created language descriptions for - in my example - French and Italian.
This then creates a "languages block" with the selected languages represented by the 3 flags.
You can then include the "languages block" on pages by using "Administration > CMS > CMS Settings" and selecting the "languages" block on the pages you want it.
This allows the user to select a different site language by clicking on the flag. They then only see the text between the language markers they want - for example in Italian between the [it]..[/it] markers.
If you want the site language selection on entering the site put the language block on the home page.
Importantly the [xx]...[/xx] markers also work in "Administration > CMS > Layouts > Site navigation" allowing you to create menus that are specific to languages.