forked from tapexyz/tape
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: lingui * style: Format code with prettier * chore: actions * chore: translate text * chore: translate text * chore: translate text * style: Format code with prettier * chore: cleanup * style: Format code with prettier * style: Format code with prettier * chore: update ci * chore: cleanup * style: Format code with prettier * chore: cleanup * chore: update gitignore --------- Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7af1c9d
commit 543f900
Showing
16 changed files
with
871 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Crowdin Action | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: crowdin action | ||
uses: crowdin/github-action@v1 | ||
with: | ||
source: '/**/locales/en/*.po' | ||
translation: '/**/locales/%two_letters_code%/%original_file_name%' | ||
upload_sources: true | ||
upload_translations: true | ||
download_translations: true | ||
localization_branch_name: i18n_crowdin_translations | ||
create_pull_request: true | ||
pull_request_title: 'chore(i18n): sync translations' | ||
pull_request_body: 'New Crowdin translations by Crowdin GH Action' | ||
pull_request_reviewers: 'sasicodes' | ||
pull_request_base_branch_name: 'main' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ playwright/.cache/ | |
|
||
# cloudflare workers | ||
.dev.vars | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# lingui | ||
src/locales/**/*.js | ||
src/locales/_build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @type {import('@lingui/conf').LinguiConfig} */ | ||
module.exports = { | ||
locales: ['en', 'es'], | ||
catalogs: [ | ||
{ | ||
path: 'src/locales/{locale}/messages', | ||
include: ['src'] | ||
} | ||
], | ||
format: 'po' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
msgid "" | ||
msgstr "" | ||
"POT-Creation-Date: 2023-04-26 19:28+0530\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: @lingui/cli\n" | ||
"Language: en\n" | ||
"Project-Id-Version: \n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Plural-Forms: \n" | ||
|
||
#: src/components/Upload/Category.tsx:16 | ||
msgid "Category" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
msgid "" | ||
msgstr "" | ||
"POT-Creation-Date: 2023-04-26 19:28+0530\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: @lingui/cli\n" | ||
"Language: es\n" | ||
"Project-Id-Version: \n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Plural-Forms: \n" | ||
|
||
#: src/components/Upload/Category.tsx:16 | ||
msgid "Category" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { i18n } from '@lingui/core' | ||
import dayjs from 'dayjs' | ||
import { en, es, kn, ru, ta, zh } from 'make-plural/plurals' | ||
|
||
import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from '../constants' | ||
|
||
i18n.load({ | ||
en: { plurals: en }, | ||
es: { plurals: es }, | ||
ta: { plurals: ta }, | ||
zh: { plurals: zh }, | ||
kn: { plurals: kn }, | ||
ru: { plurals: ru } | ||
}) | ||
|
||
export const setLocale = async (locale: string) => { | ||
if (!Object.values(SUPPORTED_LOCALES).includes(locale)) { | ||
locale = DEFAULT_LOCALE | ||
} | ||
localStorage.setItem('locale', JSON.stringify(locale)) | ||
const { messages } = await import(`src/locales/${locale}/messages`) | ||
i18n.load(locale, messages) | ||
i18n.activate(locale) | ||
dayjs.locale(locale) | ||
} | ||
|
||
export const initLocale = () => { | ||
const locale = localStorage.getItem('locale') | ||
setLocale(locale ? JSON.parse(locale) : DEFAULT_LOCALE) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.