Categories > TinyButStrong general >

Multi-Language website (Traduction in a file)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sikkle
Date: 2007-06-22
Time: 19:49

Multi-Language website (Traduction in a file)

My language are classed like :

Directory language/fr/language.php

$FremLanguageArray = array(
'HELLO' => 'Bonjour',
'BYE' => 'Aurevoir',
);

So the language are instanciate at beggining of my application, so TBS don't have to choose a language files, the good array is loaded before.

This is my code :

$TBS =& new clsTinyButStrong ;
$TBS->LoadTemplate(FREM_MEP.'yeahsir.html') ;
$message = 'HELLO';
$TBS->Show() ;

What will be the command to load this and use this with TBS ?
By: Skrol29
Date: 2007-06-22
Time: 22:08

Re: Multi-Language website (Traduction in a file)

Hi,

You can do [var.FremLanguageArray.HELLO] but this is a bit heavy to write.
The other way is to do:
HTML: [lang.HELLO]
PHP:
$TBS->MergeField('lang',$FremLanguageArray) ;

PS: I delete you double post in the french forum.
By: sikkle
Date: 2007-06-23
Time: 01:26

Re: Multi-Language website (Traduction in a file)

So mergefield will do the same job.

i can do that without any problem each page i load, just mergefield and there you go this is it ? :)


Ok perfect, sorry for the double post.


By: Skrol29
Date: 2007-06-23
Time: 03:34

Re: Multi-Language website (Traduction in a file)

Yes, that's it :)