plugin languages - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: plugin languages (/showthread.php?tid=3239) |
plugin languages - shawn_a - 2012-06-02 I want to add multi language to my tag plugin. I have no idea where to start with languages, so ill be learning that by reading around. But the plugin only has a single string of text that needs to be translated. What is the best way to do that ? Is there an compact alternative to 1 file per language ? Can I define a single language file and use that for all languages. plugin languages - shawn_a - 2012-06-23 I have another question. I've been figuring this i18n business out slowly. couple of questions if someone would be great to help me out with. Trying to figure out some inconsistencies and inefficient methods. 1. Why does i18n plugin use non country named files ? I need to figure out which files to load and when, for all plugins, so this is a problem. I guess I can just try to load both country and non country with an or statement, just another level of but why??? 2. Does i18n_merge keep track of loaded lang files or does it keep including stuff over and over ? Is it even possible to do your own checking before merging the same files. 3. What is i18n_load_texts(), the wiki mentions it but doesn't say what it does, is it the plugin version of 18n_merge ? Are they interchangeable ? Thanks plugin languages - mvlcek - 2012-06-23 shawn_a Wrote:I have another question.
shawn_a Wrote:2. Does i18n_merge keep track of loaded lang files or does it keep including stuff over and over ? No, it does not keep track, but would merge the file twice, if called twice. But it only sets those entries that are not yet set. Thus it is good practice (in a plugin) to first load the file of the selected language and then the default (normally english) file. This ensures that - even if the selected language file is not complete, because it is for an older plugin version - all missing entries are displayed in the default language (which the plugin developer keeps up-to-date). shawn_a Wrote:3. What is i18n_load_texts(), the wiki mentions it but doesn't say what it does, is it the plugin version of 18n_merge ? Are they interchangeable ? i18n_load_texts() is a function of the I18N plugin which can be used for the frontend (in the template) and automatically chooses the best language for the user. Because it is only available if the I18N plugin is installed the call should be enclosed in if (function_exists('i18n_load_texts')) { ... }. plugin languages - shawn_a - 2012-06-23 Thank you very much! |