Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom paths in plugin generator #57766

Merged
merged 16 commits into from
Feb 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify i18n setup
  • Loading branch information
Liza K committed Feb 17, 2020
commit 52eac921ecff8a47e945a40a03d7cf250dbdaac6
21 changes: 0 additions & 21 deletions packages/kbn-plugin-generator/sao_template/sao.js
Original file line number Diff line number Diff line change
@@ -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]);
@@ -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
Original file line number Diff line number Diff line change
@@ -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": ""
}
}