Skip to content

Commit

Permalink
i18n setup (MetaMask#1251)
Browse files Browse the repository at this point in the history
* i18n setup

* yarn.lock

* add crowdin.yml files

* fixes

* comment out language toggle
  • Loading branch information
alexandratran authored Apr 15, 2024
1 parent 83ac24c commit b8148f0
Show file tree
Hide file tree
Showing 6 changed files with 23,952 additions and 1,650 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Crowdin Action

on:
push:
path: [ "i18n/**" ]
branches: [ main ]

permissions: write-all

jobs:
crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Synchronize with Crowdin
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: true
download_translations: true
localization_branch_name: l10n_crowdin_translations

create_pull_request: true
pull_request_title: 'New Crowdin translations'
pull_request_body: 'New Crowdin pull request with translations'
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 }}
16 changes: 16 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: true
files:
# JSON translation files
- source: /i18n/en/**/*
translation: /i18n/%two_letters_code%/**/%original_file_name%
# Docs Markdown files
- source: /wallet/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
- source: /snaps/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
- source: /services/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
- source: /docs/**/*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
8 changes: 7 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
locales: ["en"/*, "ru", "zh"*/],
},

trailingSlash: true,
Expand Down Expand Up @@ -426,6 +426,12 @@ const config = {
label: "What's new?",
position: "right",
},
/* Language drop down
{
type: "localeDropdown",
position: "right",
},
*/
],
},
docs: {
Expand Down
Loading

0 comments on commit b8148f0

Please sign in to comment.