Automattic / Automattic/pocket-casts-android

Use quantity strings for better localization support

Open
#507 2 comments 0 reactions 0 assignees View on GitHub
[Type] Feature
Dominant language
Kotlin
Stars
2.8k
Forks
308
Avg merge
1d 13h
Merged PRs (30d)
143

Description

### 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 `string`s with singular and plural variants (e.g. `podcasts_singular` and `podcasts_plural`). Since the one/other paradigm is common but not universal, [using `plural`s is generally the better approach](https://developer.android.com/guide/topics/resources/string-resource#Plurals), 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 `plural`s 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?

- [X] I have searched for existing feature suggestions.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Android string resources that have singular and plural variants, then inspect the related Resources extensions mentioned in the issue. Convert the applicable resources to plural resources and verify that all supported languages, including languages using only the other quantity, are handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
localization, mobile
Issue type
Refactor
Difficulty
3/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.