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

feat: i18n support #1446

Merged
merged 20 commits into from Dec 30, 2022
Merged

feat: i18n support #1446

merged 20 commits into from Dec 30, 2022

Conversation

foolo
Copy link
Contributor

@foolo foolo commented Dec 21, 2022

What does this PR do?

Port to LinguiJS and add Crowdin integration.
Fixes #1343

The feature can be tested on Vercel deployment, by switching to PseudoLanguage under Settings > Account > Locale settings. (About pseudolocalization: https://lingui.js.org/guides/pseudolocalization.html )

Screen capture: https://user-images.githubusercontent.com/667227/209463143-41576848-31d9-4267-a7f4-9f388abd1d04.mp4

Temporary Crowdin project: https://crowdin.com/project/lenstertest

Important files in this PR:
apps/web/src/lib/i18n.ts - Helper for loading and switching locales on-the-fly
apps/web/src/locales/en/messages.po - English source strings, uploaded to Crowdin
apps/web/src/locales/*/messages.po - Translated strings, will be updated with translations from Crowdin
apps/web/package.json - added/updated scripts (see I18N.md)
apps/web/src/components/Settings/Account/Language.tsx - Settings page
I18N.md - i18n readme
apps/web/.babelrc, apps/web/.linguirc, apps/web/crowdin.yml - config files

@vercel
Copy link

vercel bot commented Dec 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
api ✅ Ready (Inspect) Visit Preview Dec 29, 2022 at 7:43PM (UTC)
web ✅ Ready (Inspect) Visit Preview Dec 29, 2022 at 7:43PM (UTC)

@vercel vercel bot temporarily deployed to Preview – api December 21, 2022 17:57 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 21, 2022 18:12 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 21, 2022 18:16 Inactive
@bigint
Copy link
Member

bigint commented Dec 22, 2022

We can also add GitHub actions to sync strings at regular intervals.

https://github.com/jbx-protocol/juice-interface/blob/main/.github/workflows/crowdin-download.yml
https://github.com/jbx-protocol/juice-interface/blob/main/.github/workflows/crowdin-upload.yml

@foolo

This comment was marked as resolved.

@foolo
Copy link
Contributor Author

foolo commented Dec 25, 2022

Fixed the Vercel deployment and changed from Czech to LinguiJS' built-in pseudolocalization (fake-language used for testing). The feature can now be tested by opening Lenster website on the Vercel deployment and switching to PseudoLanguage under Settings>Account.

@bigint
Copy link
Member

bigint commented Dec 25, 2022

Amazing work @foolo it works smooth

@vercel vercel bot temporarily deployed to Preview – api December 26, 2022 18:30 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 26, 2022 18:42 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 27, 2022 02:54 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 27, 2022 11:51 Inactive
@vercel vercel bot temporarily deployed to Preview – api December 29, 2022 19:43 Inactive
@foolo foolo marked this pull request as ready for review December 30, 2022 07:05
@bigint bigint merged commit 71dfc68 into heyxyz:main Dec 30, 2022
sasicodes pushed a commit that referenced this pull request Jan 16, 2023
Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>
@foolo foolo deleted the i18n-support branch January 29, 2023 12:58
guanbinrui added a commit to DimensionDev/firefly.mask.social that referenced this pull request Nov 23, 2023
guanbinrui added a commit to DimensionDev/firefly.mask.social that referenced this pull request Nov 24, 2023
guanbinrui added a commit to DimensionDev/firefly.mask.social that referenced this pull request Nov 24, 2023
* chore: setup lingui

copy impl from heyxyz/hey#1446

* refactor: helpers

* chore: quick test

* refactor: lingui config

* chore: wip

* chore: update configs

* chore: compile i18n

* chore: reset lock file

* chore: lock file

* fix: cspell

* refactor: types

* refactor: message

* chore: i18n

* chore: i18n

* chore: i18n

* fix: typo
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.

Add i18n support with crowdin
2 participants