Ticket #81 (new enhancement)
i18n messages lookup
| Reported by: | mpo | Owned by: | mpo |
|---|---|---|---|
| Priority: | major | Milestone: | 0.5 |
| Component: | < I18N | Version: | trunk |
| Keywords: | Cc: |
Description
We need a solid way to retrieve and use translation sets to be used in the forms.
These sets will simply list key: translation entries.
Unclear now if merging should happen in the client, or at the server.
The former makes pure static development and testing easier.
The latter allows to reuse typical Java Resource bundels (or any other i18n provisioning we'll use on the backend) and just produce the correct set on a specific .../{area}/messages/{locale}.js URI
Attachments
Change History
comment:2 Changed 2 years ago by mpo
- Milestone changed from 0.3 to 0.4
work started, needs completion though
comment:4 Changed 2 years ago by mpo
The locale.js already contains a Message object that will look into the Locale.messages for a translated text for a given key.
They can be set through locale.setMessages
What is missing though is dynamically loading bundles.
For that the i18n module already provides a client API: (see http://www.kauriproject.org/docs-0_4/310-kauri/316-kauri.html) that will deliver bundles in json from URI's like /bundles/{bundle}/{locale}
The Locale object should be enhanced with a loadBundle(bundleName) to retrieve the bundle.json (note: loaded messages should extend, not replace the set of messages, ie don't use setMessage there)