social-app icon indicating copy to clipboard operation
social-app copied to clipboard

Replace pluralize() with plural() or <Plural> to make some UI elements translatable.

Open tkusano opened this issue 1 year ago • 5 comments

  • Replace all pluralize (defined by src/lib/strings/helpers.ts) with plural or Plural (defined by @lingui/macro) to make some UI elements translatable.
  • Delete pluralize() and related test.

tkusano avatar Dec 30 '23 05:12 tkusano

Going to review in a bit but going to drop in -- I tried this previously and hit some strange compile issues. Forget the details but need to be sure this is tested on all platforms

pfrazee avatar Jan 02 '24 19:01 pfrazee

I tested this patch only on my Ubuntu 22.04.3 environment by 'yarn web'.

tkusano avatar Jan 03 '24 05:01 tkusano

I setup Android dev environment and tested and got error. Calling new Intl.PluralRules(...) inside plural() produced TypeError: Cannot read property 'prototype' of undefined error.

I found in lingui document that React Native doest not support Intl.PluralRules API, so plural() / <Plural> doest not work correctly.

Polyfilling Intl APIs

tkusano avatar Jan 06 '24 16:01 tkusano

Updated this PR for Android and iOS platform (tested on Android/iOS emulators).

tkusano avatar Jan 11 '24 15:01 tkusano

Hi @pfrazee , is there any problem that prevents the development team from merging this PR into the main, as we need to l10n some parts of the UI properly, it would be good for many l10n people if this PR is accepted.

tkusano avatar Feb 27 '24 01:02 tkusano

Hey I'm sorry this has sat for so long. I'm finally getting a look at it.

pfrazee avatar May 06 '24 22:05 pfrazee

Thank you again -- merged via #3882

pfrazee avatar May 06 '24 23:05 pfrazee