As discussed during the team meeting on 24th July:

  http://uwyn.com/drone/log/bevinbot/mapbuilder/20070724

I have been thinking about adding support for language subtags, with the
proper fallback.  I have added a design proposal to the JIRA issue, text
included below.  If anyone wishes to comment, please do so.

    http://jira.codehaus.org/browse/MAP-165

Gertjan van Oosten commented on MAP-165:
----------------------------------------

We should add a mechanism for language subtags with fall-back on the
main language, e.g.:

- nl-BE would contain messages specific to Flemish
- messages not specified in lib/text/nl-BE/widgetText.xml would fall
  back on lib/text/nl/widgetText.xml

A further fall-back from any language to the default language (en) would
be useful as well; any new messages that have not yet been translated
from the default language into the other supported languages would still
be shown, albeit in English, but that's still beter than nothing.

The way messages are loaded in Config.js would then go something like
this:

- load the messages for the default language
- load the messages for the main language of the given lang parameter
- if the lang parameter has a language subtag, load the messages for the
  complete language tag

Since the mbGetMessage() function always picks the last message it finds
for a specific key, this would make sure you would always get the most
specific message, with automatic fall-back.

Adding the user widgetText to this slightly complicates things. To get
the right fallback scenario, it would have to go something like this:

- load the mapbuilder messages for the default language
- load the user messages for the default language
- load the mapbuilder messages for the main language of the given lang
  parameter
- if the lang parameter has a language subtag, load the mapbuilder
  messages for the complete language tag
- load the user messages for the main language of the given lang
  parameter
- if the lang parameter has a language subtag, load the user messages
  for the complete language tag

That should do the trick.

Regards,
-- 
-- Gertjan van Oosten, [EMAIL PROTECTED], West Consulting B.V., +31 15 2191 600

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to