-
-
Notifications
You must be signed in to change notification settings - Fork 759
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
Update zh-Hans Translation and Fix selectedInterface #259
Conversation
Please remove all redundant +- empty lines. I don't see what you try to change. |
Also, I noticed that you try to just translate values like And at this stage, you can commit the translations. But they will be not visible now. |
Sorry for bothering, I've seen my mistakes. The spaces were added back and some changes reverted. The modification is now limited to the "Disabled" of the battery notification, the "Autodetection" of network interface and the name of fans. |
Modules/Battery/settings.swift
Outdated
@@ -110,7 +110,7 @@ internal class Settings: NSView, Settings_v { | |||
} | |||
|
|||
@objc private func changeUpdateInterval(_ sender: NSMenuItem) { | |||
if sender.title == "Disabled" { | |||
if sender.title == LocalizedString("Disabled") { |
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.
Sorry, but the saving key cannot be translated. It must be constant.
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.
Thank you for your review! I just made a new commit to keep the lowLevelNotification
and saving term Battery_lowLevelNotification
with a constant value "Disabled".
Modules/Net/settings.swift
Outdated
@@ -123,7 +123,7 @@ internal class Settings: NSView, Settings_v { | |||
@objc func handleSelection(_ sender: NSPopUpButton) { | |||
guard let item = sender.selectedItem else { return } | |||
|
|||
if item.title == "Autodetection" { | |||
if item.title == LocalizedString("Autodetection") { |
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 same problem as in the Battery module.
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.
stats/Modules/Net/settings.swift
Lines 126 to 127 in e33082f
if item.title == "Autodetection" { | |
self.store.pointee.remove("\(self.title)_interface") |
When
item.title == "Autodetection"
, the term Network_interface
would just be removed, so I think saving state would not be changed.
Hi. |
Happy New Year! 🎇🎆 stats/Modules/Net/settings.swift Lines 111 to 115 in 6fab321
I made a new commit for LocalizedString("Autodetection") . Now both the selection and storage don't depend on the localization anymore. So I think defining a [KeyValue_t] would be a little bit redundant for this part. I also find the line 115 in the code block above should be moved before selectItem to make it work properly.For LocalizedString("Disable") , it is indeed not a good modification, I can revert this part.
|
Hi. Sorry for the long response. Please do not translate the values which not ready for translation. If you want to have these values translated you can help to make it ready. You can take a look here how I make select option translatable. It must have a key, which will be used to store. And value (text) which could be translated. |
I see, that's very kind of you with great patience, and sorry for troubling you for such a long time. I've reverted all the changes except the |
* Add Localization to MenuItem and Fan. * Add spaces back. * Revert changes of L10n update-interval and color. * Fix storage of "Disabled". * Update the way to L10n of "Autodetection" * Revert Changes
The words shown in MenuItem now can be localized. I also changed the name of fans which was like "Fan #0". Sorry for the inconvenience that my editor deleted spaces at the end of each line automatically.