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

Fix wrong lang code of Chinese,and clean up useless strings.xml #2865

Merged
merged 15 commits into from
Feb 15, 2020
Merged

Fix wrong lang code of Chinese,and clean up useless strings.xml #2865

merged 15 commits into from
Feb 15, 2020

Conversation

chr56
Copy link
Contributor

@chr56 chr56 commented Dec 14, 2019

See issue #2819 first.
The action contains:

  • Delete app/src/main/res/values-cmn/strings.xml , which is useless and don't take effect.
  • Move the file in in /values-b+zh+HANS+CN to /values-zh-rCN, because the priority is: zh-rCN >b+zh+HANS+CN

This will make Newpipe app have a up-to-date translation of Simplified Chinese.
closes #2819

@TobiGr TobiGr added the localisation / translation Everything that has to do with translations or Weblate label Dec 15, 2019
@TobiGr TobiGr added this to the 0.18.2 milestone Jan 13, 2020
chr56 and others added 2 commits January 14, 2020 21:00
/values-b+zh+HANS+CN was updated.
Action: copy file in /values-b+zh+HANS+CN to /values-zh-rCN
app/src/main/res/values-zh-rCN/strings.xml Outdated Show resolved Hide resolved
app/src/main/res/values-zh-rCN/strings.xml Outdated Show resolved Hide resolved
app/src/main/res/values-zh-rCN/strings.xml Outdated Show resolved Hide resolved
app/src/main/res/values-zh-rCN/strings.xml Outdated Show resolved Hide resolved
app/src/main/res/values-zh-rCN/strings.xml Outdated Show resolved Hide resolved
Copy link
Member

@TobiGr TobiGr 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 for the effort! I think this is almost good to go, just two minor things which need to be fixed first.
@B0pol Thanks for the review 👍

app/src/main/res/values-zh-rCN/strings.xml Show resolved Hide resolved
app/src/main/res/values-zh-rCN/strings.xml Show resolved Hide resolved
@chr56
Copy link
Contributor Author

chr56 commented Feb 1, 2020

It takes time to find all mistakes. please wait

@@ -1,457 +1,539 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
Copy link
Member

@B0pol B0pol Feb 1, 2020

Choose a reason for hiding this comment

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

Please update your branch and test if it works to manually select Simplified Chinese through Settings -> Content -> App language.

It should not work as you moved b+zh+HANS+CN to zh-CN, then edit this line, change zh-hans into zh-cn and test again, it should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

O K

Copy link
Member

@B0pol B0pol Feb 1, 2020

Choose a reason for hiding this comment

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

It works because b+zh+HANS+CN is in the value folder. But it will select the file in b+zh+HANS+CN, and not in zh-CN.

I don't understand why do you keep b+zh+HANS+CN, because if I understood the reason of the PR, b+zh+HANS+CN is a duplicate of zh-CN? If b+zh+HANS+CN is the same as zh-CN, you should delete the folder, because Weblate will still update b+zh+HANS+CN, not zh-CN, and also change zh-hans here into zh-cn.

btw, can you check if these lines are good? The first should be traditionnal chinese, the second simplified chinese, the third hong-kong chinese, then cantonese I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a historic problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works because b+zh+HANS+CN is in the value folder. But it will select the file in b+zh+HANS+CN, and not in zh-CN.

I don't understand why do you keep b+zh+HANS+CN, because if I understood the reason of the PR, b+zh+HANS+CN is a duplicate of zh-CN? If b+zh+HANS+CN is the same as zh-CN, you should delete the folder, because Weblate will still update b+zh+HANS+CN, not zh-CN, and also change zh-hans here into zh-cn

I'm afraid that it will influence Weblate.

Copy link
Member

Choose a reason for hiding this comment

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

I'm afraid that it will influence Weblate.

But that's the goal, all translations have to be done through Weblate. You won't be able to make PRs every updates to update zh-CN. So it has to be fixed once and then use Weblate.

Copy link
Contributor Author

@chr56 chr56 Feb 1, 2020

Choose a reason for hiding this comment

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

I'm afraid that it will influence Weblate.

But that's the goal, all translations have to be done through Weblate. You won't be able to make PRs every updates to update zh-CN. So it has to be fixed once and then use Weblate.

The problems I(we) faced is:
there are two various that take effect—zh-rCN(this file),b+zh-hans-cn . Weblate always updated the first one, b+zh-hans-cn won't be updated,and is old.
System will check zh-rCn first,if the target string existed,it will fetch it,if the target string doesn't existed in zh-rCn,it will try b+zh-hans-cn and do same action.And if it doesn't exist either,it will just fetch target string in English.
But zh-rCn is out date in master Branch now ,if strings in zh-rCn exist, System won't check b+zh-hans-cn then, however,many strings in zh-rCn is wrong, and even you change them in b+zh-hans-cn using Weblate, it doesn't take effect (because zh-rCn is as same as before)!

so, I moved b+zh-hans-cn to zh-rCN. if merging successfully, then delete b+zh-hans-cn (also try to let Weblate update zh-rCn ,so I(we) can directly use Weblate to translate Newpipe)

BTW, does every language in Weblate have a source file,and Weblate just edit them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, can you check if these lines are good? The first should be traditionnal chinese, the second simplified chinese, the third hong-kong chinese, then cantonese I guess.

