Skip to content
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

lang: added missing translation #2353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fadedflower
Copy link
Contributor

No description provided.

@exelban
Copy link
Owner

exelban commented Jan 24, 2025

hi. I have take a quick look and there is no string like "Normal" in the project

@fadedflower
Copy link
Contributor Author

It is in the memory pressure notification setting

@exelban
Copy link
Owner

exelban commented Jan 24, 2025

ok, but just adding a string to the language file does not mean that it will be translated. Again, there is no such string in the project. Memory pressures are not translated since its system value. So if you want to add translation to that you need to add according code for that to be translated.

@fadedflower
Copy link
Contributor Author

@exelban It IS translated.
SCR-20250124-rans

@fadedflower
Copy link
Contributor Author

It is translated by calling selectView in Kit/extensions.swift

func selectView(action: Selector, items: [KeyValue_p], selected: String) -> NSPopUpButton {
        let select: NSPopUpButton = NSPopUpButton(frame: NSRect(x: 0, y: 0, width: 50, height: 28))
        select.target = self
        select.action = action
        
        let menu = NSMenu()
        items.forEach { (item) in
            if item.key.contains("separator") {
                menu.addItem(NSMenuItem.separator())
            } else {
                let interfaceMenu = NSMenuItem(title: localizedString(item.value), action: nil, keyEquivalent: "")
                interfaceMenu.representedObject = item.key
                menu.addItem(interfaceMenu)
                if selected == item.key {
                    interfaceMenu.state = .on
                }
            }
        }
        select.menu = menu
        
        return select
    }

@exelban
Copy link
Owner

exelban commented Jan 24, 2025

hmm, yeap. You are right. Missed that, was looking only for strings. So LGTM then, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants