ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
329 stars 37 forks source link

multi-language support #546

Closed StrollStars closed 1 year ago

StrollStars commented 2 years ago

It is recommended to add multi-language support to the interface.

ssborbis commented 1 year ago

What language? I can try running my messages.json through a translator, but it won't be as good as translations maintained by a contributor.

StrollStars commented 1 year ago

I think so. I need Simplified Chinese, but I can't find the language switch setting, it only supports English right now?

ssborbis commented 1 year ago

I need Simplified Chinese, but I can't find the language switch setting, it only supports English right now?

English, French, and an incomplete German translation are the only languages packaged with this addon. If I do manage to get a Chinese translation, the language your browser is set to should determine which language this addon serves automatically. There is no switch within the addon itself.

StrollStars commented 1 year ago

You mean if the extension has a built-in language, it will automatically switch over, otherwise it can only rely on the browser's translation? But the browser's translation is sometimes not good. Do you have staff with simplified Chinese translation available?

ssborbis commented 1 year ago

Just to be clear, you're mostly looking for a translation of the options page, correct?

You mean if the extension has a built-in language, it will automatically switch over

It should prefer whatever your browser UI language is set to, with English as the fall-back language if your UI language isn't found with this addon.

But the browser's translation is sometimes not good.

I've never needed to translate any addon options or menus, so this may be a dumb question. Is that a feature the browser does automatically? Is there some built-in feature that tries to translate this addon's options page into Chinese?

Do you have staff with simplified Chinese translation available?

You're talking to the sole developer, and no, I don't have a translation available. I can either try running my message strings through an online translator and hope for intelligible output, or wait for someone to translate messages.json manually, and post it. If you are bilingual and would like to do the translations, I'd love to add it to this addon.

StrollStars commented 1 year ago

Just to be clear, you're mostly looking for a translation of the options page, correct?

Yes, you are right.

I've never needed to translate any addon options or menus, so this may be a dumb question. Is that a feature the browser does automatically? Is there some built-in feature that tries to translate this addon's options page into Chinese?

Currently, I use the translation function that comes with the browser, but it is not only inefficient, but also not accurate enough.

You're talking to the sole developer, and no, I don't have a translation available. I can either try running my message strings through an online translator and hope for intelligible output, or wait for someone to translate messages.json manually, and post it. If you are bilingual and would like to do the translations, I'd love to add it to this addon.

Simplified Chinese messages.json completed initially, but since I have only just started using this extension, some word scenarios are not understood yet. There is a problem, the messages.json you provided is not the same as the one I installed. To make it easier to see the effect, I translated what I installed.

ssborbis commented 1 year ago

Wow, thanks for the translation. I'll get it into the development branch right away, and hopefully put out a new release in a day or 2.

https://github.com/ssborbis/ContextSearch-web-ext/tree/development/src/_locales/zh-CN

ssborbis commented 1 year ago

I also have a beta up for testing. Your messages.json should be there.

https://github.com/ssborbis/ContextSearch-web-ext/releases/tag/v1.44b1

StrollStars commented 1 year ago

Wow, thanks for the translation. I'll get it into the development branch right away, and hopefully put out a new release in a day or 2.

https://github.com/ssborbis/ContextSearch-web-ext/tree/development/src/_locales/zh-CN

Should I edit directly in your link in the future, or continue editing in my file?

I also have a beta up for testing. Your messages.json should be there.

https://github.com/ssborbis/ContextSearch-web-ext/releases/tag/v1.44b1

The firefox version works as expected, is the chrome version waiting for you to release it later?

logusergithub commented 1 year ago

Sorry for the intrusion. If it helps I can add Italian with pleasure. A good way to repay all the help and if it is useful to contribute.

ssborbis commented 1 year ago

Should I edit directly in your link in the future, or continue editing in my file?

That seems to be how other users are maintaining their translations. It's probably the easiest way for me.

The firefox version works as expected, is the chrome version waiting for you to release it later?

I generally don't make betas for chrome variants, because they can load the addon from the unpacked and unsigned code and keep the addon even after closing the browser. Firefox requires a packed and signed extension if you want to use it beyond a single browser session.

@logusergithub

If you're willing to do translations, I'd absolutely welcome the contribution.

logusergithub commented 1 year ago

@ssborbis Ok. That is the least I can think of. I downloaded and extracted 'messages.json' from v1.44b1. Since this is the first time and to be sure, should I translate only the 'message' entries or also 'description'? I see that there is also a help.html. I know there are dedicated programs for that, but I guess Notepad++ is fine, right? Lastly, for convenience I have to create a repository and I'll post the link for you like @StrollStars did if I understand well.

ssborbis commented 1 year ago

Since this is the first time and to be sure, should I translate only the 'message' entries or also 'description'?

Only the "message" is relevant. The description is more for reference.

I see that there is also a help.html.

Yeah, it seemed a bit much to internationalize every string in the help sections, so I left it as a locale-specific html.

but I guess Notepad++ is fine, right?

That's what I used for years.

Lastly, for convenience I have to create a repository and I'll post the link for you like @StrollStars did if I understand well.

I think you can submit new files directly to my repository as push requests, but I've never done it myself. Either way works to get the ball rolling.

StrollStars commented 1 year ago

That seems to be how other users are maintaining their translations. It's probably the easiest way for me.

I mean I find that the messages.json need to be updated, which link below do you want me to update? https://github.com/ssborbis/ContextSearch-web-ext/blob/master/src/_locales/en/messages.json https://github.com/StrollStars/ContextSearch-web-ext-zh_CN/blob/main/messages.json

I generally don't make betas for chrome variants, because they can load the addon from the unpacked and unsigned code and keep the addon even after closing the browser. Firefox requires a packed and signed extension if you want to use it beyond a single browser session.

Don't be so troublesome, just do what you've done in the past.

ssborbis commented 1 year ago

I mean I find that the messages.json need to be updated, which link below do you want me to update?

Send it here to the development branch, please. I update the main branch from the development branch with each new release.

https://github.com/ssborbis/ContextSearch-web-ext/blob/development/src/_locales/zh-CN/messages.json

StrollStars commented 1 year ago

OK

ssborbis commented 1 year ago

@StrollStars

v1.44 should be live with your Chinese translations. Let me know how it's working out.

StrollStars commented 1 year ago

@ssborbis There is a very sad thing, the simplified Chinese language file could not be loaded successfully. I uninstalled the extension and reinstalled it, but it still doesn't work. Please check it.

@7peanuts 你这边自动更新了扩展没,看看简体中文界面有没有出来。

ssborbis commented 1 year ago

@StrollStars

Ugh, for some reason FF doesn't recognize the "zh-CN" folder, and instead is requiring "zh-cn" ( lowercase ). I don't know if Chrome is that restrictive, but FF appears to be. I'll get a minor release out soon.

ssborbis commented 1 year ago

1.44.1 going up

ssborbis commented 1 year ago

Screenshot_2022-09-14_00-32-58

StrollStars commented 1 year ago

@ssborbis It's not what you think. 1.Something went wrong on Google Chrome. 2.Before I translated, I added the zh-CN folder directly under the _locales folder, and then put the translation file into it, the translation could take effect, but it would not work after the upgrade.

ssborbis commented 1 year ago

@StrollStars

Is it working with either 1.44 or 1.44.1 ?

ssborbis commented 1 year ago

I think there is some discrepancy with the _locale/FOLDER name.

The documentation calls for underscores vs hyphens. I've changed the directory to zh_CN and had good results on chromium. New version 1.44.2 going up. See what your results are.

StrollStars commented 1 year ago

@ssborbis No problem now, I close this issue. Thank you.

7peanuts commented 1 year ago

@ssborbis When I was translating, I found that some notes could not be found in the CS options, have they been removed? The content of the current English source 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?