D_C wrote: > hi list - > > am wondering what approaches people take for multilanguage sites? were > working on a CMS system and need to have the UI / links show up in > many languages and be easily localizable by people. > > we're using smarty, so one approach is to use smarty config files and > then smarty tags for all the items. > > _TOP_MENU_BTN= "return to top menu"; > > is there a big performance hit to this? this means replacing a lot of > items in each page, each pass.
suitable caching/compiling should be used to avoid translation on each pass - maybe using a precompiler plugin - I haven't figured out a decent way of doing this myself yet. > > the other way is to just localize inline in the template files > themselves, but this means if a design changes all the lang templates > for each lang have to be updated... :( > > another way is to have a huge define file > define("_TOP_MENU_BTN", "return to top menu" ); > is this a LOT faster? creating constants is SLOW. using the apc extension constant related functions is a great way of speeding this up. outputting the constants is comparative fast. > > Also i am looking for some way to manage the strings during > translation, to make sure as things get added to say the english UI > that its easy to track whats missing from the translations. i guess > well have to build a simple spreadsheet like GUI but i was wondering > if anything is already available. > > I guess there is also a gnu gettext extension, but it doesnt seem > widely supported or avail for windoze. I have no idea about gettext on windows - personally I would never use windows for a production webserver anyway. I'm currently working on a stand alone 'plugin' type application using gettext that can scan (using tokenize) & manage a projects files, retrieve all translatable strings dump them in a DB (with an editing interface for translators) and finally generate the binary .mo files for the project ... it requires that all strings in the project are translated via the 'gettext()' function (or it's alias '_()'). in the longterm gettext is the superior method and a solution that allows you to use it AND manage the translations is the way to go IMHO. > > tx for any other suggestions!! > > /dc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php