-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Translation support #2314
Comments
Here's a list of labels to mark for i18n:
I would also add the following to the things to do:
My proposal would be to use
|
Am I understanding correctly that with this approach:
|
Yes, indeed. It would be strange, though, not to translate ng-bootstrap widgets if you translate the remaining of the application, wouldn't it? But indeed, if you only use alert and datepicker (for example), the trans-units for all the other widgets will also be extracted. I guess you can just not translate them.
No, indeed. I don't see any way of achieving that other then inventing our own translation mechanism (as we sort of did for datepicker month/day labels), using a service that could be provided at the component level. It's currently not possible to change the text, so it's at least a step in the right direction. I know the Angular team is working on a runtime translation mechanism (as opposed to the the current compile-time mechanism), but I don't know if they plan to support such a use-case (i.e. a contextual translation of the same component)
I haven't found such a text in the rating's template, but if it existed, it could be translated. Suppose the template contains |
@maxokorokov I feel like what you are listing are general problems with / limitations of the current Angular system and not something specific to ng-bootstrap use-case. I'm not saying that those problems don't exist, just saying that those should be solved at the framework level rather than on this library level. As such I would vote for merging @jnizet PR as at least it allows people using Angular built-in method to to translate things. It doesn't mean that we shouldn't try to fix the current translation system. And we should not stop looking for a better translation support. But hey, baby steps :-) |
@pkozlowski-opensource @jnizet, oh I have nothing against the PR, on the contrary actually! For instance, for angular/material they've decided to have a translation service, ex: https://material.angular.io/components/datepicker/api#MatDatepickerIntl And with the Anyway we shouldn't invent our own translation system right now. And services like in the link above could be added on top / in parallel later if necessary.
Yep, because it's actually in one of methods; But I like your idea as a workaround, I think it should work. |
We need to make sure that people can translate strings in ng-bootstrap widget templates. Things to do:
The current thinking is that we will support Angular translations so the majority of the process should boil down to adding
i18n
attributes in the templates of widgets needing translationsThe text was updated successfully, but these errors were encountered: