Skip to content

fix: globalize messages from artifact generator#5163

Merged
agnes512 merged 1 commit intomasterfrom
arti-util-g
Apr 22, 2020
Merged

fix: globalize messages from artifact generator#5163
agnes512 merged 1 commit intomasterfrom
arti-util-g

Conversation

@agnes512
Copy link
Contributor

@agnes512 agnes512 commented Apr 20, 2020

Fixes #5131

Globalizes xxx will be created in... and xxx was created in.... strings
and other strings.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

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}`,
Copy link
Member

Choose a reason for hiding this comment

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

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}`) 

@agnes512 agnes512 force-pushed the arti-util-g branch 3 times, most recently from 7077265 to 1d8f5b3 Compare April 21, 2020 19:32
Copy link
Contributor Author

@agnes512 agnes512 left a comment

Choose a reason for hiding this comment

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

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(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

**/
promptClassFileName(type, typePlural, name) {
utils.logClassCreation(type, typePlural, name, this.log.bind(this));
this.log(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

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'),
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 19 48

this.artifactInfo.destinationModel,
)} instances?`,
message: g.f(
'Allow %s queries to include data from related %s instances? ',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

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.',
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下午5 18 19

Copy link
Contributor

Choose a reason for hiding this comment

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

Is "By disabling Camel case" supposed to still be in English?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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).

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.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "By disabling Camel case" supposed to still be in English?

@agnes512 agnes512 merged commit 5d54b55 into master Apr 22, 2020
@agnes512 agnes512 deleted the arti-util-g branch April 22, 2020 14:28
@agnes512 agnes512 added this to the April 2020 milestone Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GSSC-GVT]English String in LB4 command "apic lb4 interceptor"

3 participants