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

[FEATURE] Do you have a plan for the internationalization ? #611

Closed
charlee2025 opened this issue Jul 19, 2018 · 16 comments
Closed

[FEATURE] Do you have a plan for the internationalization ? #611

charlee2025 opened this issue Jul 19, 2018 · 16 comments

Comments

@charlee2025
Copy link

charlee2025 commented Jul 19, 2018

I am from china,I want a doc use zh_cn. Do you have a plan for the internationalization ?

@vogloblinsky vogloblinsky changed the title Do you have a plan for the internationalization ? [FEATURE] Do you have a plan for the internationalization ? Jul 19, 2018
@vogloblinsky
Copy link
Contributor

Hi, i can implement the codebase for that, and you can do a PR for the translations ?

@charlee2025
Copy link
Author

Ok,thank you,I'll do that.

@vogloblinsky vogloblinsky modified the milestones: 1.1.4, 1.2.0 Aug 24, 2018
@vogloblinsky vogloblinsky modified the milestones: 1.2.0, 1.1.4 Aug 27, 2018
@vogloblinsky
Copy link
Contributor

vogloblinsky commented Aug 27, 2018

@lichangfeng Codebase is ready for i18n
You can do a PR by adding your locale in ./src/locales folder

@charlee2025
Copy link
Author

@vogloblinsky Hi~
How can I use it when I add a locale file as zh_CN? Is it a command param of compodoc?

@vogloblinsky
Copy link
Contributor

vogloblinsky commented Aug 28, 2018

yes there is a new flag —language

  • clone the repository
  • npm i inside
  • npm link
    you should have compodoc available globally
  • add your locale inside src/locales, name it TRANSLATION_ZH_CN
  • reference it inside the barrel file src/locales/index.ts
  • edit the src/app/engines/i18n.engine.ts
  • add this kind of line for your locale : i18next.addResources('zh_CN', 'translation', TRANSLATION_ZH_CN);
  • and import the TRANSLATION_ZH_CN constant from locales folder

@charlee2025
Copy link
Author

@vogloblinsky I did it, but when I run:
compodoc ./src -d ./compodoc -p tsconfig.json --theme stripe --hideGenerator --disableSourceCode --disableTemplateTab --disableDomTree --language=zh_CN
it not works.

@vogloblinsky
Copy link
Contributor

Oh sorry, i miss a step :

  • run npm start after the npm install, it will compile the CLI localy

@charlee2025
Copy link
Author

@vogloblinsky ,it still not work, I try npm start and npm build.

@charlee2025
Copy link
Author

@vogloblinsky , I run the cmd in another project:
compodoc ./src -d ./compodoc -p tsconfig.json --theme stripe --hideGenerator --disableSourceCode --disableTemplateTab --disableDomTree --language=zh_CN

@vogloblinsky
Copy link
Contributor

After your npm start you should have this :

> @compodoc/compodoc@1.1.3 start /home/vogloblinsky-local/Documents/www/TMP/compodoc/compodoc
> npm run test:watch


> @compodoc/compodoc@1.1.3 test:watch /home/vogloblinsky-local/Documents/www/TMP/compodoc/compodoc
> npm-watch

No task specified. Will go through all possible tasks
[nodemon] 1.18.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: src/**/*.ts
[nodemon] starting `npm run -s build`

./src/index-cli.ts → dist/index-cli.js...
created dist/index-cli.js in 3.3s

./src/index.ts → dist/index.js...
created dist/index.js in 3.2s
[nodemon] clean exit - waiting for changes before restart

@vogloblinsky
Copy link
Contributor

If you prefer, do you PR with the locale, i will fix it, and after you could test it.

@charlee2025
Copy link
Author

@vogloblinsky Yes, I have done a PR with the locale.

@charlee2025
Copy link
Author

@vogloblinsky , Ok , thank you , it works right now when I close my safe software.

@vogloblinsky
Copy link
Contributor

Cool i have cleaning and adding a control on the requested language with the flag.
Release tonight 1.1.4 if all is fine.

@charlee2025
Copy link
Author

@vogloblinsky , I will create another PR to complete zh_CN.ts.

@lock
Copy link

lock bot commented Sep 30, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants