diff --git a/generators/app/index.js b/generators/app/index.js index b93d92f85228..50f91181d53f 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -448,7 +448,7 @@ module.exports = class extends BaseBlueprintGenerator { }); }, - askFori18n: prompts.askFori18n, + askFori18n: prompts.askForI18n, }; } diff --git a/generators/app/prompts.js b/generators/app/prompts.js index e27a9e50cb07..74278543b5f5 100644 --- a/generators/app/prompts.js +++ b/generators/app/prompts.js @@ -24,6 +24,7 @@ module.exports = { askForInsightOptIn, askForApplicationType, askForModuleName, + askForI18n, askFori18n, askForTestOpts, askForMoreModules, @@ -40,7 +41,7 @@ function askForInsightOptIn() { default: true, }).then(prompt => { if (prompt.insight !== undefined) { - statistics.setOptoutStatus(!prompt.insight); + statistics.setOptOutStatus(!prompt.insight); } done(); }); @@ -106,11 +107,21 @@ function askForModuleName() { this.askModuleName(this); } -function askFori18n() { +function askForI18n() { if (this.skipI18n || this.existingProject) return; this.aski18n(this); } +/** + * @deprecated Use askForI18n() instead. + * This method will be removed in JHipster v7. + */ +function askFori18n() { + // eslint-disable-next-line no-console + console.log(chalk.yellow('\nPlease use askForI18n() instead. This method will be removed in v7\n')); + this.askForI18n(); +} + function askForTestOpts(meta) { if (!meta && this.existingProject) return; diff --git a/generators/aws-containers/prompts.js b/generators/aws-containers/prompts.js index 3b345dd5c822..09912e8e6a71 100644 --- a/generators/aws-containers/prompts.js +++ b/generators/aws-containers/prompts.js @@ -572,7 +572,7 @@ function askDeployNow() { { type: 'confirm', name: 'deployNow', - message: 'Would you like to deploy now?.', + message: 'Would you like to deploy now?', default: true, }, ]; diff --git a/generators/client/index.js b/generators/client/index.js index 4102e3caad24..fb0de8524a94 100644 --- a/generators/client/index.js +++ b/generators/client/index.js @@ -189,7 +189,7 @@ module.exports = class extends BaseBlueprintGenerator { return { askForModuleName: prompts.askForModuleName, askForClient: prompts.askForClient, - askFori18n: prompts.askFori18n, + askFori18n: prompts.askForI18n, askForClientTheme: prompts.askForClientTheme, askForClientThemeVariant: prompts.askForClientThemeVariant, diff --git a/generators/client/prompts.js b/generators/client/prompts.js index aee66afedc39..56f3597fc9e9 100644 --- a/generators/client/prompts.js +++ b/generators/client/prompts.js @@ -25,6 +25,7 @@ const REACT = constants.SUPPORTED_CLIENT_FRAMEWORKS.REACT; module.exports = { askForModuleName, askForClient, + askForI18n, askFori18n, askForClientTheme, askForClientThemeVariant, @@ -78,12 +79,22 @@ function askForClient(meta) { }); } -function askFori18n() { +function askForI18n() { if (this.existingProject || this.configOptions.skipI18nQuestion) return; this.aski18n(this); } +/** + * @deprecated Use askForI18n() instead. + * This method will be removed in JHipster v7. + */ +function askFori18n() { + // eslint-disable-next-line no-console + console.log(chalk.yellow('\nPlease use askForI18n() instead. This method will be removed in v7\n')); + this.askForI18n(); +} + function askForClientTheme(meta) { if (!meta && this.existingProject) { return; diff --git a/generators/generator-base.js b/generators/generator-base.js index 8e7348d871be..6b407db58cbb 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -344,7 +344,7 @@ module.exports = class extends PrivateBase { } /** - * check if Right-to-Left support is necesary for i18n + * check if Right-to-Left support is necessary for i18n * @param {string[]} languages - languages array */ isI18nRTLSupportNecessary(languages) { diff --git a/generators/server/index.js b/generators/server/index.js index 7cb33d44e80d..0649ec087aad 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -348,7 +348,7 @@ module.exports = class extends BaseBlueprintGenerator { askForModuleName: prompts.askForModuleName, askForServerSideOpts: prompts.askForServerSideOpts, askForOptionalItems: prompts.askForOptionalItems, - askFori18n: prompts.askFori18n, + askFori18n: prompts.askForI18n, setSharedConfigOptions() { this.configOptions.packageName = this.packageName; diff --git a/generators/server/prompts.js b/generators/server/prompts.js index fcc927f76540..6cff1212ec34 100644 --- a/generators/server/prompts.js +++ b/generators/server/prompts.js @@ -26,6 +26,7 @@ module.exports = { askForModuleName, askForServerSideOpts, askForOptionalItems, + askForI18n, askFori18n, }; @@ -418,8 +419,18 @@ function askForOptionalItems(meta) { } } -function askFori18n() { +function askForI18n() { if (this.existingProject || this.configOptions.skipI18nQuestion) return; this.aski18n(this); } + +/** + * @deprecated Use askForI18n() instead. + * This method will be removed in JHipster v7. + */ +function askFori18n() { + // eslint-disable-next-line no-console + console.log(chalk.yellow('\nPlease use askForI18n() instead. This method will be removed in v7\n')); + this.askForI18n(); +} diff --git a/generators/statistics.js b/generators/statistics.js index fbc329a68aa1..863da9aeaa53 100644 --- a/generators/statistics.js +++ b/generators/statistics.js @@ -17,6 +17,7 @@ * limitations under the License. */ const { v4: uuid } = require('uuid'); +const chalk = require('chalk'); const Config = require('conf'); const osLocale = require('os-locale'); const axios = require('axios'); @@ -141,10 +142,20 @@ class Statistics { this.config.delete(key); } - setOptoutStatus(status) { + setOptOutStatus(status) { this.setConfig('optOut', status); } + /** + * @deprecated Use setOptOutStatus(status) instead. + * This method will be removed in JHipster v7. + */ + setOptoutStatus(status) { + // eslint-disable-next-line no-console + console.log(chalk.yellow('\nPlease use setOptOutStatus() instead. This method will be removed in v7\n')); + this.setOptOutStatus(status); + } + setLinkedStatus(status) { this.setConfig('isLinked', status); }