Skip to content
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

Update localization from Transifex Brave order #7099

Merged
merged 5 commits into from
Sep 5, 2019

Conversation

bbondy
Copy link
Contributor

@bbondy bbondy commented Sep 3, 2019

This is a PR to uplift localized strings in a compatible format for MetaMask.

  • Adds support for 33 new languages to MetaMask.
  • Updates some missing strings to the other files.
  • Fixes some formatting errors in the localization files.

Since https://github.com/brave/ethereum-remote-client (which is forked from MetaMask) is not always based on the same version as the develop branch, I made a small repo here to do the uplifting in a safe way:
https://github.com/bbondy/upstream-brave-wallet-strings-to-metamask

It's just a tool that reads the MetaMask locale files and the Brave ones, and puts in any missing string from MetaMask that Brave has.

Note that Brave isn't supporting these locales yet, so no string additions / fixes for those:
hn, ht, and ph.

This is changing in this PR, but MetaMask was using tml for ta which I think was wrong.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is incredible!

Would you mind adding the new locales to the locale index in app/_locales/index.json?

Also, a few messages were removed recently in #7013 : privacyMode, privacyModeDescription, approvalData, and approvalDataDescription.

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

@Gudahtt I updated the PR, things are split nicely in commits for easier review.

New changes include:

  • Fix verify locale script bugs
    • All locales didn't work because it was putting an object inside of an object.
    • Individual checks didn't work because of how the destructuring was done.
    • Extra items were being printed as missing items.
  • Splitting out changes to strings
  • Splitting out work to remove extra strings in localized files
  • Splitting out work to add extra strings that are missing in localized files (English should always be present if the localized string is missing)
  • Added missing languages to index.json

Here's the output of the verify script:

tamarin:metamask-extension bbondy$ node development/verify-locale-strings.js

Locale Verification
Verifying all locales:


Status of **አማርኛ (am)** 100.00% coverage:
Full coverage  : )


Status of **Arabic (ar)** 100.00% coverage:
Full coverage  : )


Status of **български (bg)** 100.00% coverage:
Full coverage  : )


Status of **বাংলা (bn)** 100.00% coverage:
Full coverage  : )


Status of **català (ca)** 100.00% coverage:
Full coverage  : )


Status of **Čeština (cs)** 100.00% coverage:
Full coverage  : )


Status of **dansk (da)** 100.00% coverage:
Full coverage  : )


Status of **Deutsche (de)** 100.00% coverage:
Full coverage  : )


Status of **ελληνικά (el)** 100.00% coverage:
Full coverage  : )


Status of **English (en)** 100.00% coverage:
Full coverage  : )


Status of **Español (es)** 100.00% coverage:
Full coverage  : )


Status of **Español (es_419)** 100.00% coverage:
Full coverage  : )


Status of **Estonian (et)** 100.00% coverage:
Full coverage  : )


Status of **فارسی (fa)** 100.00% coverage:
Full coverage  : )


Status of **Suomi (fi)** 100.00% coverage:
Full coverage  : )


Status of **Filipino (fil)** 100.00% coverage:
Full coverage  : )


Status of **Français (fr)** 100.00% coverage:
Full coverage  : )


Status of **ગુજરાત (gu)** 100.00% coverage:
Full coverage  : )


Status of **עברית (he)** 100.00% coverage:
Full coverage  : )


Status of **मानक हिन्दी (hi)** 100.00% coverage:
Full coverage  : )


Status of **हिन्दी (hn)** 100.00% coverage:
Full coverage  : )


Status of **Hrvatski (hr)** 100.00% coverage:
Full coverage  : )


Status of **Kreyòl ayisyen (ht)** 100.00% coverage:
Full coverage  : )


Status of **Magyar (hu)** 100.00% coverage:
Full coverage  : )


Status of **Bahasa Indonesia (id)** 100.00% coverage:
Full coverage  : )


Status of **Italiano (it)** 100.00% coverage:
Full coverage  : )


Status of **日本語 (ja)** 100.00% coverage:
Full coverage  : )


Status of **ಕನ್ನಡ (kn)** 100.00% coverage:
Full coverage  : )


Status of **한국어 (ko)** 100.00% coverage:
Full coverage  : )


Status of **Lietuviškai (lt)** 100.00% coverage:
Full coverage  : )


Status of **Latvian (lv)** 100.00% coverage:
Full coverage  : )


Status of **മലയാളം (ml)** 100.00% coverage:
Full coverage  : )


Status of **मराठी (mr)** 100.00% coverage:
Full coverage  : )


Status of **Malay (ms)** 100.00% coverage:
Full coverage  : )


Status of **Nederlands (nl)** 100.00% coverage:
Full coverage  : )


Status of **Norwegian (no)** 100.00% coverage:
Full coverage  : )


Status of **Pilipino (ph)** 100.00% coverage:
Full coverage  : )


Status of **Polskie (pl)** 100.00% coverage:
Full coverage  : )


Status of **Português (pt)** 100.00% coverage:
Full coverage  : )


Status of **Português (pt_BR)** 100.00% coverage:
Full coverage  : )


Status of **Português (pt_PT)** 100.00% coverage:
Full coverage  : )


Status of **Limba română (ro)** 100.00% coverage:
Full coverage  : )


Status of **Русский (ru)** 100.00% coverage:
Full coverage  : )


Status of **Slovenčina (sk)** 100.00% coverage:
Full coverage  : )


Status of **Slovenščina (sl)** 100.00% coverage:
Full coverage  : )


Status of **српски (sr)** 100.00% coverage:
Full coverage  : )


Status of **Svenska (sv)** 100.00% coverage:
Full coverage  : )


Status of **Swahili (sw)** 100.00% coverage:
Full coverage  : )


Status of **தமிழ் (ta)** 100.00% coverage:
Full coverage  : )


Status of **తెలుగు (te)** 100.00% coverage:
Full coverage  : )


Status of **ไทย (th)** 100.00% coverage:
Full coverage  : )


Status of **தமிழ் (tml)** 100.00% coverage:
Full coverage  : )


Status of **Türkçe (tr)** 100.00% coverage:
Full coverage  : )


Status of **українська мова (uk)** 100.00% coverage:
Full coverage  : )


Status of **Tiếng Việt (vi)** 100.00% coverage:
Full coverage  : )


Status of **中文(简体) (zh_CN)** 100.00% coverage:
Full coverage  : )


Status of **中文(繁體) (zh_TW)** 100.00% coverage:
Full coverage  : )

And here's the output of an individual check, which was also broken before:

tamarin:metamask-extension bbondy$ node development/verify-locale-strings.js am
Locale Verification
Verifying selected locale "am":
Status of **አማርኛ (am)** 100.00% coverage:
Full coverage  : )

2 new commits to support these changes weren’t made in bbondy/upstream-brave-wallet-strings-to-metamask

Only include translated items if they exist in the en destination file
bbondy/upstream-brave-wallet-strings-to-metamask@2baf61d

Add English strings if strings are missing
bbondy/upstream-brave-wallet-strings-to-metamask@11b96fe

@Gudahtt
Copy link
Member

Gudahtt commented Sep 4, 2019

Thanks! I appreciate the effort in making this easier to review, this is quite helpful.

Add English strings if strings are missing

We fallback to the en locale at runtime for any missing strings, so duplicating these strings in each locale without them isn't required. It also looks like they were added with the wrong format anyway (they're of the form "[message-name]": "[message]" instead of "[message-name]": { "message": "[message]" })

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

Good catch on the format thing, will update in a couple hours.

I'll change it to not include the extra strings from the source locale if you prefer that way too.
Some projects like to have it for localizers who edit things directly in the locale file.

@Gudahtt
Copy link
Member

Gudahtt commented Sep 4, 2019

