fix: globalize messages from artifact generator#5163
Merged
Conversation
dhmlau
reviewed
Apr 20, 2020
packages/cli/lib/utils.js
Outdated
| log( | ||
| chalk.red('>>> ') + | ||
| `Accented chars in the class name will get replaced: ${name}`, | ||
| g.f('Accented chars in the class name will get replaced: ') + `${name}`, |
Member
There was a problem hiding this comment.
I think we can include the name as a parameter, i.e.
g.f('Accented chars in the class name will get replaced: {0}', `${name}`)
7077265 to
1d8f5b3
Compare
agnes512
commented
Apr 21, 2020
Contributor
Author
agnes512
left a comment
There was a problem hiding this comment.
Added some screenshots to prove that these strings can be translated.
| generator.log( | ||
| chalk.red( | ||
| `The project was originally generated by @loopback/cli@${originalCliVersion}.`, | ||
| g.f( |
| **/ | ||
| promptClassFileName(type, typePlural, name) { | ||
| utils.logClassCreation(type, typePlural, name, this.log.bind(this)); | ||
| this.log( |
| utils.toClassName(this.artifactInfo.type), | ||
| chalk.yellow(classesOutput), | ||
| classes.length > 1 ? 'were created in' : 'was created in', | ||
| classes.length > 1 ? g.f('were created in') : g.f('was created in'), |
| this.artifactInfo.destinationModel, | ||
| )} instances?`, | ||
| message: g.f( | ||
| 'Allow %s queries to include data from related %s instances? ', |
dhmlau
approved these changes
Apr 21, 2020
agnes512
commented
Apr 21, 2020
| chalk.red( | ||
| 'By disabling Camel case, you might need to specify these customized names in relation definition.', | ||
| g.f( | ||
| 'By disabling Camel case, you might need to specify these customized names in relation definition.', |
Contributor
There was a problem hiding this comment.
Is "By disabling Camel case" supposed to still be in English?
Contributor
Author
There was a problem hiding this comment.
In the PR, they are supposed to be in English. And those screenshots are showing that the globalized string in English can be translated ( but we don't do the translation ourselves).
nabdelgadir
approved these changes
Apr 21, 2020
| chalk.red( | ||
| 'By disabling Camel case, you might need to specify these customized names in relation definition.', | ||
| g.f( | ||
| 'By disabling Camel case, you might need to specify these customized names in relation definition.', |
Contributor
There was a problem hiding this comment.
Is "By disabling Camel case" supposed to still be in English?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Fixes #5131
Globalizes
xxx will be created in...andxxx was created in....stringsand other strings.
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