-
Notifications
You must be signed in to change notification settings - Fork 43
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
UI locale dbus #725
UI locale dbus #725
Conversation
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.
Looks OK to me, but someone with Rust knowledge should check it as well... 😃
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 looks good to me. Just a few suggestions.
const DIR : &str = "/usr/share/YaST2/locale/"; | ||
let entries = read_dir(DIR).context("Reading YaST2 locale")?; | ||
for entry in entries { | ||
let entry = entry.context("Failed to read entry in YaST2 locale dir")?; |
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.
So we are returning an error if we cannot read any of the dirs, right?
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.
yeah, any read failure result in error. I would not expect it unless there is some issue with fs.
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 /usr/share/YaST2/locale/
directory is owned by the base yast2
package so the error should not happen normally.
Co-authored-by: Imobach González Sosa <[email protected]>
Co-authored-by: Imobach González Sosa <[email protected]>
b5175a7
to
68ac11a
Compare
68ac11a
to
51ca721
Compare
const DIR : &str = "/usr/share/YaST2/locale/"; | ||
let entries = read_dir(DIR).context("Reading YaST2 locale")?; | ||
for entry in entries { | ||
let entry = entry.context("Failed to read entry in YaST2 locale dir")?; |
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 /usr/share/YaST2/locale/
directory is owned by the base yast2
package so the error should not happen normally.
Problem
There are some string that come from backend and it is displayed to user. But we do not set localization for those strings.
trello: https://trello.com/c/Jp7S5kwh/3398-5-agama-add-support-for-translating-the-messages-from-the-d-bus-interface
Solution
Implement in Locale method to enlist all possible backend localization ( so far only for ruby based ones ) and allow to set localization. In other services have helper that will set initial localization (1) and also catch signal when it is changed (2).
As part of this PR also drop no longer used Language Service.
(1)
(2) see
on_ui_locale_change
Testing
Screenshots
Example localization in czech ( in czech is only data comming from dbus ):