Skip to content

Commit

Permalink
feat: 从中文版引入翻译工具
Browse files Browse the repository at this point in the history
  • Loading branch information
asnowwolf committed Dec 7, 2023
1 parent d00d441 commit e8af959
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions aio/tools/translator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dict/
19 changes: 19 additions & 0 deletions aio/tools/translator/extract-dict.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

# markdown 文档
nt translate 'content/**/*.md' '!content/(examples|demos)/**/*.md' --engine=extractor --dict ./tools/translator/dict/angular

# html 文档
nt translate 'content/**/*.html' '!content/(examples|demos)/**/*.html' --engine=extractor --dict ./tools/translator/dict/angular

# 导航菜单
nt translate content/navigation.json --engine=extractor --dict ./tools/translator/dict/angular --jsonProperties=title --jsonProperties=tooltip

# 社区资源
nt translate content/marketing/resources.json --engine=extractor --dict ./tools/translator/dict/angular --jsonProperties=title --jsonProperties=desc

# 帮助文件
nt translate content/cli-src/help/*.json --engine=extractor --dict ./tools/translator/dict/angular --jsonProperties=description --jsonProperties=shortDescription --jsonProperties=longDescription

# 源码
nt translate '../packages/**/*.ts' '!../packages/**/*.d.ts' '!../packages/**/*_spec.ts' '!../packages/**/*.spec.ts' -et internal -et nodoc --engine=extractor --dict ./tools/translator/dict/angular
19 changes: 19 additions & 0 deletions aio/tools/translator/normalize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

# markdown 文档
nt translate '!content/(examples|demos)/**/*.md' --engine=normalizer

# html 文档
nt translate '!content/(examples|demos)/**/*.html' --engine=normalizer

# 导航菜单
nt translate content/navigation.json --jsonProperties=title --jsonProperties=tooltip --engine=normalizer

# 社区资源
nt translate content/marketing/resources.json --jsonProperties=title --jsonProperties=desc --engine=normalizer

# 帮助文件
nt translate content/cli/help/**/*.json --jsonProperties=description --jsonProperties=shortDescription --jsonProperties=longDescription --engine=normalizer

# 源码
nt translate '../packages/**/!(*.d|*.spec|*_spec).ts' -et internal -et nodoc --engine=normalizer
19 changes: 19 additions & 0 deletions aio/tools/translator/translate-by-dict.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

# markdown 文档
nt translate '!content/(examples|demos)/**/*.md' --engine=dict --dict ./tools/translator/dict/angular

# html 文档
nt translate '!content/(examples|demos)/**/*.html' --engine=dict --dict ./tools/translator/dict/angular

# 导航菜单
nt translate content/navigation.json --jsonProperties=title --jsonProperties=tooltip --engine=dict --dict ./tools/translator/dict/angular

# 社区资源
nt translate content/marketing/resources.json --jsonProperties=title --jsonProperties=desc --engine=dict --dict ./tools/translator/dict/angular

# 帮助文件
nt translate content/cli/help/**/*.json --jsonProperties=description --jsonProperties=shortDescription --jsonProperties=longDescription --engine=dict --dict ./tools/translator/dict/angular

# 源码
nt translate '../packages/**/!(*.d|*.spec|*_spec).ts' -et internal -et nodoc --engine=dict --dict ./tools/translator/dict/angular
4 changes: 4 additions & 0 deletions aio/tools/translator/translate-dict.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

# 翻译字典
nt translate ./tools/translator/dict/angular/**/*.dict.md --engine=google

0 comments on commit e8af959

Please sign in to comment.