Skip to content
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

Support multiple locales concurrent #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jgraichen
Copy link
Contributor

This is the revised patch from rails-timeago as mentioned in #173.

I've added a few tests to test locale detection and selection.

This commit extends the plugin to support loading and using mutliple
locales at the same time. All strings are stored with their language
code. The plugins gets a new `lang` setting denoting the default locale.
For each HTML tag, the plugin will lookup `lang` attribute from the tag,
the configured default lang, or fallback to english.

It will use the `strings` object directly, if no lang key is found at
all, therefore it supports loading and running with older or custom
locale files that are directly assigning strings.
@jgraichen
Copy link
Contributor Author

@rmm5t Anything more needed here to get this merged?

Newer Rails version have some of NPM integration and a few more people asked me to provide a npm package from rails-timeago, but I am always kindly redirecting them to your project. Some were missing the locale support...

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

Successfully merging this pull request may close these issues.

None yet

2 participants