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.
Problem
Some strings in the UI dialogs are not translated, resulting in text being shown partially in the configured locale language, partially in English.
The issue was originally reported for the Simplified Chinese language, but it can also be replicated for Brazilian Portuguese, leading to infer that probably all translations are affected by the same issue.
Cause
The strings not being translated are marked with the function
N_(...)
, assigned to instance variables that would later be localized with the function_(...)
, which is quite common when using thegettext
Ruby gem.However, the cause is that the
y2tools y2makepot
command, used to identify localized strings, doesn't consider the functionN_(...)
when scanning the files (source code).Solution
We changed the code to no longer use the function
N_(...)
, only_(...)
, and adapted the classes that relied on receiving strings withN_(...)
through instance variables.Testing
yast2-rmt
package.Meanwhile, you can verify that files previously not considered for translation are caught by the command
rake check:pot
:src/lib/rmt/maria_db/current_root_password_dialog.rb
src/lib/rmt/maria_db/new_root_password_dialog.rb
src/lib/rmt/ssl/current_ca_password_dialog.rb
src/lib/rmt/ssl/new_ca_password_dialog.rb
Output example from running
rake check:pot
:You can also read the generated
rmt.pot
file and verify that the strings previously marked withN_(...)
(see the "Files changed" tab) are present there, e.g.:Screenshots
N/A.