Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): add no-translate keywords #6298

Closed
wants to merge 1 commit into from
Closed

fix(cli): add no-translate keywords #6298

wants to merge 1 commit into from

Conversation

dhmlau
Copy link
Member

@dhmlau dhmlau commented Sep 7, 2020

Signed-off-by: Diana Lau [email protected]

Fixes #6287
Service and Observer should also be reserved words and not meant to be translated. Following what this commit had done, add the no translation: _reserved_words_ as a comment at the top of the class.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • 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 👈

@@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

// no translation: Observer
Copy link
Member

Choose a reason for hiding this comment

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

How is this comment going to affect the translation process?

On line 24/25, I see:

description: g.f('Name of the observer group for ordering'),

I think we need to change that message too? For example:

description: g.f('Name of the %s group for ordering', 'observer'),

@@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

// no translation: Service
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here. I see several g.f calls below that contains words we may not want to translate (datasource, service, etc.).

@bajtos
Copy link
Member

bajtos commented Sep 8, 2020

Anyhow, I see you are just following an existing approach, so feel free to ignore my comments.

@dhmlau
Copy link
Member Author

dhmlau commented Sep 8, 2020

@bajtos, @agnes512 is verifying with @candytangnb whether we've implemented as expected in #5658 (comment).

@dhmlau dhmlau added CLI GVT For translation tests labels Sep 8, 2020
@candytangnb
Copy link
Contributor

@agnes512 @bajtos @dhmlau I see that Comments "// no translation: term1, term2,...termn" had not been added into https://github.com/strongloop/loopback-next/blob/master/packages/cli/intl/en/messages.json but other files, right?
In fact, this comment is added to instruct translator/translation tool.
So it is suggested that to add Comments "// no translation: term1, term2,...termn" in the file which need to be sent out for translation.

@dhmlau
Copy link
Member Author

dhmlau commented Sep 9, 2020

@candytangnb, thanks for clarifying. I'll submit a PR to fix it. Thanks.

@dhmlau
Copy link
Member Author

dhmlau commented Sep 9, 2020

Pinged @candytangnb to get an example of how the comments can be added, because comments are not supported in json. I tried to add it and it complains about SyntaxError: Unexpected token / in JSON at position 0.

@dhmlau dhmlau marked this pull request as draft September 10, 2020 13:33
@dhmlau
Copy link
Member Author

dhmlau commented Sep 10, 2020

Converting to draft for now, as the proposed changes will not work.

@dhmlau
Copy link
Member Author

dhmlau commented Sep 11, 2020

@candytangnb suggested to wrap the reserved word with {{no-translate}} and {{/no-translate}}, i.e.

"012baa262729b0782646db9528429b4c": "Please select the {{no-translate}}repository{{/no-translate}} base class",

@dhmlau
Copy link
Member Author

dhmlau commented Nov 25, 2020

Closing this PR since it's not the right solution.

@dhmlau dhmlau closed this Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI GVT For translation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GSSC-GVT][v10]English string in apic lb4 service
5 participants