Yes , but we usually don't say them in our language.
And the " Hong Kong Chinese" is also called as Cantonese!

Copy link
Contributor Author

@chr56 chr56 Feb 1, 2020

Choose a reason for hiding this comment

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

btw, can you check if these lines are good? The first should be traditionnal chinese, the second simplified chinese, the third hong-kong chinese, then cantonese I guess.

Yes , but we usually don't say them in our language.
And the " Hong Kong Chinese" is also called as Cantonese!

No!the lang code is wrong in fact.

@chr56
Copy link
Contributor Author

chr56 commented Feb 1, 2020

It seems that there are some other problems since language selector was introduced.
Give me more time.

@chr56
Copy link
Contributor Author

chr56 commented Feb 2, 2020

commit 7568af4 :Problems you referred to were fixed all. @TobiGr

However
Thank to @B0pol ,a new language code bug was discovered:
In setting_key .xml , the all Chinese language code under app_language_code is incorrect, and their app_language_name are informal.

Update:Well, in the latest dev build, I changed app language ,it didn't crash, and switched to the Chinese ,but I recommend that you (we) should use correct code and formal name.

@B0pol
Copy link
Member

B0pol commented Feb 6, 2020

In setting_key .xml , the all Chinese language code under app_language_code is incorrect, and their app_language_name are informal.

Let's explain how I made this selector : I picked all the languages from weblate, pick the language code, search on Wikipedia for the language name. On Weblate, there was hans, simple zh, and zh taiwan. So I put them in the selector. Indeed if the language name are informal, I'm sorry for not having deeply verified.

The codes have to be lowercase, language-region, with -region optionnal, sorted by alphabetical order.

So, maybe you should do

zh
zh-cn
zh-hans
zh-tw

Or

zh
zh-cn
zh-tw

Or

zh
zh-hans
zh-tw

And then, make the language name matching language code, with the formal version.

@TobiGr
Copy link
Member

TobiGr commented Feb 15, 2020

Thank you @chr56. Please solve the conflicts. Can you take a look at @B0pol's suggestions or tell us which is a working combination of language codes. I'd like to merge this before we get too many conflicts.

@chr56
Copy link
Contributor Author

chr56 commented Feb 15, 2020

Thank you @chr56. Please solve the conflicts. Can you take a look at @B0pol's suggestions or tell us which is a working combination of language codes. I'd like to merge this before we get too many conflicts.

Now, conflicts were solved.
Yeah, I have seen B0pol's suggestions , now I have changed them in my local repo,can I commit them in this pr? @TobiGr

@TobiGr
Copy link
Member

TobiGr commented Feb 15, 2020

sure

@chr56
Copy link
Contributor Author

chr56 commented Feb 15, 2020

Ok, here it is.
If this PR was merged successfully,can you check the source file of Simplified Chinese in Weblate? It seems that it is b+zh-hans-cn ,can you change it into zh-rCN?After that, there should not be more problems in this language.
@TobiGr

@B0pol B0pol mentioned this pull request Feb 15, 2020
1 task
@B0pol
Copy link
Member

B0pol commented Feb 15, 2020

BTW, can you try to change Indonesian, from id (deprecated, and not supported by android), to in @TobiGr . I moved the string file to in with #2921, but it's still id on weblate.

@TobiGr TobiGr merged commit 00b6bd5 into TeamNewPipe:dev Feb 15, 2020
@TobiGr
Copy link
Member

TobiGr commented Feb 15, 2020

Thank you again.

BTW, can you try to change Indonesian, from id (deprecated, and not supported by android), to in @TobiGr . I moved the string file to in with #2921, but it's still id on weblate.

I merged weblate into dev. That should fix the problem as soon as they update their branch.

This was referenced Feb 19, 2020
@Geeyun-JY3
Copy link
Contributor

So why the b+zh+HANS+CN is not removed after this PR is merged?

Now the translation in the strings.xml file in /values-b+zh+HANS+CN is consistent with Weblate, while the translation in the strings.xml file in /values-zh-rCN is out of date. That is to say, #2819 is still not fixed yet.

Related:

@chr56
Copy link
Contributor Author

chr56 commented Jun 24, 2022

So why the b+zh+HANS+CN is not removed after this PR is merged?

Now the translation in the strings.xml file in /values-b+zh+HANS+CN is consistent with Weblate, while the translation in the strings.xml file in /values-zh-rCN is out of date. That is to say, #2819 is still not fixed yet.

Related:

I am not sure. However, it seems this problem has still been existing after merging.
It merely fixed the half of this problem.

@Geeyun-JY3
Copy link
Contributor

Geeyun-JY3 commented Jun 25, 2022

Yeah, apparently the problem of simplified Chinese is still existing.

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.

Should I mention someone else?

@chr56
Copy link
Contributor Author

chr56 commented Jun 25, 2022

Yeah, apparently the problem of simplified Chinese is still existing.

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.

Should I mention someone else?

No, I will create an another PR.

@chr56
Copy link
Contributor Author

chr56 commented Jun 25, 2022

@Geeyun-JY3
here #8549

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

Successfully merging this pull request may close these issues.

Language Code problems of Chinese language
4 participants