Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions packages/cli/intl/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"0115c9a527e1f9f5a354bbccdfe36112": "Project root directory:",
"012baa262729b0782646db9528429b4c": "Please select the repository base class",
"0258f65fb9328a8b055704469bebd5f9": "Please specify the base path",
"0609b5861fff6ee8047b75494e76af9e": "What is the base HTTP path name of the CRUD operations?",
"08a89a8f18d86a3e2f5ce66aeb8b183f": "Description for the {0}",
"0e2dd2688c9939e6e3bc58af3b5e7b17": "A valid repository base class",
Expand All @@ -10,7 +11,9 @@
"1186c24b9452b67a24cb130b76dedffa": "No models found at",
"12fb77f2e738ee14bda8660d5bcd894e": "The name of the dataSource which contains this model and suppots model discovery",
"1449a22c7ecbec112a5e26179bea22fc": "Source model primary key does not exist.",
"1464cbc7a74f0f53a7acec08c638b376": "Do you want to update package.json and LICENSE?",
"1a0b53a1a5323fa92b6634ae16264892": "JSON file name or value to configure options",
"1b41d41e2416c5a532ad20e34338a19b": "Copyright owner",
"1d8b3191def358326ca3c1f5d011c96e": "Promote anonymous schemas as models",
"22097832e90dd9481994416927ad1ecc": "Name for the {0}",
"2384e2eb575c2a7377a3de641b7556e3": "Select controllers to be generated:",
Expand All @@ -20,6 +23,7 @@
"3411753432848b4f4c6d3e3d73c09f4e": "Type of array items:",
"34a1d0defdf4035829eb9d2bd790b061": "Component class name:",
"377a709c8cc8bff5d976a4e0da06ef47": "What is the name of ID property?",
"3a4acc1cb8bfc709718a49bfbeeb8460": "Select the model(s) you want to generate a CRUD REST endpoint",
"3cd28c0bc408abf4517f346f8cbe359e": "Is {0} the ID property?",
"3e7a1e0430f90996d14c5065c281fdcf": "Is it a global interceptor?",
"407fbe4b3fc192f22b4e90442c5980a1": "Select the models which to discover",
Expand All @@ -36,6 +40,7 @@
"5811f9c0ec7e60ecb58a58e1faa5574b": "Enable prettier",
"59a4c6df82c2bbaf50592ee55982fe64": "use @loopback/build helpers (e.g. lb-eslint)",
"5a0085f46605278c8b83284484cfa858": "Group name for ordering the global interceptor",
"5a5169e28fedd5752a79ae01155f47a1": "License name:",
"5bdddebdf72c7027a9e24aa500a35dd7": "Default value {0}:",
"5d0490e5ebfdca22d238997aa3882bb9": "Enter the OpenAPI spec url or file path:",
"5dd3fd8d55f85cec0f63ef7c370df454": "Prompting for controller type",
Expand All @@ -54,13 +59,16 @@
"70067103913204b5125f9192be23086c": "Is the id omitted when creating a new instance?",
"7228a5fab7ef8492cf66a3ef8df74ddf": "If discovering a model from a dataSource, specify the schema which contains it",
"7321493f5e514208aba16acbc3a8d1c9": "No datasources found at",
"74cc43ebc62b786995ac784b37d3764f": "Fail on install dependencies error",
"7652193b0c43b9ffe80339f63574cb63": "{0} class name:",
"76657b97b9993e79fdba1bff7c2a69ed": "add VSCode config files",
"79461416ce81d6f5c3ce3418fc191224": "install mocha to run tests",
"794df3791a8c800841516007427a2aa3": "License",
"7bcd10e0c597ed32f22b06726d10cb2b": "What is the name of your CRUD repository?",
"7c811ec38c295f6eaa7fa52c1c0cfee1": "Project root directory for the {0}",
"7d35e6a282ed68a01b4badfddb9dd412": "Include service-proxy imports and ServiceMixin",
"815548e083b8b7ea5edd0e57df0bfd29": "Include repository imports and RepositoryMixin",
"8340baa1142a43339a4df3a9ea93e9cb": "Do not automatically install dependencies",
"84cee9d182963cbedca9286a040f1e9a": "Skip all confirmation prompts with default or provided value",
"86e3245551645cc680371ba55857f172": "If discovering a model from a dataSource, specify the name of its table/view",
"87252b6b2ca8b638846fae8825f47ccc": "Is {0} generated automatically?",
Expand All @@ -83,8 +91,10 @@
"a47ec64e233351cf9f742a03f351c3d1": "Global interceptors are sorted by the order of an array of group names bound to ContextBindings.GLOBAL_INTERCEPTOR_ORDERED_GROUPS. See https://loopback.io/doc/en/lb4/Interceptors.html#order-of-invocation-for-interceptors.",
"a7f90f78abfa210e6d490268ea98ea80": "A valid model name",
"a8dbe656477e8eab5c8763a9b1ff0f84": "Select models to import:",
"aa2ea1f299d456d85ba42aab96581fe5": "Exclude files that match the pattern",
"ad5df45eb6b1da34ba7f75bec5b6a3d5": "Flag to indicate a global interceptor",
"aebb8636dacf73a5ea8811fafbe3ed68": "Property type:",
"afdaa0dc3b913a7b3bd5f20489f5c76d": "A valid base path",
"b06ea51aa53522aff2889a64d68d1055": "Relation type",
"b0e22938bbbbeb3d5f4692390820f4de": "Please select the model base class",
"b3c1afbfb1c87daaac414bab981ee7bd": "Error reading file",
Expand All @@ -98,9 +108,12 @@
"c87a36fbb5183525d0006021aec56a91": "Destination model foreign key name",
"c8d3e70199f75ca1f1d0bd9af1d62d38": "model does not exist.",
"c92e838c1513ce96008d7bfee201e1e9": "A valid datasource name",
"ca660806a44ff651cd28cf4a3dddc686": "Do not remember prompt answers",
"cb118a096d4c0e543062e79e4287982d": "Only update git tracked files",
"cb5146e6905384a57eff6068ca059554": "Discover all models without prompting users to select",
"cdd5413fd110557d536620d714eea126": "What kind of controller would you like to generate?",
"cf97da6220d5e5745002134f79949c61": "The name of the datasource to discover",
"d219d7a033c1d87e1e8de56f275f2b3d": "Update license in package.json and LICENSE",
"d3686d2cd4e6d5de11cd0e61e4c18819": "Remote service proxy backed by a data source",
"d3750141fd303a7f87d4821a86d85c1c": "{0} type:",
"d480d5df7f792391f9d80684a78a2424": "Directory where to write the generated source file",
Expand All @@ -119,7 +132,9 @@
"ed3bb197042a095ce19c1910d8d24226": "Enter the property name:",
"ee3b2cc023d839e3e31d346de7cce9e7": "Destination model",
"f32b47dfce5e7d0077f977a61665cc29": "Running 'npm run lint:fix' to format the code...",
"f5e20cc597e17deb35ef3ec4e55b707a": "Copyright owner:",
"f757c71fa54de6559c39e4e7f63a601c": "Please select target model",
"f796881442145767c4d38290ef887bfe": "Print the generator's options and usage",
"f7bf47d21b7e8bd36e22e5d3835008b5": "Let's add another property to {0}",
"f846f25f533c78e5eab3c1afa289ca12": "Enter an empty property name when done",
"f87558eadaf216be8be9546d874d1301": "default foreign key name",
Expand Down
28 changes: 28 additions & 0 deletions packages/cli/lib/base-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ module.exports = class BaseGenerator extends Generator {
*/
_setupGenerator() {
debug('Setting up generator', this.constructor.name);
// For the options coming from Yeoman,
// overwrite the whole option object so that they can get translated.
this._options['help'] = {
type: Boolean,
alias: 'h',
description: g.f("Print the generator's options and usage"),
};
this._options['skip-cache'] = {
type: Boolean,
description: g.f('Do not remember prompt answers'),
default: false,
};
this._options['skip-install'] = {
type: Boolean,
description: g.f('Do not automatically install dependencies'),
default: false,
};
this._options['force-install'] = {
type: Boolean,
description: g.f('Fail on install dependencies error'),
default: false,
};

debug(
'Try overwrite yeoman messages globally',
this._options['help'].description,
);

this.option('config', {
type: String,
alias: 'c',
Expand Down