Skip to content

Initial localization implementation #239

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

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

haomingli2020
Copy link
Collaborator

@haomingli2020 haomingli2020 commented Apr 10, 2024

Issue #, if available:
#61

Description of changes:
Initial localization implementation

  • Used react-intl for localization
  • Added JSON files for all languages, copied from internal repo
  • Replaced static strings with FormattedMessage for below texts
    • header text (partially localized due to missing translation in internal repo)
    • action bar - close and end chat
    • composer - type a message placeholder
    • participant joined, left chat event
    • message sending status - sent, failed to send ...

Testing:

  • Manually built and tested multiple languages
  • Added screen record for Korean language
Screen.Recording.2024-04-10.at.1.13.01.PM.mov

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@haomingli2020 haomingli2020 requested a review from a team as a code owner April 10, 2024 20:24
@haomingli2020 haomingli2020 requested review from chauhuynh97 and mrajatttt and removed request for a team April 10, 2024 20:24
@haomingli2020 haomingli2020 force-pushed the haominli/localization branch from 618e8f0 to e6ebf2d Compare April 10, 2024 20:30
@haomingli2020 haomingli2020 changed the title Initial localization implementation issue Initial localization implementation Apr 10, 2024
@haomingli2020 haomingli2020 requested a review from mhiaror April 10, 2024 21:28
render(<ThemeProvider>
<Chat {...mockProps} />
</ThemeProvider>);
render(<IntlProvider onError={jest.fn} locale="en">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: does IntlProvider onError={jest.fn} locale="en" forces the language to be English or does it translate from whatever language back to English?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In unit test it forces the language to be English.

@haomingli2020 haomingli2020 merged commit 7bd67c5 into master Apr 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants