-
Notifications
You must be signed in to change notification settings - Fork 22
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
Allow to select the license language when running in text mode #441
Conversation
See also another check for TextMode: yast-packager/src/modules/ProductLicense.rb Line 681 in 71d43cf
|
def force_language? | ||
return false unless Yast::UI.TextMode | ||
|
||
Yast::Builtins.getenv("TERM") == "iterm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way around!
|
||
# Whether it is needed to force the default language | ||
# | ||
# @return [Boolean] true if running but not in a fbiterm; false otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if running what
414012f
to
ff41d16
Compare
There are more checks for TextMode in ProductLicense: yast-packager/src/modules/ProductLicense.rb Line 681 in 71d43cf
and yast-packager/src/modules/ProductLicense.rb Line 1713 in 71d43cf
|
My WIP is c067f5d It fails the old unit tests, and changes only the main product, but its ideas are clear enough to be transferable to the add-on product case in ProductLicense.rb |
TODO: things to test:
|
@mvidner |
The product license translations widget is not in charge to check if is being used in the TextMode anymore. Instead, now simply relies on the Yast::Language#supported_language? to know whether a specific language is "displayable" or not.
see also https://tools.ietf.org/html/rfc4647 Matching of Language Tags
RSpec::Matchers.define :array_not_including do |x| | ||
match do |actual| | ||
return false unless actual.is_a?(Array) | ||
return false if actual.include?(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a simple !actual.include?(x)
instead of the 2 lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor notes/questions.
# 2 space indentation | ||
[*.rb] | ||
indent_style = space | ||
indent_size = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding also trim_trailing_whitespace = true
?
- I'm not sure if we want to add it as a part of a maintenance update, maybe adding only to
master
would be better. - It would make sense to have it in all repositories, but then we should agree on the exact content first (discuss at yast-devel@ ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll bring it up on the mailing list... done.
Co-Authored-By: Ladislav Slezák <lslezak@suse.cz>
# @return [LanguageTag,nil] | ||
def generalize | ||
self.class.new(@tag.split("_").first) if @tag.include? "_" | ||
# else nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seem to be dead code. We could just remove it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, I'd actually put some comment that nil
might be returned above the code line. If you just quickly scan the line you might miss that if
at the end and think that an object is always returned.
Product License Hard to Understand? Try Another Language!
Problem: Only in the text-mode installation, we cannot switch the language of a product license, both for the main product and add-on products. The language switching widget is there but it's disabled.bsc#1135901
Reason: That's on purpose, since on the Linux console we're not able to display the characters of most languages, bsc#1094793.
Fix: But wait, recently we have switched to starting fbiterm unconditionally, so we are in fact able to display all languages that currently have license translations. So let's enable the language switch.