New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x Add support for language translations #2527

Closed
arantius opened this Issue Jul 25, 2017 · 32 comments

Comments

Projects
None yet
6 participants

@arantius arantius added this to the 4.x milestone Jul 25, 2017

@arantius arantius modified the milestones: 4.x, 4.1 Oct 18, 2017

@arantius

This comment has been minimized.

Collaborator

arantius commented Nov 13, 2017

I have yet to find anything (though haven't looked much) like BabelZilla for web extensions. I worry that translations are impractical without a tool like that to help.

@Sxderp

This comment has been minimized.

Contributor

Sxderp commented Nov 13, 2017

I'm not sure I follow. I can't quite figure out what BabelZilla (as a tool/library/api, not the community) provides over the i18n provided in native WebExtension APIs.

Of course getting things translated is another matter. As that requires people. In which utilizing their interfaces and submitting the extension for translation is an avenue.

@arantius

This comment has been minimized.

Collaborator

arantius commented Nov 13, 2017

I'm referring to the latter. A tool to help organize the volunteers, fill in partially-translated files, etc. Everything its WTS did.

Especially: if we add a new string it could automatically copy the English version, so we don't have to do that by hand to make a new release.

@yfdyh000

This comment has been minimized.

yfdyh000 commented Nov 13, 2017

Especially: if we add a new string it could automatically copy the English version, so we don't have to do that by hand to make a new release.

API does this, "default_locale": "en".

https://www.transifex.com/, https://crowdin.com/, etc.

@arantius arantius modified the milestones: 4.1, 4.2 Nov 23, 2017

@arantius arantius modified the milestones: 4.2, 4.3 Jan 5, 2018

arantius added a commit to arantius/greasemonkey that referenced this issue Jan 26, 2018

Move strings into locales.
Use a pattern like gettext() where the original string stays in the source, so the source is still readable.
This means a lot of copy/paste into _locales/en/messages.json.

Include a few strings in German, because I can speak it _just_ enough to test in German.  Just to be sure it's working.

Fixes greasemonkey#2527

@arantius arantius closed this in 9ce5dab Jan 26, 2018

arantius added a commit to arantius/greasemonkey that referenced this issue Jan 26, 2018

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 26, 2018

We're registered now:

https://www.transifex.com/--131/greasemonkey/

But I don't know how this site works yet; reach out to me if you'd like to contribute a translation.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Dunno either. Signed up for german, using de or de_DE...

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Some issues (on transifex)...
First, my first activation mail timed out. Does it matter? Don't think so...
Tried to join, no immediate result. No access to the "team", not translators shown, maybe you have to take action(s)...
Is it de [German], de_DE [German (Germany)], or both?

@tobbexiv

This comment has been minimized.

Contributor

tobbexiv commented Jan 27, 2018

I use transifex for some other projects (and also requested to join for German).

There is a setting available that new requests to join a translation team will be automatically accepted. However, it seems to be set to off here. So, @arantius needs to accept every single new request.

There are also options to give more rights to other transifex members so they can help to accept new langauge requests / manage the team. This can also be restricted to only one language.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

That's what I've thought...

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

@tobbexiv Is it just me, or doesn't anybody (else) have access to Greasemonkey team?

@arantius Please enable access, this is weekend here...

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 27, 2018

I use transifex for some other projects (and also requested to join for German).

There is a setting available that new requests to join a translation team will be automatically accepted.

I can't find this.

Please enable access, this is weekend here...

The only way I know how to do that is to click the "invite" button which requires an email address.

Also renamed so the link is now https://www.transifex.com/greasemonkey/teams/

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Got an acceptance mail...

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 27, 2018

There is a setting available that new requests to join a translation team will be automatically accepted.

I can't find this.

Oh, found it! Should have spent a few seconds more. I think you might need to ask me to manually create languages though?

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

I think you might need to ask me to manually create languages though?

Just performing that task now, not sure about the review part though (we'll see)...

Correction: Translation works; new languages are probably your task...

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Hmm, where can I find these?

  • Matches:
  • $1 does not @grant method $2
  • Does not run on:

@tobbexiv Please review de [German]

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 27, 2018

Matches:
Does not run on:

Both the install dialog. If you have the right settings on the script.

$1 does not @grant method $2

That's only an error message which "should never" show up. In fact probably shouldn't be translated (I left other internal messages non-translated).

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Ah, found the first two of them now. It was a HTML file src/content/install-dialog.html

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 27, 2018

Overview:

  • English (en) [source language] 0% reviewed 100% translated
  • German (de) 0% reviewed 100% translated
  • Chinese (China) zh_CN Requested by: yfdyh000
  • German (Germany) de_DE Requested by: Eselce
  • Japanese ja Requested by: 100の人 (so many? Giggle...)

Not sure about lang vs. fully qualified lang_COUNTRY codes...
Chinese may even distinguish between traditional and simplified!

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 28, 2018

I've just pushed 0552f5f by downloading that file from transifex. I've also seen language requests, and (requesting to) joining a language should be (approved) automatic.

I denied "de_DE" because we already have "de". Please explain to me why we need both if you really want it.

@Sxderp

This comment has been minimized.

Contributor

Sxderp commented Jan 28, 2018

I denied "de_DE" because we already have "de". Please explain to me why we need both if you really want it.

Dialect differences? I don't know if it's much of a concern but that's a reason many places have en_US and en_UK.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 28, 2018

It's just a design (sometimes also practical) decision. I'd say, the only restriction is to be consistent.
These phrases are probably not so complicated, that you'll have to distinguish between e.g. swiss german and "german" german, although all over germany, there are quite a lot of local differences.
If you want to have a "fine line", you should provide language AND region (country).
For 35 phrases, this is probably not necessary. So I'm fine with just having de here as a sufficient setting.
(Another question is: Is the system able to choose de, if de_DE is set as language? Probably yes.)

en_US and en_UK are pretty usual though (funny, transifex uses en_GB instead of en_UK).

If you look at the requests (except from mine), there's ja (japanese) and zh_CN (chinese/mainland China).
And - as I mentioned - you may want to choose traditional chinese and simplified chinese, which are kind of very different. Mainland chinese may prefer simplified, while hk and tw usually use traditional chinese (or not?). When I think of japanese, there are also some different kinds of so called writings (and readings).
On another occasion, I've had some lengthy discussions with natives, and we've ended for the CJK languages with zh (simplified), zh-tr (traditional), ja and ko.

Actually, this made me look at Google translator, they use the same 4 categories...

@yfdyh000

This comment has been minimized.

yfdyh000 commented Jan 28, 2018

I think the Enabled and Disabled labels should change to Disable and Enable, as well as get a separate string key. In addition, New user script ... to New user script....

@tobbexiv

This comment has been minimized.

Contributor

tobbexiv commented Jan 28, 2018

I checked it and changed a few strings @Eselce
Main focus was to stay as near as possible on the original string and also consistency to translate the same words the same way.

Regarding the language codes: How is the language determined? If it is based on the firefox language, then it would be the best to have the same country keys. If it's independent, then it's up to arantius.

However, for German I usually don't know a difference between de and de_DE.

@arantius

This comment has been minimized.

Collaborator

arantius commented Jan 28, 2018

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 29, 2018

@tobbexiv Thanks a lot. I've checked most of the code locations and executed menus/dialogs/editor in order to decide, which phrases are best. That doesn't always mean word-by-word translation.
I can't really see, if you changed more than "Runs on:" and "Does not run on:" (do we need special "reviewers"?), I don't quite like any of our 4 translations each! It's the string on the installation dialog, followed by the @include and @exclude patterns respectively. That's why "Läuft auf:" etc. sounds quite silly. Same for "Matches:" for @match pattern, I'm not happy with that either...

Ah, found another (Anfrage/Abfrage)... Could be both for "request", that's okay...
Another (trust sources)... okay
Click Install... anklicken/wählen... The idea was, that Install(ieren) is selected (green), you can probably just type enter. But it's easy to convince me, that "click" is good enough...
Tab/Seite... I really don't like the Tab part. There's also a gender problem (diesen/dieses oder gar diese?). Scripts do operate on html pages within tabs or windows. Page sounds much better and is easier to comprehend!
aktiv/aktiviert and inaktiv/deaktiviert... A question of preference...

Looks like we have a common ground (there's only that tab stuff, that I really don't like)...
(and we should find a better solution for the @include, @exclude, @match patterns)
Is there no changelog overview? Had to go through all the phrases...
And there will probably be "0 reviewed" as long as there's no reviewer (not that this matters)...

This should work for us (use de only):

  1. Otherwise, if the current locale is qualified with a region (e.g. en_US) and there is a messages.json file for the regionless version of that locale (e.g. en), and that file contains the string, return it.
@tobbexiv

This comment has been minimized.

Contributor

tobbexiv commented Jan 29, 2018

@Eselce
Maybe we should move our discussion from here to transifex for discussions about specific translations. I created an issue comment with the Matches string so we can discuss the translation for match, include, exclude. I agree with you, that none of them sounds best. The comments are language specific, so we can also discuss in German. Might make the discussion easier.

Same me for Tab / Page discussion

Click Install... anklicken/wählen... The idea was, that Install(ieren) is selected (green), you can probably just type enter. But it's easy to convince me, that "click" is good enough...

Other way around: You convinced me. Changed it back.

aktiv/aktiviert and inaktiv/deaktiviert... A question of preference...

I thought this should be consistent and as it was deaktiviert in all places except one, I changed the one different place.

You can also filter for issues.


Reviewed strings cannot be changed anymore (except if you "unreview" it). Thus, it is possible to "freeze" translations using this functionality. So, I don't know whether it is necessary now. Might be good once we kind of finalized the translations. In other projects where I have the review option, I ponly review my own strings after several months so possible improvements can be made. So I would say this has time until arantius is more firm with transifex and how it works.

You can use different filters like "Translated before / after", "Translator", "Issue" ... by clicking on the search line above the list with translations / strings.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 29, 2018

ACK

Didn't know that about "review"...
Thanks for the filter hint!

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 29, 2018

@yfdyh000

I think the Enabled and Disabled labels should change to Disable and Enable, as well as get a separate string key.

Are you sure about that? Remember, when you have an active script and click on that name,
you'll get the submenu with (*) Enabled selected. If you choose that item, the script will be
deactivated, showing ( ) Disabled. Disable/Enable would describe the action to change the
status, not the status itself. I think, Enabled/Disabled is quite right, considering, that we also
use Greasemonkey is active and Greasemonkey is disabled...

In addition, New user script ... to New user script....

I would prefer that as well. That space looks weird for me...
(see any other Firefox menu that you have!)

@yfdyh000

This comment has been minimized.

yfdyh000 commented Jan 30, 2018

@Eselce Indeed, this seems to make sense that clicking the button will not close the pop-up menu, so describing its state itself (along with a checkbox) is acceptable.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Jan 31, 2018

@esperecyan "Does not run on:" shows the @exclude entries (just like @include and @match before)

Summary:

Chinese (China) (zh_CN) 0 strings to translate 35 strings to review | ready for use
German (de) 0 strings to translate 35 strings to review | ready for use
Japanese (ja) 0 strings to translate 35 strings to review | ready for use
@esperecyan

This comment has been minimized.

Contributor

esperecyan commented Jan 31, 2018

@Eselce Thank you. I had mistakenly input the translation into not message property but description.

@Eselce

This comment has been minimized.

Contributor

Eselce commented Feb 1, 2018

Regarding the language codes: How is the language determined?

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization#Localized_string_selection

I've tried to inspect all 4 versions, which lead to the surprising question:

How do I set the locale appropriately?

On the Settings page, I can choose a language, but it doesn't work (still german)!

(BTW: zh_CN is called zh-cn there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment