Closed 7peanuts closed 1 year ago
I translated the help.thml file into Chinese, but it doesn't take effect. What other places need to be modified?
I'll take a look to see why that's not loading. The code should load whatever help.html
is in the current locale dir.
I found that some information in the messages.json file was not found in the CS configuration options, will this affect translation?
Nah, any omissions or mistakes, etc will simply be replaced by words from the default messages.json
, i.e. English. As long as the .json is well formed, you can't really go wrong.
The content of the current messages.json file is arranged in alphabetical order, and it is not very easy to find the corresponding position in the options, is there a better way?
I don't think so. I just check HTML through the source code, the Web Developer inspection tools, or the console for errors related to i18n messages and correct as I go. I suppose I could add some code to aid translators in the future; some way of showing the messages.json
code that corresponds to each string the the options page.
Can you open up a console window from the CS Options page and enter this command
browser.i18n.getUILanguage();
That should tell you what directory it's looking in for help.html
I wonder if this is the old zh-CN vs zh_CN issue. We'll see
That should tell you what directory it's looking in for help.html
I wonder if this is the old zh-CN vs zh_CN issue. We'll see
Got it, I put the help.html
in the zh-CN
folder and it shows up.
But in dark mode, the bold font will not be visible.
Also, the sample gifs seems to no longer exist, so maybe I'll make a few to put in there sometime.
Got it, I put the help.html in the zh-CN folder and it shows up.
Good deal
But in dark mode, the bold font will not be visible.
I'll update the dark css
Also, the sample gifs seems to no longer exist, so maybe I'll make a few to put in there sometime.
Shoot. You'll have to replace all instances of /native-app-support/
with /master/
. Should be a quick find & replace. I just did the English version
I've added the hidden option developerMode
. When enabled, if you click on a word or sentence in the options page, the keyword for that message in messages.json
is copied to the clipboard and echoed in the console. That might help with translations in the future.
Some of those videos need to be updated too
You'll have to replace all instances of /native-app-support/ with /master/. Should be a quick find & replace.
I have replaced, now I can see the animation.
So, how do I upload the translated help.html
, create a new zh-CN
folder?
So, how do I upload the translated help.html, create a new zh-CN folder?
Do you mean on my repo or yours? I tend to use software the integrates with github to manage my source code, so directories and files are put where they need to be with the click of a button. For a long time, I did most of my updates through the browser, which can be tedious. You can just post files here until you get comfortable working the web interface.
I tend to use software the integrates with github to manage my source code, so directories and files are put where they need to be with the click of a button.
If I create a new zh-CN
folder, so that there will be two Chinese translation folders.
Should I create pull requests in the development branch?
If I create a new zh-CN folder, so that there will be two Chinese translation folders.
I would like to figure out whether one will do. It seems odd we'd need both to get the translations working properly. I'll look around to see how other addons are managing this.
Should I create pull requests in the development branch?
Yes, please. I tend to reserve the master branch for releases.
Ok, it looks like all locale folders need to have underscores, not hyphens. I've consolidated your help.html
and messages.json
into the folder zh_CN
and removed the other folder. I also added code to fix the help.html issue ( I think ) . Test it out when you get a chance. I'm prepping for a release soon.
Ok, it looks like all locale folders need to have underscores, not hyphens. I've consolidated your
help.html
andmessages.json
into the folderzh_CN
and removed the other folder. I also added code to fix the help.html issue ( I think ) .
I downloaded the development branch folder and copied them to the 1.45.3_0 folder, but it didn't work.
Hmm... I'll see what I can do from here with changing locales, but I've found it problematic for testing. I won't release until this is sorted.
Ok, I see what's going on. I'll post here when I have something to test.
I've added the hidden option
developerMode
. When enabled, if you click on a word or sentence in the options page, the keyword for that message inmessages.json
is copied to the clipboard and echoed in the console. That might help with translations in the future.I won't release until this is sorted.
I am looking forward to this feature, it will be very helpful to improve translation after release. Locales can be released later.
I am looking forward to this feature
It's in the dev branch now, if you're sideloading.
I also pushed what I hope is the fix for all these _locale issues. I've added a new message LOCALE_FOLDER
to every messages.json
file. This will tell the options page the exact folder to look for help.html
in. There didn't seem to be a way to get the folder programmatically, so this is the easiest solution. Fingers crossed...
I also pushed what I hope is the fix for all these _locale issues. I've added a new message
LOCALE_FOLDER
to everymessages.json
file. This will tell the options page the exact folder to look forhelp.html
in. There didn't seem to be a way to get the folder programmatically, so this is the easiest solution. Fingers crossed...
AHA, now I can see the translation of help.html
.
In addition, I added some tips to the help.html
.
help.zip
Thanks.
Coincidentally, I'm having a back-and-forth with some Mozilla devs over files in _locale/xx/ folders. I can no longer submit a new release to Mozilla because this addon fails validation if any files other than messages.json
appear in a locale folder as of a few weeks ago. I may need to relocate the help.html
files in the future. Just a heads-up.
mozilla fixed their issues. Your translations should be live in AMO and Chromestore shortly. Open a new issue if run into any problems
That's awesome, this 1.46 update is quite informative, I'll try it one by one.
help.thml
file into Chinese, but it doesn't take effect. What other places need to be modified? Here is my translated help file ➡️ help.zip I set the language to the following but none of them worked.html lang="en" "zh-CN" "zh_CN"
messages.json
file was not found in the CS configuration options, will this affect translation? The content of the currentmessages.json
file is arranged in alphabetical order, and it is not very easy to find the corresponding position in the options, is there a better way?