-
Notifications
You must be signed in to change notification settings - Fork 4
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
I18n #17
Labels
enhancement
New feature or request
Comments
aalin
added a commit
that referenced
this issue
Oct 1, 2022
related to #17, wanna do something like this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like that CSS files are close to the component files, so why not I18n files too?
So you would have:
where
MyComponent.intl.en-US.toml
contains:And then inside a component:
If the user has
accept-lang: en-US
they would get translations from.intl.en-US.toml
or.intl.en.toml
... it should always try to find the best language for the user based on their browser preferences, and then there should probably be a way to override this setting with a cookie.I think that would be a good start. Then at some later point it will have to support date formats and pluralization rules.
Would be nice to implement something that matches the JavaScript Intl API.
A cool feature would be that if a component has to fall back on another language than the parent node, it could set the
lang
-attribute on the outer node...So if you're reading a page in Spanish and a component doesn't have translations in Spanish and has to fall back to English, it would generate this:
This way all content on the page will have the correct
lang
specified even when there are multiple languages on a page.The text was updated successfully, but these errors were encountered: