Open eamodio opened 5 years ago
I have tried to implement i18n with vscode-nls
.
Then encountered a lot of difficulties
I found that vscode-nls
is not so friendly.
here we go:
1. vscode-nls
is not a standalone package
We have to use Transifex
as a third-party hosting service that hosts i18n files.
If we need to modify the translation file, we need to log in Transifex
and add a collaborator to modify it.
This undoubtedly prevents developers from further contributing to translation.
In order to integrate Transifex
We have to use Gulp
, which is not very compatible with the workflow
2. official i18n example
documenation not clear
How to write i18n file?
3. vscode-nls
API too complicated
What did this function do?
That's all!
This is my experience after trying to use vscode-nls
, very bad
I I disapprove follow offcial i18n example
to implement i18n.
Here is my solution for easy use: https://github.com/axetroy/vscode-gpm https://github.com/shanalikhan/code-settings-sync
While I agree that the official i18n sample is seemingly over complicated and the documentation is not very clear, the vscode-nls
library which is standalone as far as can see, seems straight forward. I don't see where vscode-nls
has any dependency on Transifex
-- where is that?
Also will the files that have the localized strings be in the same format in what you are proposing vs vscode-nls
?
The examples you've posted are full extensions -- what are the pieces (and dependencies if any) that would be brought into GitLens?
vscode-nls
does not matter with Transifex
.
But the official i18n example uses it. If you use vscode-nls
alone, you have to explore it yourself.
The examples I've posted is the solution. not a library.
localized strings format same with official solution
You can see here:
English by default:
Chinese Simplified
OK, sounds good -- thanks for the information. FYI, will also need to make sure the solution works well with webpack -- which will likely mean avoiding the use of require
to load json files on disk -- instead use readFileSync
@eamodio
Yes, the project must have the translation files.
Add copyPlugin to webpack to copy the translation file to the dist directory.
Because there is too much place to translate.
I suggest that the first stage of the translation of the command / configuration just fine.
@axetroy works for me! Thanks again! Looking forward to the PR
@eamodio Yes. I am working on it.
This will take a lot of time due to a large number of configuration items.
PR is coming soon...
Actually,there is a more convenient way to implement i18n. Microsoft already has a tool called vscode-nls-dev , this tool automates the extraction of strings to be externalized from TS and JS code. And you can also add localization using Transifex.
@chouzz PR is very welcome 😄
@chouzz are you working on this? If not, I'd take a look.
Quick update: I almost finshed a basic i18n system that uses vscode-nls-dev / webpack, but unfortunately I was quite occupied with other things in the last weeks. I hope to finish it next week.
vscode-nls-dev does not necessarily require a localization platform like Transifex (or Crowdin). In the most basic version one could just edit the json files that contain translations, and that is how my PR will work. I suggest that selecting and implementing the usage of a platform should follow in a separate PR.
Editing json files directly through a PR is definitely not an ideal option. If you want many users helping out you will need to set up a Crowdin project otherwise the idea will most likely die pretty fast
@ImRodry Yes, I am not saying that this project shouldn't use Crowdin or something comparable. I wanted to say that it is the second step and therefore should only be done after the first step - implementing vscode-nls-dev - is finished.
But I think it should all be put in the same PR since the only thing crowdin needs is a crowdin.yml file on the repo and the rest is handled by the managers of the project on Crowdin itself. The configuration file should also be pretty simple
非常希望能得到本地化的支持,这个插件非常棒
Hey everyone!
Do we have an update on this topic? I'm just looking around, maybe I can help with this!
Just FYI, I've made a pull request introducing i18n support. I expect it may take some time until it can be approved and merged.
@eamodio 我为它等了太久了,有什么能帮忙的吗😂
Now can use l10n to support other language https://github.com/microsoft/vscode-loc
Excuse me, how is the progress, looking forward to supporting multiple languages as soon as possible
I'm also looking forward to support for Chinese!
Here is a sample extension using the vscode-nls library