Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unified directory for plugin translation files
#10
ok, I was thinking of this a lot last night and came up with an idea. I think it's a good middle between too complex (mvlcek's original idea) and the nothing we have right now.

What if we do this:
  • Allow developers to create their own folder within their plugin structure like this: '/myplugin-folder/lang/'
  • Give them a function that allows them to "merge" their language file (which is an array just like before) with the site-wide language file. Something like this: i18n_merge('../path-to-my-plugin/lang/en_US.php');

Then the developers could use their own translations and the default language file translations (the ones that yojoe talked about here) using the same exact methods as the rest of GetSimple: i18n('TAG') or i18n_r('TAG')

I would leave it up to the developers to decide how they want to handle switching languages within their plugins:
  • Maybe the plugin language file is always called language.php, and the user just replaces that file with their own language.php. I see no problem with this because once a language is set within the installation, its not going to change 99.9% of the time.
  • Or maybe the plugins write a control panel form that allows people to switch between installed language files.

... I don't think I should dictate that part of the process. I just want to give the developers a simple and standard way to internationalize their plugins, and i think this fits the bill.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply


Messages In This Thread
unified directory for plugin translation files - by ccagle8 - 2011-03-16, 22:17:52



Users browsing this thread: 4 Guest(s)