Skip to content

Commit

Permalink
Simplify i18n setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Feb 17, 2020
1 parent c6a784c commit 52eac92
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
21 changes: 0 additions & 21 deletions packages/kbn-plugin-generator/sao_template/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,6 @@ async function gitInit(dir) {
}
}

async function generateDefaultI18nMessages(dir) {
try {
await execa('node', [
'scripts/i18n_extract',
'--output-dir',
`${dir}/translations`,
'--include-config',
`${dir}/.i18nrc.json`,
`--path=${dir}`,
]);
console.log(`Default translation messages generated in ${dir}`);
} catch (error) {
console.error(error);
throw new Error(`Failure to generate default translations ${dir}: ${error.all || error}`);
}
}

async function moveToCustomFolder(from, to) {
try {
await execa('mv', [from, to]);
Expand Down Expand Up @@ -178,10 +161,6 @@ module.exports = function({ name, targetPath }) {
} else {
// Init git only in the default path
await gitInit(dir);

if (answers.generateTranslations) {
await generateDefaultI18nMessages(dir);
}
}

// Apply eslint to the generated plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,5 @@
},
"messages": {
"<%= camelCase(name) %>.buttonText": "Translate me to Japanese",
"<%= camelCase(name) %>.congratulationsTitle": "",
"<%= camelCase(name) %>.content": "",
"<%= camelCase(name) %>.dataUpdated": "",
"<%= camelCase(name) %>.greetingText": "",
"<%= camelCase(name) %>.helloWorldText": "",
"<%= camelCase(name) %>.timestampText": ""
}
}

0 comments on commit 52eac92

Please sign in to comment.