Skip to content
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: ability to generate content.json in multiple languages #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MSakamaki
Copy link

#45 step 1

@d3lm
Copy link
Member

d3lm commented Dec 15, 2019

Hey there! I would really like to come back to i18n and I appologize for not showing up for so long. I was quite busy with work.

So this is step 1 of getting translations in.

Can you please rebase this branch on latest master? Right now it has conflicts and to continue with this we need to resolve these conflicts.

For step 2 I would also suggest to use transloco instead of ngx-translate as it appears to be not maintained anymore and there are too many open and unresolved issues.

Do you have experience with transloco already or would you mind divining into it? Otherwise I'd pull in @maartentibau for the transloco part. He's interested as well in contributing.

Does this PR work for transloco as well?

@MSakamaki
Copy link
Author

@d3lm
Thank you for your reply!
I am interested in this task and willing to continue.

Unfortunately I don't have transloco experience, but now I will learn and challenge transloco!
https://github.com/ngneat/transloco

We will update step1 in the next few days, please wait.

@maartentibau
Copy link

maartentibau commented Dec 16, 2019

Hi @MSakamaki this might maybe help you.

https://gist.github.com/maartentibau/8f2c1c7bd64831520bb63028bba314ca

It is more or less the basic setup of Transloco when using a custom loader.
In this case all the language files are located in the ./assets/i18n/ folder, but of course you can change that.

For starters, if you have ever worked with ngx-translate then Transloco will feel very familiar, the only difference is that Transloco has some nice extra features and is actively maintained.

Docs can be found here: https://netbasal.gitbook.io/transloco/

If you need Transloco as a dependency for your unit tests, in 99% of the cases it's enough to just add TranslocoTestingModule to you imports array and you're good to go.

@d3lm
Copy link
Member

d3lm commented Dec 16, 2019

Yay! Super happy to hear you wanna continue with this PR. Thanks so much. This will be a great addition.

@MSakamaki MSakamaki force-pushed the i18n-step1-content-multiple-languages branch from 6b79c1b to 12bb202 Compare December 18, 2019 05:46
@MSakamaki
Copy link
Author

MSakamaki commented Dec 18, 2019

@d3lm @maartentibau
I rebased this branch on latest master, and tried translating and building templates using transloco.

Since we confirmed that this could be integrated without problems, we will update the procedure to suit transloco.
In accordance with the use of transloco, some transration guidelines and issues #45 steps were updated.
Please let me know if you have any questions or mistakes.

Thanks!

TRANSLATION.md Outdated
The following tasks are required to add a new language.
[See available code here](https://github.com/angular/angular/tree/master/packages/common/locales).

- Add word transration file ​​in `src/assets/i18n/[lang-code].json`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: transration

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maartentibau, I fixed it! (and unknown space)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maartentibau for keeping an eye on this too! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants