Ticket #489 (assigned enhancement)

Opened 9 months ago

Last modified 4 months ago

Add support for partial overloads for non-generic locales (en_US, fr_CA, ...) and overloaded locales

Reported by: Julien Assigned to: Julien (accepted)
Priority: normal Milestone:
Component: jelix:core:jLocale Version: 1.0.2
Severity: normal Keywords:
Cc: Php version:
Review: Hosting Provider:
Documentation needed: 0 Blocking:

Description

It could be very powerfull if we could only redefine 1 string for locale en_US, and let Jelix do some kind of merging whith the locale en_EN.

Same idea for overloaded locales in the "overload" directory of modules. Would be very nice to be able to overload just 1 string and not the full file.

Mix both cases and you have this : en_US (overloaded) > en_US (original) > en_EN (overloaded) > en_EN (original).

If everything fails, we have an exception like today.

Is this a good enhancement ?

I have 2 methods for doing this :

1. trying to get the locale recursively and returning it when found.

2. at compilation/caching time, some kind of merging is done and all files (for every locale, original or overloaded) have the full set of strings inside.

Method 2 should be more efficient in production use, because compilation/caching should only be done once, but this compilation/caching process will be more heavy. It also seems simplier to code.

Which method should I choose (please don't answer "both and we'll see" ;) )

Change History

03/06/08 12:35:56 changed by Julien

  • status changed from new to assigned.

03/06/08 13:29:38 changed by laurentj

  • component changed from jelix:core to jelix:core:jLocale.

Method 2 seems better to me although I am afraid of perf issues.

07/02/08 09:39:20 changed by bballizlife

I'd prefer method 2, too, as it will have a compilation and caching process. It's better than getting locale in properties files each times. Counterpart is that the compilation/caching process could take time and ressources. But i think we can't have a perfect solution ;)

07/19/08 00:42:43 changed by laurentj

  • milestone deleted.
Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed