Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Locale config files #4

Closed
alexweissman opened this issue Jun 14, 2017 · 2 comments
Closed

Locale config files #4

alexweissman opened this issue Jun 14, 2017 · 2 comments
Assignees
Milestone

Comments

@alexweissman
Copy link
Member

Yaml files for storing metadata about locales.

@lcharette wants to have a separate config file for each locale.
I think we just need one config file per Sprinkle for all locales.

Either way they will get merged and cached.

Discuss.

@lcharette
Copy link
Member

I just think it's better organized if each language has it's own file. It also allow to easily distribute languages packs (In a world where we don't want to ship UF with Klingon built-in for example)

Two more things : dependencies and compiling

Right now, any locale can uses a base locale. For example when using [en_US, fr_FR], if a string doesn't exist in French, it's english version will be displayed. This could be fixed with dependencies where base languages can depend on one other language, still while keeping the ability to daisy chain them : fr_CA depends on fr_FR who itself depends on en_US. This could be defined in the locale yaml config file.

Also, as of now on every request all the languages files are loaded. If each locale consist of 10 php files , loading english on top of English result in 20 files being read at runtime. This could be optimized by compiling the two languages and all their files together and caching the result. Subsequent request will only have to "read one file" and load one set of result.

@lcharette
Copy link
Member

Ready in 4.4 / develop

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants