Open nukeop opened 5 years ago
When adding translations, a few things need to be done:
{
...
"scripts": {
...
"i18n": "sync-i18n --files 'app/locales/*.json' --primary en --languages fr [your locale] --space 2"
}
...
}
npm run i18n
{
name: 'language',
category: 'program-settings',
type: settingType.LIST,
prettyName: 'language',
placeholder: 'language-placeholder',
options: ['en', 'fr', <your locale>],
default: undefined
}
...
import en from './locales/en.json';
import <your locale> from './locales/<your locale>.json';
...
resources: {
en,
...
<your locale>
},
...
you can now translate your locale file from english to your language.
After you're done, you can add your translation to the readme, under "Community translations".
Hey @nukeop, I would like to help you translate Nuclear from English to Danish if this has any interest?
Absolutely, in general if you don't see a language on the list above, we want it added. Thanks for the help.
What kind of things or phrases would you like to be translated? I'm a native English speaker but I took a few years of Chinese (Mandarin, so I write simplified). I may not be able to do much, but I would be happy to start and do as much as I can.
You can see a list of all strings that have to be translated here: https://github.com/nukeop/nuclear/blob/master/app/locales/en.json
Even if you only translate a part of it, any missing strings fall back on default English. And some is better than nothing.
(This might not be the appropriate place for this, so I apologize and let me know if/where you want me to move this.) Do I need to run npm run i18n
before editing app/constants/settings.js and app/i18n.js? I'm having some issues with setting up the NPM dev environment for working on this repo, and I'm wondering if I could just edit the files in the meantime to try and get started on the translations while I troubleshoot.
npm run i18n just fill the new json file with english translation. you can copy paste en.json content to (your locale).json, it will do the same.
wich error do you get when you setup dev environment ?
(If I should have posted this in pastebin or something else, let me know. I know different repos have different protocols for this type of thing.)
arf windows :'( :'(
There is a few things you can try:
I think it's a matter of running npm install
first.
Yeah, I reinstalled and it loaded, it's just stuck on the nuclear logo screen. Would I be able to run the i18n command though, or do I need to figure out why the app isn't loading first? (Again, sorry for clogging up this issue. Is there a better place for me to go for this, or is here fine?)
So, I was afraid this would be an issue with translating to Chinese, but even when I save the zh.json
file with Unicode encoding it doesn't properly parse...how should I go about trying to handle this?
Talking about it here is fine. Could you start a pull request with the changes you've made so far so I can pull them and check? Maybe it'll work fine for me, and even if it doesn't I'll be in a better position to judge what's wrong.
Hey there! I would like to translate it to Russian! Let me know what you think!
Sure, this is a great idea. Let me know if there are any problems.
Talking about it here is fine. Could you start a pull request with the changes you've made so far so I can pull them and check? Maybe it'll work fine for me, and even if it doesn't I'll be in a better position to judge what's wrong.
I think I figured it out. I saved it with Unicode encoding but I should have saved it as UTF-8. sigh
Now I just have to figure out how to actually get the program to get past the logo and I can test and submit a pull request.
This is coming along really, really well. We've got 9 languages already, and it's barely been two weeks.
Hi there! Though it's my first time to contribute to a GitHub project, I would like to translate it into Chinese(Traditional). Can I give it a try?
Absolutely, everyone is welcome to contribute.
Hi :) I'll start to translate it to hebrew
Thank you. Let me know if it causes any problems, I don't know if RTL languages will be rendered correctly.
Just to make sure (and sorry for the newbie question) - should I open a branch and work on the relevant files locally, and when I finish - to do a pull request?
First you need to fork the repository using the button in the top right corner. This creates your own copy. Inside that copy, you can either create a new branch, or work on the master branch (up to your preference). After you're finished, you'll have the option to create a new pull request from the branch you worked on to my repo.
Thank you. Let me know if it causes any problems, I don't know if RTL languages will be rendered correctly.
Is there a way to check the RTL before I'll complete the translation?
You can try starting the development version and selecting your new language in the settings.
$ npm install
$ npm run watch && npm run electron:dev
Thanks :) Well, I've translated most of the strings but some of the strings contain words or phrases that should remain be in english, even after the translation (like "API", "Last.fm" and so on). In these cases, when the string contain english and hebrew both, There is a RTL issue. So I think that these strings will remain in english and in the future we can add some css fixes for RTL version (and then I'll translate the mixed strings). What do you think? :)
Ok, I'll look into it and how to handle it best.
For reference: https://langsolinc.com/rtl-language-direction-in-css-basics/
Hi I just translated some phrases into Chinese, and made a pull request. Link is here
Thank you, appreciated.
@avirec https://www.i18next.com/overview/api#dir
Looks like it can be automatically detected whether or not a given language is RTL. However, this will need additional styles applied, not just to text but also to e.g. reverse the order in which buttons and labels appear in some contexts. It is likely that this will have to be developed as a separate feature.
@nukeop Great. I can do it (I mean - the css chenges for the RTL version)
Hi! I'm new to github but I'd like to help to translate it to Indonesian. How do I start?
@weninglaks have a look here: https://github.com/nukeop/nuclear/wiki/Translating
Has the translation of the Chinese version already finished? If not, I would love to contribute to it.
Thanks!
@Zhenye-Na Nope, not yet. You can see all the needed strings here: https://github.com/nukeop/nuclear/blob/master/app/locales/zh.json
@nukeop Great! May I work on to finish it right now? Also, are there any guidelines to start with?
Sure, feel free to translate whatever's left. Normally you'd have to add some code to enable a new translation but this one's already in the program so you don't need to do anything other than the translation itself.
Hi I could help with translating Chinese! Is there anything that I can contribute to or help with?
Thanks for the offer @zhr1996 ! You can find more info here: https://nukeop.gitbook.io/nuclear/contributing/translating
In the case of Chinese, you only need to translate the remaining strings, since all the other parts are already completed.
@nukeop Thanks! I'll try to translate them and pull request!
Hi, I can contribute to translating it in Filipino (Tagalog). Is the project still accepting translations?
Yep, of course! We don't have Filipino yet. It would be great to add it.
Hi, gonna work on translating into Slovak language.
Hey there! I would like to translate it to Korean! Let me know what you think! :)
Sure, there is no Korean translation yet, it would be a fantastic addition.
Hello, I can try to finish the remaining translation for Chinese, since there is already a zh.json file, I can just make the changes in zh.json then upload the pull request correct? do i still need to update the i18n script in packages/app/package.json by adding your locale??? thank you kindly
You only need to translate the remaining strings. There will be more gaps as we add new features, so there's often something new to add.
Hello, I could help with Greek if you want to have it :)
Sure, we don't have Greek yet.
We're looking for contributors who are willing to translate Nuclear to their native languages (or any languages that they know well). Currently @charjac has done all the work required to add new translations, and also translated all the strings to French.
Suggest translations here: https://crowdin.com/project/nuclear
Guidelines can be found here: https://nukeop.gitbook.io/nuclear/contributing/translating