Skip to content

Commit

Permalink
feat: support inlang
Browse files Browse the repository at this point in the history
  • Loading branch information
qinluhe committed Dec 18, 2024
1 parent 9651543 commit da15b09
Show file tree
Hide file tree
Showing 32 changed files with 118 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: lint

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20'
- uses: pnpm/action-setup@v4
with:
version: '8.5.0'
run_install: false
- name: Install dependencies
run: pnpm i
- name: Lint
run: pnpm run lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

!project.inlang
48 changes: 48 additions & 0 deletions inlang.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// inlang.config.js
export default {
sourceLanguageTag: 'en',
languageTags: [
'en',
'ar-SA',
'ca-ES',
'ckb-KU',
'cs-CZ',
'de-DE',
'es-VE',
'eu-ES',
'fa',
'fr-CA',
'fr-FR',
'he',
'hu-HU',
'id-ID',
'it-IT',
'ja-JP',
'ko-KR',
'pl-PL',
'pt-BR',
'pt-PT',
'ru-RU',
'sv-SE',
'th-TH',
'tr-TR',
'uk-UA',
'vi',
'vi-VN',
'zh-CN',
'zh-TW',
],
catalogs: [
{
pathPattern: './public/locales/{language}.json',
type: 'json',
},
],
plugins: [
'@inlang/plugin-json',
],
rules: {
'translation.missing': 'error',
'translation.inconsistent-interpolation': 'error',
},
};
45 changes: 45 additions & 0 deletions project.inlang/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"sourceLanguageTag": "en",
"languageTags": [
"en",
"ar-SA",
"ca-ES",
"ckb-KU",
"cs-CZ",
"de-DE",
"es-VE",
"eu-ES",
"fa",
"fr-CA",
"fr-FR",
"he",
"hu-HU",
"id-ID",
"it-IT",
"ja-JP",
"ko-KR",
"pl-PL",
"pt-BR",
"pt-PT",
"ru-RU",
"sv-SE",
"th-TH",
"tr-TR",
"uk-UA",
"vi",
"vi-VN",
"zh-CN",
"zh-TW"
],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/plugin-json@latest/dist/index.js"
],
"plugin.inlang.json": {
"pathPattern": "./src/locales/{language}.json",
"variableReferencePattern": [
"{{",
"}}"
]
}
}
Empty file added src/locales/ar-SA.json
Empty file.
Empty file added src/locales/ca-ES.json
Empty file.
Empty file added src/locales/ckb-KU.json
Empty file.
Empty file added src/locales/cs-CZ.json
Empty file.
Empty file added src/locales/de-DE.json
Empty file.
Empty file added src/locales/es-VE.json
Empty file.
Empty file added src/locales/eu-ES.json
Empty file.
Empty file added src/locales/fa.json
Empty file.
Empty file added src/locales/fr-CA.json
Empty file.
Empty file added src/locales/fr-FR.json
Empty file.
Empty file added src/locales/he.json
Empty file.
Empty file added src/locales/hu-HU.json
Empty file.
Empty file added src/locales/id-ID.json
Empty file.
Empty file added src/locales/it-IT.json
Empty file.
Empty file added src/locales/ja-JP.json
Empty file.
Empty file added src/locales/ko-KR.json
Empty file.
Empty file added src/locales/pl-PL.json
Empty file.
Empty file added src/locales/pt-BR.json
Empty file.
Empty file added src/locales/pt-PT.json
Empty file.
Empty file added src/locales/ru-RU.json
Empty file.
Empty file added src/locales/sv-SE.json
Empty file.
Empty file added src/locales/th-TH.json
Empty file.
Empty file added src/locales/tr-TR.json
Empty file.
Empty file added src/locales/uk-UA.json
Empty file.
Empty file added src/locales/vi-VN.json
Empty file.
Empty file added src/locales/vi.json
Empty file.
Empty file added src/locales/zh-CN.json
Empty file.
Empty file added src/locales/zh-TW.json
Empty file.

0 comments on commit da15b09

Please sign in to comment.