-
-
Notifications
You must be signed in to change notification settings - Fork 27
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 angular tutorial article #437
Conversation
👷 Deploy request for tolgee-web pending review.Visit the deploys page to approve it
|
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
Once you hit the save button, it will generate an API key under the Integrate section. Make sure to save the key somewhere. You will be using it later. | ||
|
||
## Step 3: Install Tolgee |
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.
Creation of angular project should be separate step
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
Add the `NgxTolgeeModule` in the import section and provide a Tolgee instance in the providers. Our default application language is en you can change it to fr or es depending on your preferences. Lastly, we import the environment variable we added earlier which will help us to communicate with the server. | ||
|
||
## Step 6: Translate Your Texts and Export the files: |
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.
From now on, it feels like you still need to get what's the most important benefit of Tolgee. With the toggle-SDK installed, you can add the keys by alt + clicking them. So you can add the key to the code and then translate it directly in the running app. You don't have to go to the platform and add it manualy. https://tolgee.io/js-sdk/in-context
I actually don't blame you for not getting it correctly. It's more that our documentation could be structured better so the reader who directly goes to the angular section finds out about this. Sorry! 😢
Hey! Sorry, for that I wasn't reviewing the Vue.js article, but can you fix the same issues there? |
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.
Much better. Please fix accordingly and sync the Angular and Vue! Your work is much appreciated! Thanks a lot! 🚀 🐁
|
||
![Translation dialog](/img/blog/vue-tutorial/translation_dialog.png) | ||
|
||
Once you have added your translations, click on the save button to store your translations in the Tolgee Platform. |
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.
You can also mention, that you can add screenshots in the same time and Tolgee automatically collects context of the translations for usage with the Tolgee translator. https://tolgee.io/blog/tolgee-ai-translator
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.
New user's might be confused, why we use this approach, so it would be great if you supported it with few arguments.
- It's faster then edit the localization .json or add it to the platform manually
- To fix such key, you have just to click the string. Any team member can do that with Tolgee chrome plugin. Not only developers.
- You can generate screenshots by clicking the camera. This way future translators will know the context and will translate the string correctly
blog/2023-06-28-vue-tutorial.md
Outdated
|
||
Once you have added your translations, click on the save button to store your translations in the Tolgee Platform. | ||
|
||
Equally, you can follow the same process to update your translations. |
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.
Also, for importing lot of translations from large codebase, there is the CLI extract command. (It works only for React now, but we are working on Vue and Angular implementations) https://tolgee.io/tolgee-cli/extraction/syncing-strings
blog/2023-06-28-vue-tutorial.md
Outdated
|
||
![List of translations](/img/blog/vue-tutorial/translation_list.png) | ||
|
||
Tolgee also allows you to export your translations in `json` files. In your Tolgee dashboard, click on export in the left menu, then select the languages you want then click on export |
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.
You should mention here, that this can be done automatically in CI/CD tool via REST API or Tolgee CLI. So user's wont think that they have to manually export it all the time.
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.
It's almost fine. Thanks a lot! 🚀
Please sync the changes with both the articles.
Thanks! 🤘
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
### Automated Translation | ||
|
||
Tolgee can help you automate your translation process. It has a platform that integrates with machine translation services, such as Google Translate and AWS, to automatically translate your content. This ensures that your translations are accurate and consistent. |
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.
It would be great to mention Tolgee translator here. With it, the translation can be almost autonomous!!! https://tolgee.io/blog/tolgee-ai-translator
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
- The DevTools() is used for in-context translating in dev mode | ||
- The FormatSimple() enables you to pass variables into translations | ||
- The BackendFetch() fetches data from the custom backend |
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.
You actually don't use the BackendFetch plugin and you don't need it in most cases. Only thing the plugin does is that if you published your i18n data for example on https://example.com/i18/en.json
, etc., it can fetch the data from there. But it's not something you should cover in this article.
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
In case you have a lot of translations from large codebase, you can use the [CLI extract command](https://tolgee.io/tolgee-cli/extraction/syncing-strings). (It works only for React now, but we are working on Vue and Angular implementations) | ||
|
||
To export your translations, click on the Export menu in your left menu |
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.
Sorry, I didn't mention this before. This part should be called "Preparing for production". And it also should cover, how you provide the data if you don't specify your API key. You should also mention that the API should never be leaked.
When you build the app for production, you export the data (prefarably using the CLI) and then you provide it as a staticData configuration property. (or you can use BackendFetch), but that's not the optimal way we recommend. You can read more about that here: https://tolgee.io/js-sdk/integrations/angular/installation#preparing-for-production
and here:
blog/2023-07-12-angular-tutorial.md
Outdated
|
||
Now, navigate to `src` folder in your angular project and create `i18n` folder. Add the content of the extracted file to this folder. | ||
|
||
![Create I18n folder](/img/blog/angular-tutorial/angular_i18n.png) |
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.
You don't have to show the full contents of the files here. It's very long for the article.
Tolgee angular tutorial article
Tolgee angular tutorial article