-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add plural support for share_license_summary string (#2156) #2161
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
Conversation
Hi @zhao-gang , we do not edit string.xml files under languages manually. They are automatized. You should only edit default strings.xml file, thats all:) |
Codecov Report
@@ Coverage Diff @@
## master #2161 +/- ##
=========================================
- Coverage 5.69% 5.69% -0.01%
=========================================
Files 233 233
Lines 11591 11593 +2
Branches 1076 1076
=========================================
Hits 660 660
- Misses 10876 10878 +2
Partials 55 55
Continue to review full report at Codecov.
|
I hope I know this before I started working on this issue :-( Anyway, here is the updated PR. Could you please tell me how to generate the plural string for other languages? |
We don't need to know this, translators does this job. You should only add this for default file, in english. |
Sorry for editing all string files, it is always better to have communication with team members, someone would warn you. Of course we should include this to our contributor documentation too. |
If it works this way. Firstly in other language (i.e. Chinese), the upload page will show the default English plural string (Before this change it can show Chinese characters, although it doesn't support plural format). I am not sure if it's acceptable? Secondly, the original normal strings in other languages become obsolete and are not used, we still need to delete them (or let translators change them to plural strings? I am not sure about this). |
I mean I changed R.string.share_license_summary to R.plurals.share_license_summary in english file. And the code now calls R.plurals.share_license_summary. All the other languages have no R.plurals.share_license_summary, so all the other languages will show english language. It seems a big step back for me. |
If I change R.string.share_license_summary to R.plurals.share_license_summary in all the related languages, at least they can show their original languages (no plural support). I think this might be better than above mentioned solution? |
No, we can not edit anything in those files. We stop ourselves from doing it. Currently whenever translations added, local strings will be available, which is okay. |
Any idea why Travis failed? Logs suggest Google's servers were unreachable, but it seems unlikely that they went down. Is there a way to retry it?
Edit - Thanks whoever restarted the Travis build :) |
Description (required)
Fixes #2156
Make string resource share_license_summary support plural by defining it as a quantity string.(reference: https://developer.android.com/guide/topics/resources/string-resource#Plurals)
As a quantity string it could support plural formats for many languages, not limited to English language. Currently it only support plural for English language. More language support can be added by adding to their respective resource files.
Tests performed (required)
Tested on BetaDebug on Nexus 6p with API level 27. English language can correctly display singular or plural strings. Other languages display the original strings.
Screenshots showing what changed (optional - for UI changes)