Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plugin languages
#1
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#2
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
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
shawn_a Wrote: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???

  1. The I18N plugin is designed to deliver multi-language sites and should deliver e.g. english pages independent of if the user is from the US or the UK or Australia. I don't think that any target users of GetSimple would design a site with e.g. two different english versions.
  2. Additionally, if a user has set en_US as language in his browser, he would expect that a french/english site would still display the english version, even if it uses british english.
  3. In order to facilitate this all my plugins that display internationalized texts on the frontend, use language-only language files.
  4. On the backend it only matters, if you e.g. use GetSimple in en_US and your favorite plugin only provides a en_UK language file - but then you could easily rename or copy the language file, as you are in charge of your server

shawn_a Wrote: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.

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')) { ... }.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#4
Thank you very much!
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)