-
Notifications
You must be signed in to change notification settings - Fork 345
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
Basic language support (i18n) #49
Basic language support (i18n) #49
Conversation
Oh cool! I won't be able to take a look until next week but excited.
|
Hey @CharlBest. I've been thinking about these PRs. They are really helpful features, and I could see a lot of people benefiting from it. They also increase the complexity for someone who doesn't want the feature, and increase the cost to maintain the template. I'm trying to think of a way to make them available, without taking the complexity/maintenance hit. For example:
Here's a proposal:
Thoughts? Other ideas? |
That sounds pretty reasonable to me. Only thing is that it may not be a bad idea to combine multiple features into one branch? Reduces work a bit. I don't have a strong opinion on this though. |
I’d lean to different branches to minimize work for people who want to use only one of them. That way they don’t need to parse it and delete some after the cherry pick. @CharlBest thoughts? |
@CharlBest thoughts? Would love to get these into the right place. |
0f53636
into
CriticalMoments:extension/internationalization
Sorry for only chipping in now. I was away on holiday for 2 weeks. I agree that not everyone will use these features which means they will have to remove unused code from the boilerplate/template you provide which isn't great so I think your suggestion makes sense. 😀 |
Basic support for multiple languages (internationalization - i18n)
Zero dependency, based on the implementation in Daisy UI docs
Usage:
It can be used in HTML in 2 ways. Either by using the component
<T k="key" />
or by calling the translate function{@html $t("key")}
In javascript, you can also call the function as follows
$t("key")
Language picker:
Example of translated text: