-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: add translation support #2870
Conversation
e20d928
to
8eb3801
Compare
I assume the new package |
Hey @barthc. Not necessarily - in case you're using Webpack with the |
I like the approach here. I also like that all supported languages are managed inside this repo. That makes contributing new translations quite easy. I will open a PR later today to provide the german translations. |
During working on the german translation I realized that translating widget strings is currently not possible. For example "Choose an image" |
Here is the PR with the german translation #2877 |
Can you please open a separate issue for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid, I'm pretty much good with this as is. My only thought besides my review comment is to register all non-en locales (so de currently) in the netlify-cms package. The pattern thus far has been to let that package "just work" so only configuration changes are needed to enable functionality, at the expense of extra script size. As mentioned before, I expect that tech debt to be paid with lazy loading in the future.
@@ -49,6 +49,7 @@ | |||
"netlify-cms-widget-select": "^2.4.3", | |||
"netlify-cms-widget-string": "^2.2.3", | |||
"netlify-cms-widget-text": "^2.2.3", | |||
"netlify-cms-locales": "^0.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually start new packages at 1.0.0, partly for parity and partly because the semver caret range only gets patch releases for pre-1.0 packages. I'm also cool with just using a different range that will get feature bumps and keeping it at 0.0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to 1.0.0
Updated the package version and registered all locales for |
* feat: add translation support * test(cypress): fix locale import * docs: add locale documentation * feat: add german translation (decaporg#2877) * fix: locales package version, register all locales in netlify-cms
* feat: add translation support * test(cypress): fix locale import * docs: add locale documentation * feat: add german translation (decaporg#2877) * fix: locales package version, register all locales in netlify-cms
* feat: add translation support * test(cypress): fix locale import * docs: add locale documentation * feat: add german translation (decaporg#2877) * fix: locales package version, register all locales in netlify-cms
Fixes #789
Inspired by #2528 and #2278.
Similar mechanism as https://github.com/date-fns/date-fns/blob/aa1daea6a8a1493429330cdd82ae7c325a97b902/src/index.js
@erquhart I added a new package for the locales, I'm not sure how to go about versioning and publishing it