Skip to content

Commit

Permalink
Add translation file
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Feb 17, 2020
1 parent 2de8d5a commit 3cc7a48
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/kbn-plugin-generator/sao_template/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ module.exports = function({ name, targetPath }) {
message: 'Should a server API be generated?',
default: true,
},
// generateTranslations: {
// type: 'confirm',
// message: 'Should translation files be generated?',
// default: true,
// },
generateTranslations: {
type: 'confirm',
when: answers => {
// only for 3rd party plugins
return !answers.customPath && answers.generateApp;
},
message: 'Should translation files be generated?',
default: true,
},
generateScss: {
type: 'confirm',
message: 'Should SCSS be used?',
Expand All @@ -119,12 +123,13 @@ module.exports = function({ name, targetPath }) {
'public/**/index.scss': 'generateScss',
'public/**/*': 'generateApp',
'server/**/*': 'generateApi',
// 'translations/**/*': 'generateTranslations',
// '.i18nrc.json': 'generateTranslations',
'translations/**/*': 'generateTranslations',
'i18nrc.json': 'generateTranslations',
'eslintrc.js': 'generateEslint',
},
move: {
'eslintrc.js': '.eslintrc.js',
'i18nrc.json': '.i18nrc.json',
},
data: answers =>
Object.assign(
Expand Down
11 changes: 11 additions & 0 deletions packages/kbn-plugin-generator/sao_template/template/i18nrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"prefix": "<%= camelCase(name) %>",
"paths": {
"<%= camelCase(name) %>": "."
},
"translations": [
"translations/zh-CN.json",
"translations/ja-JP.json"
]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit 3cc7a48

Please sign in to comment.