Skip to content

Commit dc83f48

Browse files
committed
i18n: add langnostic
1 parent fc4269f commit dc83f48

File tree

4 files changed

+1393
-2
lines changed

4 files changed

+1393
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
# Translations
133+
.langnostic

langnostic.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { ConfigType } from 'langnostic';
2+
3+
const config: ConfigType = {
4+
ai: {
5+
provider: 'google',
6+
},
7+
localeConfig: {
8+
source: 'en-US',
9+
target: ['zh-CN'],
10+
},
11+
groups: [
12+
{
13+
name: 'quiz-js',
14+
plugin: 'mdx',
15+
paths: [
16+
{
17+
source:
18+
'./questions/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/en-US.mdx',
19+
target:
20+
'./questions/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/{locale}.mdx',
21+
},
22+
],
23+
},
24+
],
25+
};
26+
27+
export default config;

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"gen": "tsx scripts/gen.ts",
8-
"rank": "tsx scripts/rank.ts"
8+
"rank": "tsx scripts/rank.ts",
9+
"translate": "langnostic translate"
910
},
1011
"keywords": [
1112
"javascript",
@@ -19,8 +20,12 @@
1920
"github-slugger": "^2.0.0",
2021
"globby": "^14.0.1",
2122
"gray-matter": "^4.0.3",
23+
"langnostic": "^0.0.3",
2224
"lodash-es": "^4.17.21",
2325
"tsx": "^4.15.1"
2426
},
25-
"packageManager": "pnpm@8.15.8"
27+
"packageManager": "pnpm@8.15.8",
28+
"devDependencies": {
29+
"typescript": "^5.8.2"
30+
}
2631
}

0 commit comments

Comments
 (0)