-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work on I18N class #4
Comments
the value of _id will be like en_US, fr_FR .... Object holds $aLocale array. Object has $locale = en_US for example, to indicate which locate the strings are in. |
What if we do one select where locate $in 'user's locate', 'no-locale-lang', 'default lang'. Then merge these 3 and that's our array! Put it into user's session and reuse! Can EVEN cache this result array in Cache to reuse between users! Just make sure to use the 'tag' in cache so it can be removed from cache easily by using tag. |
Write I18N class based on Mongo. Collection will have string as _id, then object of lang=>string
Then when looking for string we select all translations, if requested lang key not found, then use default lang, if default lang not found (usually this means the findOne will return empty) then use string key itself, replacing _ with space and uppercasing first word. Lang keys should be line 'en_US' or just 'en', not really sure yet.
The text was updated successfully, but these errors were encountered: