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

[Localization] Fix lang code for Chinese Simplified (again!) #8549

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

chr56
Copy link
Contributor

@chr56 chr56 commented Jun 25, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

First spotted in #2865.

However, it seems this problem has still been existing after merging #2865 .
It merely fixed the half of this problem.

The strings.xml file in /values-b+zh+HANS+CN should be moved to /values-zh-rCN again. Then the /values-b+zh+HANS+CN should be deleted and Weblate should be configured correctly.

You can also skip reading these complicated PR & Issues, see summary below:

Currently, there are two resource value files to Chinese Simplified:

  • b+zh+HANS+CN
    BCP 47 language tags, supported ONLY since Android N (API 24), (See Android Devoloper ), Weblate always updates this one, but it's supported only since Android 7, and honestly, BCP 47 is seldom seen( zh-rCN is quite been used regularly).

  • zh-rCN
    Standard language code under ISO 639-1 and ISO 3166-1-alpha-2 (See Android Devoloper ), supported almost at a very beginning, but it is outdated because Weblate will NOT update this one.

What I did in this PR is removing weird b+zh+HANS+CN and moving it to standard and ordinary zh-rCN.

Before/After Screenshots/Screen Record

Changes of resource, no need to make Screenshots.

Fixes the following issue(s)

Just Potential bugs, no issues related.
UPDATE: Actually #6469 (it should be seen on Android 5.0 to Android 6 now) and #6468 (It might be a side effort that Weblate could not recognize BCP 47 tag, so failed to build plural strings. see also PR #6545).
Besides, Weblate#7312

APK testing

No need, but
app-debug.zip (Signed with my key)

Due diligence

@triallax
Copy link
Contributor

triallax commented Jun 25, 2022

The strings.xml file in /values-b+zh+HANS+CN should be moved to /values-zh-rCN again. Then the /values-b+zh+HANS+CN should be deleted and Weblate should be configured correctly.

@Stypox @litetex I believe both of you have Weblate access, can you see if you can do anything about this?

Edit: I went ahead and asked in WeblateOrg/weblate#7312 (comment).

@Stypox
Copy link
Member

Stypox commented Jun 25, 2022

Doesn't this fix #6469? If so please link it in the "Fixes the following issues" section

@chr56
Copy link
Contributor Author

chr56 commented Jun 25, 2022

Doesn't this fix #6469? If so please link it in the "Fixes the following issues" section

Yes and no, only devices running Android 6 (API 23) and below might meet the problem of "not consistent with source code (#6469)", Android 7 and higher should not have this problem.

@chr56
Copy link
Contributor Author

chr56 commented Jun 25, 2022

Also, These duplicated files might cause Failed to change file masks.

@Geeyun-JY3
Copy link
Contributor

Geeyun-JY3 commented Jun 25, 2022

Doesn't this fix #6469? If so please link it in the "Fixes the following issues" section

Yes and no, only devices running Android 6 (API 23) and below might meet the problem of "not consistent with source code (#6469)", Android 7 and higher should not have this problem.

No. Please see #6469 (comment). I can reproduce it on Android 9. String is consistent with zh-rCN if it is included in the strings.xml file in /values-zh-rCN. If not, it is consistent with b+zh+HANS+CN.

@triallax triallax added bug Issue is related to a bug localisation / translation Everything that has to do with translations or Weblate labels Jun 25, 2022
Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

LGTM

@Stypox Can we merge this or should we wait until after the release.

@chr56
Copy link
Contributor Author

chr56 commented Jul 4, 2022

LGTM

@Stypox Can we merge this or should we wait until after the release.

If you asked me, I would like to choose waiting until release of v0.23.1.
After all, this is a manual modification on localization except source string.
I am afraid this PR might have potential damages to other localizations (such as causing unsynchronized translation, data loss or something else).
And if possible, please sync with Weblate as soon as possible, if this PR were really merged.
@Stypox @litetex

Copy link
Member

@Stypox Stypox 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! I am making sure everything is ok with Weblate by:

  • locking weblate
  • pushing all of the weblate changes since the release onto dev: 8d26d9d
  • resetting weblate, since weblate was complaining about conflicts
    • this did not cause any loss of information, as I just pushed all changes manually the step above ^
    • -> weblate now shows 0 pending changes, 0 outgoing commits and 0 missing commits
  • rebasing this PR on top of dev
  • force-pushing this PR
  • merging this PR
  • resetting weblate again
  • unlocking weblate

@Stypox Stypox merged commit acc34cb into TeamNewPipe:dev Jul 5, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug localisation / translation Everything that has to do with translations or Weblate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants