code-d icon indicating copy to clipboard operation
code-d copied to clipboard

i18n

Open WebFreak001 opened this issue 9 years ago • 7 comments

  • Moved nearly all strings into package.nls.json
  • Translations
    • [x] German translation
    • [ ] Swedish translation @Vild pls
    • [x] Japanese translation @alphaKAI maybe?

Swedish is basically just to attract some Swedish users to D and Japanese because a lot of D users are Japanese. Just had German done now because I needed a language to test the feature, but it's also useful because there are a lot of Germans in the D community too.

Adding a translation: Duplicate package.nls.json and name it package.nls.<language>.json, where <language> is a 2 letter language code(?) like de or ja. If you aren't sure what the code is start vscode with the locale of your choice, add console.log(vscode.env.language); to src/extension.ts in the line just after export function activate(...) { and start the extension. The code will get logged right at the top as first message. Then just go in your file and translate all string values.

WebFreak001 avatar Jan 03 '17 19:01 WebFreak001

I saw that @SeijiFujita has some translations of the settings in his repo: https://github.com/SeijiFujita/quiita_works/blob/master/using_vscode_04/using_vscode_04.md#d-configuration-settingjson

@SeijiFujita Are those direct translations that I could include in the japanese translation of code-d in this PR? I can copy them in here if you allow me to, or you could PR into this branch (i18n) if you want to.

WebFreak001 avatar Jan 25 '17 15:01 WebFreak001

You can use translations I uploaded to github. I actively want to participate in PR of code-d i18n. However, I do not understand vscode language nls function, do you have a file to convert to Japanese somewhere?

I decided to create package.nls.ja.json, I saw this page and understood.

I have created "package.nls.ja.json" and changed "package.json". After translating the title of the command, the incremental search did not work. I added a category to package.json.

https://github.com/SeijiFujita/code-d-ja

SeijiFujita avatar Jan 25 '17 23:01 SeijiFujita

Hm the category seems like a nice workaround for https://github.com/Microsoft/vscode/issues/17549 but I would prefer if they fixed that instead of using category.

Usually they take very long to implement those minor side issues and also never really give any feedback on the issue by closing it. But I think because this also affects their extensions, this should get implemented a bit quicker.

Also when done with translating make sure the commands work (just try typing one command) and make sure the status messages work (just set dub.configuration in your workspace settings to something non existent)

Also if you want to have it a bit easier to merge your changes into this repository later, fork code-d (this repository) and run git checkout i18n in the console. You will then be able to PR using github and it's easier to track changes. If you want to be listed in the contributors page on the github project you must do this because otherwise I can only use your additions by copy pasting the files.

WebFreak001 avatar Jan 26 '17 23:01 WebFreak001

understand that "category" thing.

I'd like to create a branch for this "i18n", but I could not. Next I did a fork on code-d and did the following work.

  1. git clone my-fork-code-d.
  2. git checkout -b i18n-ja
  3. add i18n files
  4. git commit
  5. add "package.nls.ja.json"
  6. git commit

Can I PR for this "i18n-ja"? https://github.com/SeijiFujita/code-d/branches

SeijiFujita avatar Jan 28 '17 09:01 SeijiFujita

that should work, I need to merge master into here anyway so that should be fine

WebFreak001 avatar Jan 28 '17 21:01 WebFreak001

But actually the way you did it won't work. Try these steps instead:

  1. git clone my-fork-code-d
  2. git checkout i18n
  3. add "package.nls.ja.json"
  4. git commit

WebFreak001 avatar Jan 28 '17 22:01 WebFreak001

TODO: redo for serve-d rewrite which is now in master

WebFreak001 avatar Apr 03 '18 22:04 WebFreak001