-
Notifications
You must be signed in to change notification settings - Fork 42
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
Internationalization code seems ok, any progress? #17
Comments
Hey @uvworkspace actually that is perfect. Years ago I did an i18n library for JS - at https://github.com/deitch/jsorm-i18n now a little dated - but the structure was the same. The concept is exactly that, you should be able to use files that end in The only place in activator that the default language is used explicitly is those two lines in activator.js where it calls The only question I have is whether or not We definitely do not want to start parsing the Thanks for the great suggestions; we'll set up some tests and implement! |
Done. v0.4.4. Git push and npm publish complete. Enjoy! |
Well thanks a lot. I proposed so I don't have to clone it and modify just several lines. :). |
Actually was harder than I expected. The tests took some time to get just right, and although the |
Yes I can see it now. I need to control the locale used for different user based on url query and/or session, so the locale assignment is done earlier, and using Accept-Language header is not enough for me. Now I guess later someone who want to use it may ask to use a different property name, then allowing user to configure it in init() may be good enough for a longer while, I guess. Thanks for the hard work. |
So? Go ahead and put in middleware to set Look in the |
And you are quite welcome! Use it well. |
I looked at the code trying to make it work for my project for different locales. In activator.js I just replace 'en_US' with variable lang, whose value is obtained from req.lang passed in from previous middleware. Now I can add templates of different locales in the template directory.
This is just a quick hack, a little better maybe define another configurable property (similar to idProperty but on req). I'm wondering if this direction is ok (to the extent that you guys will consider it, or you have some plan regarding internationalization). Thanks.
The text was updated successfully, but these errors were encountered: