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

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

Closed

Conversation

tkusano
Copy link
Contributor

@tkusano tkusano commented Dec 30, 2023

  • 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.

* 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.
@pfrazee
Copy link
Collaborator

pfrazee commented Jan 2, 2024

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

@tkusano
Copy link
Contributor Author

tkusano commented Jan 3, 2024

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

@tkusano
Copy link
Contributor Author

tkusano commented Jan 6, 2024

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

@pfrazee pfrazee added the intl Internationalization label Jan 8, 2024
tkusano and others added 3 commits January 10, 2024 10:36
- ios and andorid: import `@formtjs/intl-locale` and `@formatjs/intl-pluralrules` to polyfill `Intl.Locale` and `Intl.PluralRules` which are used in `plural()` and '<Plural />'.
- update `plural` use in notification messages for better translation.
@tkusano
Copy link
Contributor Author

tkusano commented Jan 11, 2024

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

tkusano and others added 8 commits February 22, 2024 17:16
* Move home-related files to view/com/home

* Add HomeHeader in front of FeedTabBar

* Move isDekstop check outside FeedsTabBar

* Remove PWI logic from tabbar

* Separate platform-specific layout from shared logic
* use `useOpenLink` hook for links in ALF

* web only for `outline`
* fix: normalize relative date

* chore: add comments

* refactor: skip flooring normalized diff

* refactor: let -> const

* fix: get own copy of date to prevent mutating

* refactor: rounding does the same trick
* show uiState errors in the box as well

simplify copy

update ui for only letters and numbers

add ui validation to handle selection

* simplify names

* Fix accidental text-node render

---------

Co-authored-by: Paul Frazee <[email protected]>
* Make dim color scheme dim

* Tweaks

* Overall tweaks

* We have to go darker

* Tweak saturation of blues in dim

* Increase contrast on dark-dark mode

* adjust dim

---------

Co-authored-by: Eric Bailey <[email protected]>
Co-authored-by: Paul Frazee <[email protected]>
Co-authored-by: Hailey <[email protected]>
haileyok and others added 4 commits February 27, 2024 15:08
* adjust window size, cells batching period

* rm batching period change
…" so the translator can adjust the translated count line to fit within the Drawer.
@tkusano tkusano mentioned this pull request Mar 17, 2024
64 tasks
@pfrazee
Copy link
Collaborator

pfrazee commented May 6, 2024

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

@pfrazee
Copy link
Collaborator

pfrazee commented May 6, 2024

Thank you again -- merged via #3882

@pfrazee pfrazee closed this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intl Internationalization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants