-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 Milestone 3: Wrap all public-facing strings #16628
Comments
refs TryGhost#16628 I made only these changes as I want to quickly see if my local environment was correctly set up. Only French texts have been translated in this commit.
refs TryGhost#16628 I wanted to try to translate a more complex case, but I think I might need a little help to finish.
refs TryGhost#16628 I made only these changes as I want to quickly see if my local environment was correctly set up. Only French texts have been translated in this commit.
refs TryGhost#16628 I wanted to try to translate a more complex case, but I think I might need a little help to finish.
refs TryGhost#16628 I made only these changes as I want to quickly see if my local environment was correctly set up. Only French texts have been translated in this commit.
refs TryGhost#16628 I wanted to try to translate a more complex case, but I think I might need a little help to finish.
refs TryGhost#16628 I made only these changes as I want to quickly see if my local environment was correctly set up. Only French texts have been translated in this commit.
refs TryGhost#16628 I wanted to try to translate a more complex case, but I think I might need a little help to finish.
refs TryGhost#16628 I made only these changes as I want to quickly see if my local environment was correctly set up. Only French texts have been translated in this commit.
refs TryGhost#16628 I wanted to try to translate a more complex case, but I think I might need a little help to finish.
new language is added |
refs: #16628 Added wrapping for as many easy / simple i18n strings as possible.
refs: #16628 Separate commit for these, this change was a little more complex since the string "Complimentary" was repeated several times, with different additional context. I decided to keep "Complimentary" by itself as a translatable string, and concatenated a second string for the expiry. If this would be better as 3 strings, then we could switch to having these: - "Complimentary" - "Complimentary ({{label}})" - "Complimentary - Expires {{expiry date}}" ^ Makes sense only if the use of parentheses & hyphens would be changed in other locales
refs: #16628 This adds a library for interpolating strings with React components, which allows us to pass HTML elements / React components into our i18n templates. We can further templatize those components to have fully translated, nested components.
refs #16628 - this wraps nearly all of the public strings in member signup/signin emails, so they are ready for translating
refs: #16628 Added wrapping for as many easy / simple i18n strings as possible.
refs: #16628 Separate commit for these, this change was a little more complex since the string "Complimentary" was repeated several times, with different additional context. I decided to keep "Complimentary" by itself as a translatable string, and concatenated a second string for the expiry. If this would be better as 3 strings, then we could switch to having these: - "Complimentary" - "Complimentary ({{label}})" - "Complimentary - Expires {{expiry date}}" ^ Makes sense only if the use of parentheses & hyphens would be changed in other locales
refs: #16628 This adds a library for interpolating strings with React components, which allows us to pass HTML elements / React components into our i18n templates. We can further templatize those components to have fully translated, nested components.
refs: #16628 Added wrapping for as many easy / simple i18n strings as possible.
refs: #16628 Separate commit for these, this change was a little more complex since the string "Complimentary" was repeated several times, with different additional context. I decided to keep "Complimentary" by itself as a translatable string, and concatenated a second string for the expiry. If this would be better as 3 strings, then we could switch to having these: - "Complimentary" - "Complimentary ({{label}})" - "Complimentary - Expires {{expiry date}}" ^ Makes sense only if the use of parentheses & hyphens would be changed in other locales
refs: #16628 This adds a library for interpolating strings with React components, which allows us to pass HTML elements / React components into our i18n templates. We can further templatize those components to have fully translated, nested components.
refs: #16628 Modified a couple of translation strings to reduce complexity and remove duplication
🎨Translated to Spanish fixes TryGhost#16628 TryGhost#16628 The text was updated to Spanish so that the publicly visible strings that have been translated can be seen in Spanish.
🎨Translated to Spanish fixes TryGhost#16628 TryGhost#16628 The text was updated to Spanish so that the publicly visible strings that have been translated can be seen in Spanish.
🎨Translated to Spanish fixes TryGhost#16628 TryGhost#16628 The text was updated to Spanish so that the publicly visible strings that have been translated can be seen in Spanish.
^^ This was inadvertantly closed by the PR but we're basically done here anyway 🙂 |
Hey @daniellockyer quick question could you apply the
Is there a way to include translation into this component? I can help with solving that issue. I'm currently trying to work with Ghost(Pro) to build a Spanish newsletter. |
Hello, @daniellockyer were you able to give this ^ comment a look? I'm not sure if I should create a request in the forum or how to raise this issue. |
Got some code for us? Awesome 🎊! Please include a description of your change & check your PR against this list, thanks! - [x] There's a clear use-case for this code change, explained below - [x] Commit message has a short title & references relevant issues - [x] The build will pass (run `yarn test:all` and `yarn lint`) We appreciate your contribution! Explanation: There are some missing accents in: https://github.com/TryGhost/Ghost/blob/4c598a1e6d382191ac0d5ba769a25ea847f9ac53/ghost/i18n/locales/es/comments.json#L18-L19 And https://github.com/TryGhost/Ghost/blob/4c598a1e6d382191ac0d5ba769a25ea847f9ac53/ghost/i18n/locales/es/comments.json#L37 Specifically in: Conviertete, Se. So instead of including accents I just used simpler words so it sounds as a more natural translation, I have already translated my whole newsletter https://crecimientoconsciente.co/ to Spanish I'm just finishing some wording details. Also if you could please give a check to this [comment](#16628 (comment)) in milestone 3 of translations for official support in email paywall cta. Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
This issue is part of our community i18n project. The full project is documented on the Ghost forum.
✨ We have now started shipping our i18n beta in Ghost, and we're merging community pull requests to add & update languages.
However, not all public-facing strings in Portal and our member emails are currently interpolated for translations. In order to have a full set of translations, we need to ensure all strings are wrapped with the
t(..)
helper.How to work on this issue
Setting up
yarn dev --portal
to get things running at http://localhost:2368/Enable Portal translations (beta)
from http://localhost:2368/ghost/#/settings/labsWrapping strings
Once you've found a public-facing string from code review or by using Portal/Ghost signup emails, you can easily wrap it so it will be picked up for translation.
t('..')
around the stringa. You may need to import the
t
function from the AppContext in Portalyarn translate
withinghost/i18n
to ensure the locale JSON files include the new stringsYou can see plenty of examples of how this is currently done using this search query: https://github.com/search?q=repo%3ATryGhost%2FGhost+path%3Aghost%2Fportal+%7Bt%28%27&type=code
Please take extra care to ensure you pass any variables into the
t
function, and make sure HTML escaping does not cause problems with the output.Contributing
Commit the changes and submit a PR for us to review and merge 🙂
Be sure to read the contributing guide and reference this issue on the 3rd line of the commit: https://github.com/TryGhost/Ghost/blob/main/.github/CONTRIBUTING.md
Thank you to all contributors on the i18n beta so far 🙏🏻
If you speak a language that is not included in our current set of supported languages, please consider submitting it 🌐
The text was updated successfully, but these errors were encountered: