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
25 changes: 13 additions & 12 deletions packages/cli/generators/controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ module.exports = class ControllerGenerator extends ArtifactGenerator {
}

static get BASIC() {
return 'Empty Controller';
return g.f('Empty Controller');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

截屏2020-04-21下午4 31 37

}

static get REST() {
return 'REST Controller with CRUD functions';
return g.f('REST Controller with CRUD functions');
}

_setupGenerator() {
Expand Down Expand Up @@ -132,20 +132,21 @@ module.exports = class ControllerGenerator extends ArtifactGenerator {
}

if (_.isEmpty(modelList)) {
return this.exit(
`No models found in ${this.artifactInfo.modelDir}.
${chalk.yellow(
'Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how models are discovered',
)}`,
const file = g.f('No models found in %s. ', this.artifactInfo.modelDir);
const site = g.f(
'Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how models are discovered.',
);
return this.exit(file + chalk.yellow(site));
}
if (_.isEmpty(repositoryList)) {
return this.exit(
`No repositories found in ${this.artifactInfo.repositoryDir}.
${chalk.yellow(
'Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how repositories are discovered',
)}`,
const file = g.f(
'No repositories found in %s. ',
this.artifactInfo.repositoryDir,
);
const site = g.f(
'Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how repositories are discovered.',
);
return this.exit(file + chalk.yellow(site));
}
return this.prompt([
{
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/intl/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"08a89a8f18d86a3e2f5ce66aeb8b183f": "Description for the {0}",
"0e2dd2688c9939e6e3bc58af3b5e7b17": "A valid repository base class",
"0eee394c1a8c898184aa039420afc594": "Name of the example to clone",
"0f64c35f7cb25ea8a068e157cfd3f283": "REST Controller with CRUD functions",
"0f97dcea7dc212c905400da264b09cfd": "Application {0} was created in {1}.",
"114bb446343e91190ec9086623f58fd9": "Select the model(s) you want to generate a repository",
"1186c24b9452b67a24cb130b76dedffa": "No models found at",
Expand All @@ -17,6 +18,7 @@
"1a0b53a1a5323fa92b6634ae16264892": "JSON file name or value to configure options",
"1b41d41e2416c5a532ad20e34338a19b": "Copyright owner",
"21840a025087b2fd39b9dd37b7498473": "Using default input of type input for setting {0} as {1} is not supported",
"203aab8983bbe9ab5982baa09cd4b819": "Empty Controller",
"22097832e90dd9481994416927ad1ecc": "Name for the {0}",
"23fe9f126c159af41d59b9b16b594c05": "A basic RPC server using a made-up protocol.",
"25613bcc246af27bb9adbffb15808516": "Upgrade project dependencies",
Expand Down Expand Up @@ -71,6 +73,7 @@
"6e6a3836ad202ae5c263855b6e98ac85": "Check version compatibility using semver semantics",
"6faaa64820277d3607d43a208ce3da13": "The example was cloned to {0}.",
"70067103913204b5125f9192be23086c": "Is the id omitted when creating a new instance?",
"70819a2fcd43c1a5e08942229d51cd43": "Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how models are discovered.",
"7228a5fab7ef8492cf66a3ef8df74ddf": "If discovering a model from a dataSource, specify the schema which contains it",
"72e0cfd29751146d9e94bb4d5cf25133": "An example application to demonstrate how to implement multi-tenancy with LoopBack 4.",
"7321493f5e514208aba16acbc3a8d1c9": "No datasources found at",
Expand All @@ -82,6 +85,7 @@
"794df3791a8c800841516007427a2aa3": "License",
"7bcd10e0c597ed32f22b06726d10cb2b": "What is the name of your CRUD repository?",
"7c811ec38c295f6eaa7fa52c1c0cfee1": "Project root directory for the {0}",
"7c9111f852ea9bd35067a5f53540ff0b": "No models found in {0}. ",
"7d35e6a282ed68a01b4badfddb9dd412": "Include service-proxy imports and ServiceMixin",
"815548e083b8b7ea5edd0e57df0bfd29": "Include repository imports and RepositoryMixin",
"8340baa1142a43339a4df3a9ea93e9cb": "Do not automatically install dependencies",
Expand Down Expand Up @@ -162,6 +166,7 @@
"ee3b2cc023d839e3e31d346de7cce9e7": "Destination model",
"f2b5f8ac7197fb5916c3fa3e0986b535": "Tutorial example on how to build an application with LoopBack 4.",
"f32b47dfce5e7d0077f977a61665cc29": "Running 'npm run lint:fix' to format the code...",
"f5b4bd2d7b921613e40c39a7bd0e22b2": "Please visit http://loopback.io/doc/en/lb4/Controller-generator.html for information on how repositories are discovered.",
"f5e20cc597e17deb35ef3ec4e55b707a": "Copyright owner:",
"f757c71fa54de6559c39e4e7f63a601c": "Please select target model",
"f796881442145767c4d38290ef887bfe": "Print the generator's options and usage",
Expand All @@ -172,5 +177,6 @@
"fae5b20162ed86b458a943aee0979f68": "Use @loopback/build",
"fd9d1ae9ba5ae0b5d8f2b2dd40be8b5f": "Model was not found in",
"fde67ed0176ea54fd0b2c6bb2fc72d13": "Is it required?:",
"ff0366defc888d15b3fbfc1458edf1c0": "No repositories found in {0}. ",
"ffa8d88b9563dfa3e567974095c39140": "You did not select a valid model"
}