zen-cms/Zen-Core — Issue #40: Improve Multi-language system
Author: YorickPeterse
Created: 2011-11-09 13:34:42+00:00
State: open

While the current multi-language system is a good start it has a few limitations
that need to be addressed:

* Language directories are named after a simple country code instead of an ISO
code. An example of this is "en" instead of "en-GB" or "en-US".
* Rtl languages are currently not properly supported as there is no easy way to
load a language specific stylesheet for these languages.

I also think it would be a good idea to add an API to register languages similar
to the way you add packages, themes and settings. This would make it easier to
specify where your language files are located, what stylesheets to load and so
on. An example of this API is the following:

Zen::Language::Language.add do |lang|
lang.name = 'en-GB'
lang.title = 'English (United Kingdom)'
end

Zen::Language::Language.add do |lang|
lang.name = 'nl'
lang.title = 'Nederlands'
end

Registering a set of translations for a given language would work as following:

Zen::Language::Translation.add do |trans|
trans.language = 'en-GB'
trans.directory = __DIR__('example/language/en_gb')
trans.stylesheet = '/admin/css/zen/languages/en_gb.css'
end