Ticket #489 (assigned enhancement)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: Julien Owned by: Julien
Priority: normal Milestone:
Component: jelix:core:jLocale Version: 1.0.2
Severity: normal Keywords:
Cc: Php version:
Review: Hosting Provider:
Blocked By: Documentation needed: no
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

Changed 2 years ago by Julien

  • status changed from new to assigned

Changed 2 years ago by laurentj

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

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

Changed 2 years ago 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 ;)

Changed 2 years ago by laurentj

  • milestone Jelix 1.1 beta 1 deleted
Note: See TracTickets for help on using tickets.