Hmm. I can see how that might be useful. It would necessitate a change to our development workflow though - maybe the addition of some step in CI to prevent us from adding new messages without adding them to all locales, and a tool to help with that. It would also make it more difficult to determine where gaps did exist in translation.

I'm certainly open to the idea, but I think it would be best left to a separate PR.

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

@Gudahtt good to go, new supporting commit for the conversion script is bbondy/upstream-brave-wallet-strings-to-metamask@31e53c1

@mapmeld
Copy link
Contributor

mapmeld commented Sep 4, 2019

A few quick changes:

  • Someone previously added Tamil as tml; whether you update tml or move it, check that it's not duplicated and there's only one listing in index.json
  • Español and Português are written twice in index.json, change a sub-locale (e.g. Brazilian Portuguese)
  • I would use العربية for Arabic in index.json
  • Capitalizing on Català, Dansk, and Українська

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

Someone previously added Tamil as tml; whether you update tml or move it, check that it's not duplicated and there's only one listing in index.json

There is only 1 entry for tml. The diff just shows it as removed/added.

@mapmeld
Copy link
Contributor

mapmeld commented Sep 4, 2019

Oh I mean Tamil/தமிழ் /tml is the same language as the ta being added

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

Oh I mean Tamil/தமிழ் /tml is the same language as the ta being added

Oh ok, I renamed tml to ta since I think ta is correct.

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

@mapmeld OK those changes are done.

Español and Português are written twice in index.json, change a sub-locale (e.g. Brazilian Portuguese)
I would use العربية for Arabic in index.json
Capitalizing on Català, Dansk, and Українська

@bbondy
Copy link
Contributor Author

bbondy commented Sep 4, 2019

@Gudahtt @mapmeld ok please take another look. I also included a lot more changes due to another change that were missing before.

@mapmeld
Copy link
Contributor

mapmeld commented Sep 4, 2019

There are some phrases in old tml which I don't see in the new ta messages; is it possible to merge these in some way?
On the other points, everything looks good, thanks for this

- All locales didn't work because it was putting an object inside of an object.
- Individual checks didn't work because of how the destructuring was done.
- Extra items were being printed as missing items.
@bbondy
Copy link
Contributor Author

bbondy commented Sep 5, 2019

@mapmeld Merged tml into ta code
@Gudahtt Fixed endOfFlowMessage8

Ready for re-review.

@bbondy
Copy link
Contributor Author

bbondy commented Sep 5, 2019

Before:

Status of **Čeština (cs)** 47.40% coverage:
Status of **Deutsche (de)** 46.46% coverage:
Status of **English (en)** 100.00% coverage:
Status of **Español (es)** 76.54% coverage:
Status of **فارسی (fa)** 92.91% coverage:
Status of **Français (fr)** 66.93% coverage:
Status of **Kreyòl ayisyen (ht)** 68.19% coverage:
Status of **हिन्दी (hn)** 42.83% coverage:
Status of **Italiano (it)** 99.69% coverage:
Status of **日本語 (ja)** 39.84% coverage:
Status of **한국어 (ko)** 82.20% coverage:
Status of **Nederlands (nl)** 42.83% coverage:
Status of **Pilipino (ph)** 32.13% coverage:
Status of **Polskie (pl)** 61.73% coverage:
Status of **Português (pt)** 42.83% coverage:
Status of **Русский (ru)** 46.93% coverage:
Status of **Slovenčina (sk)** 46.77% coverage:
Status of **Slovenščina (sl)** 75.91% coverage:
Status of **ไทย (th)** 42.83% coverage:
Status of **தமிழ் (tml)** 47.40% coverage:
Status of **Türkçe (tr)** 47.40% coverage:
Status of **Tiếng Việt (vi)** 32.13% coverage:
Status of **中文(简体) (zh_CN)** 49.45% coverage:
Status of **中文(繁體) (zh_TW)** 80.47% coverage:

