Skip to content

Expand i18n coverage to all relevant strings #1370

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

Merged
merged 2 commits into from
Aug 5, 2021
Merged

Expand i18n coverage to all relevant strings #1370

merged 2 commits into from
Aug 5, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 28, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Enhancement

  • What is the current behavior?

Although an effective internationalization (AKA "i18n") framework is already in place in the Arduino CLI code base (#676), the actual coverage of the interface's strings is very minimal, intended only to serve as an initial proof of concept to evaluate the system.

  • What is the new behavior?

This provides internationalization of the strings of the Arduino CLI code base. It will now be possible to completely
translate the primary Arduino CLI user interface.

No breaking change.

  • Other information:

Scope

We decided that the log messages would be excluded from the internationalization scope for now. The reason is that the addition of these strings would significantly increase the workload on the community translators, while generally being of less visibility and/or importance to the users. Even though on an individual basis there are surely specific log messages of higher importance than specific non-log strings that were internationalized, the log/non-log dichotomy provided an objective criterion for determining which strings were in scope for this initial effort. Perhaps we will expand the i18n coverage at some time in the future after there has been good progress on the initial translation effort.

Notes

Some techniques were employed to facilitate translation:

  • Code references were moved out of internationalized strings in cases where a translator might mistake them for prose and translate them.
  • Indices were added to printf verbs when multiple were present in a string. This allows the translator to easily insert them at the appropriate location in the sentence structure without being required to understand the Go printf syntax and without being restricted to their relative order in the English language source string.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 28, 2021
@per1234 per1234 requested review from silvanocerza and rsora July 28, 2021 17:06
@@ -142,7 +142,7 @@ func identify(pm *packagemanager.PackageManager, port *discovery.Port) ([]*rpc.B
logrus.Debug("Board not recognized")
} else if err != nil {
// this is bad, bail out
return nil, errors.Wrap(err, "error getting board info from Arduino Cloud")
return nil, errors.Wrap(err, tr("error getting board info from Arduino Cloud"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should Arduino Cloud be translated? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is no, but this might be one of those cases where the loss of context in "error getting board info from %s" makes it more difficult for the translator to interpret the meaning?

I'm not really sure. I am not sufficiently experienced in this area to be able to make judgements at this level.

This provides internationalization of the strings of the Arduino CLI code base. It will now be possible to completely
translate the primary Arduino CLI user interface.

We decided that the log messages would be excluded from the internationalization scope for now. The reason is that the
addition of these strings would significantly increase the workload on the community translators, while generally being
of less visibility and/or importance to the users. Even though on an individual basis there are surely specific log
messages of higher importance than specific non-log strings that were internationalized, the log/non-log dichotomy
provided an objective criterion for determining which strings were in scope for this initial effort. Perhaps we will
expand the i18n coverage at some time in the future after there has been good progress on the initial translation effort.

Some techniques were employed to facilitate translation:

- Code references were moved out of strings in cases where a translator might mistake them for prose and translate them.
- Indices were added to printf verbs when multiple were present in a string. This allows the translator to easily insert
  them at the appropriate location in the sentence structure without being required to understand the Go printf syntax
  and without being restricted to their relative order in the English language source string.

Co-authored-by: Silvano Cerza <[email protected]>
@per1234 per1234 merged commit e31a717 into arduino:master Aug 5, 2021
@per1234 per1234 deleted the expand-i18n branch August 5, 2021 20:07
@per1234 per1234 self-assigned this Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants