Automattic / pocket-casts-android

Pocket Casts Android 🎧
https://forums.pocketcasts.com
Mozilla Public License 2.0
2.59k stars 224 forks source link

Use quantity strings for better localization support #507

Open Toastdeib opened 2 years ago

Toastdeib commented 2 years ago

What problem does this address?

A lot of my day-to-day at work involves localization on Android, and when poking through this repo I noticed that the resources for quantity strings are being done as actual strings with singular and plural variants (e.g. podcasts_singular and podcasts_plural). Since the one/other paradigm is common but not universal, using plurals is generally the better approach, plus it saves you from having to make extensions on the Resources class. Offhand, the only supported language that I know would benefit from switching to plurals is Japanese (it only uses the other quantity, there's no distinction for the one case), but there may be others as well.

What is your proposed solution?

All the string resources that have singular/plural versions should be redone as actual plural resources to take proper advantage of the existing framework. I'd be happy to take a stab at this myself when I have some free time, but I wanted to put it in the issue tracker to make sure I didn't forget about it.

Did you search for existing feature suggestions?

geekygecko commented 2 years ago

Thanks for raising this issue, it would be much cleaner to use plurals. The problem is the tool GlotPress we use for localization doesn't support string files with plurals yet. https://translate.wordpress.com/projects/pocket-casts/android/

Toastdeib commented 2 years ago

Ah, fair enough. Doesn't seem ideal, but I suppose you have to work within the tools you're given. Do you know if that tool has any plans to support plurals in the future? I realized after making my original post that the documentation page I linked actually mentions a subset of the languages that use each different type of quantity string, and it looks like Arabic, Russian, and Chinese are all also impacted by the lack of formal plurals, so that's at least four supported languages that would benefit from the change.