After:

Status of **አማርኛ (am)** 97.80% coverage:
Status of **العربية (ar)** 97.95% coverage:
Status of **български (bg)** 97.95% coverage:
Status of **বাংলা (bn)** 98.11% coverage:
Status of **Català (ca)** 95.59% coverage:
Status of **Čeština (cs)** 45.83% coverage:
Status of **Dansk (da)** 95.59% coverage:
Status of **Deutsche (de)** 94.49% coverage:
Status of **ελληνικά (el)** 97.64% coverage:
Status of **English (en)** 100.00% coverage:
Status of **Español (es)** 81.89% coverage:
Status of **Español (Latin America) (es_419)** 96.69% coverage:
Status of **Estonian (et)** 97.48% coverage:
Status of **فارسی (fa)** 97.95% coverage:
Status of **Suomi (fi)** 97.80% coverage:
Status of **Filipino (fil)** 89.76% coverage:
Status of **Français (fr)** 94.65% coverage:
Status of **ગુજરાત (gu)** 9.76% coverage:
Status of **עברית (he)** 97.80% coverage:
Status of **मानक हिन्दी (hi)** 97.95% coverage:
Status of **हिन्दी (hn)** 42.83% coverage:
Status of **Hrvatski (hr)** 97.32% coverage:
Status of **Kreyòl ayisyen (ht)** 66.14% coverage:
Status of **Magyar (hu)** 97.48% coverage:
Status of **Bahasa Indonesia (id)** 95.43% coverage:
Status of **Italiano (it)** 96.54% coverage:
Status of **日本語 (ja)** 45.51% coverage:
Status of **ಕನ್ನಡ (kn)** 98.11% coverage:
Status of **한국어 (ko)** 97.32% coverage:
Status of **Lietuviškai (lt)** 98.27% coverage:
Status of **Latvian (lv)** 97.64% coverage:
Status of **മലയാളം (ml)** 9.76% coverage:
Status of **मराठी (mr)** 9.76% coverage:
Status of **Malay (ms)** 95.59% coverage:
Status of **Nederlands (nl)** 41.73% coverage:
Status of **Norwegian (no)** 96.06% coverage:
Status of **Pilipino (ph)** 28.19% coverage:
Status of **Polskie (pl)** 96.38% coverage:
Status of **Português (pt)** 42.52% coverage:
Status of **Português (Brazillian) (pt_BR)** 96.54% coverage:
Status of **Português (European) (pt_PT)** 11.81% coverage:
Status of **Limba română (ro)** 96.22% coverage:
Status of **Русский (ru)** 46.61% coverage:
Status of **Slovenčina (sk)** 95.12% coverage:
Status of **Slovenščina (sl)** 95.59% coverage:
Status of **српски (sr)** 97.01% coverage:
Status of **Svenska (sv)** 96.06% coverage:
Status of **Swahili (sw)** 96.85% coverage:
Status of **தமிழ் (ta)** 51.81% coverage:
Status of **తెలుగు (te)** 9.76% coverage:
Status of **ไทย (th)** 53.23% coverage:
Status of **Türkçe (tr)** 46.61% coverage:
Status of **Українська мова (uk)** 98.11% coverage:
Status of **Tiếng Việt (vi)** 32.44% coverage:
Status of **中文(简体) (zh_CN)** 95.75% coverage:
Status of **中文(繁體) (zh_TW)** 96.06% coverage:

Only a couple of them show down in coverage but that's because unused extra strings that shouldn't be there were removed.

@mapmeld
Copy link
Contributor

mapmeld commented Sep 5, 2019

Looks good to me! :shipit:

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nothing else has caught my attention.

@Gudahtt Gudahtt merged commit 93204a5 into MetaMask:develop Sep 5, 2019
@Gudahtt Gudahtt added this to the UI Sprint 19 [Aug 19] milestone Sep 12, 2019
@mapmeld mapmeld mentioned this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants