Categories > TBS next version >

I18N support ?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: peirgwnael
Date: 2004-02-20
Time: 22:00

I18N support ?

Hi,
What is your position about i18n and tbs and generaly about the translation method with templates.

I need to translate the fieldanme of my data to present the pages.
By: Skrol29
Date: 2004-03-10
Time: 12:04

Re: I18N support ?

Hi Peirgwnael,

Sorry for answering so late.
I didi know about i18n, I've read a bit about it but I can't figure out how it works. This is maybe intersting for TinyButsStrong, have you some examples or good links?
By: peirgwnael
Date: 2004-03-10
Time: 21:44

Re: I18N support ?

I know my need but not the solutions...
What I need is to present the pages with the presentation in the language of the user.
I thougt using the template system to convert the keywords in the good language (it's a way).
I fianly decide to use a merge block with a table what containt all the keyword or sentences in the language of the user.
An other way is to have a template file for each language but it's not really my preference...
By: red
Date: 2004-04-03
Time: 20:41

Re: I18N support ?

there could be some [translate.keyword] tags.

then you have to tell tbs in which languagefile it has to look (i.E. $tbs->setLanguage("en"); ). this file is parsed from an ini-file like this (with parse_ini_file() ):

lang_de.lang:
keyword = Der deutsche Text


lang_en.lang:
keyword = The english text

after this tbs will know which the text to replace the keywords

hope this helps...
By: RwD
Date: 2004-04-04
Time: 23:14

Re: I18N support ?

No, no ini files please...
TBS supports databases, if any way then I would prefer a database over a flat file structure. If tbs would do it both ways thats fine too..
By: red
Date: 2004-04-04
Time: 23:59

Re: I18N support ?

you don't need i18n support in a database: just use 'WHERE lang='en'" and you've got the chosen language... ;) what we need is especially i18n support for the use WITHOUT a database.
By: RwD
Date: 2004-04-05
Time: 23:36

Re: I18N support ?

ok, I didn't get a lot further then the introduction beacause I have little time. But doesn't multilingual support just call for a database?

I use multiple tables for it that are maintained simultaniously, so I change the tablename (in a global variable). This way adding languages and making changes seemed most easy and overseeable (even thought the user gets an interface)

But I will not say anything more in this thread before I read more about I18N ;)
Sorry if I said something stupid :)
By: Skrol29
Date: 2004-04-06
Time: 00:19

Re: I18N support ?

Hello,

I'm very instered with this discussion because they are several queries for a multi-language support with TBS.

What I'll probably add to next version is an extension for the MergeField() method.
Now:
  TBS->MergeField('fld',$Value) ;

Thinking of:
  TBS->MergeField('fld',$Value) ;
    or
  TBS->MergeField('fld','MyFunction',True) ;

Then all 'fld' fields are merged with the value returned by function MyFunction().
Example:
HTML:
[fld.title]
[fld.caption]

PHP:
$TBS->MergeField('fld','MutliLanguage',True);

function MutliLanguage($keyword) {
  ... //reading database or text file or whatever
}

What do you think about that?
By: red
Date: 2004-04-06
Time: 00:40

Re: I18N support ?

hm, seems to be the way to go. but it would be nice to have a function-library shipping with tbs (i could add the ini-version and ruud could eventualy do his database-function).