a bilingual application on Agile Toolkit ? with la

2019-07-18 17:22发布

I am planning on developing a bilingual PHP app with Agile Toolkit, with a language selector on every page ( French & English ) .. Can ATK4 accommodate this ? I am thinking yes .. but .. how would a newbie like me go about this with ATK4 ?? any cues would be greatly appreciated... I wish to create one single file ( some kind of database file that holds the translations) and access everything through variables for the various page views ( even the menu items ). Any assistance or cues on this will be greatly appreciated. thx

Don

标签: php atk4
1条回答
欢心
2楼-- · 2019-07-18 18:14

PHP already have the localization function, and all you need to do is make sure that all the internal messages of Agile Toolkit is being routed through the localization function. Agile Toolkit's API contains a _() method too. You need to re-define it inside your "lib/Frontend.php" and route it either through the get text or SQL, whichever way you want.

The other big part of translation you will need to perform is template translation. Templates usually contain graphics and texts which may be different depending on language. The "PathFinder" is ideal for this. Agile Toolkit website actually uses that technique for Polish translation:

as you pass 3nd argument to the constructor, it instructs PathFinder to look into a different directory for the localized template files. If it does not find them there, it defaults to regular locations.

查看更多
登录 后发表回答