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

SystemService: don't use gettext in model constants #19403

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions app/models/system_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,35 @@ class SystemService < ApplicationRecord
SVC_TYPES = {
# Type Display
"" => "",
"1" => _("Kernel Driver"),
"2" => _("File System Driver"),
"4" => _("Service Adapter"),
"8" => _("Recognizer Driver"),
"16" => _("Win32 Own Process"),
"32" => _("Win32 Shared Process"),
"256" => _("Interactive"),
"272" => _("Win32 Own Process, Interactive"),
"288" => _("Win32 Shared Process, Interactive"),
"1" => N_("Kernel Driver"),
"2" => N_("File System Driver"),
"4" => N_("Service Adapter"),
"8" => N_("Recognizer Driver"),
"16" => N_("Win32 Own Process"),
"32" => N_("Win32 Shared Process"),
"256" => N_("Interactive"),
"272" => N_("Win32 Own Process, Interactive"),
"288" => N_("Win32 Shared Process, Interactive"),
}

START_TYPES = {
# Type Display
"" => "",
"0" => _("Boot Start"),
"1" => _("System Start"),
"2" => _("Automatic"),
"3" => _("Manual"),
"4" => _("Disabled")
"0" => N_("Boot Start"),
"1" => N_("System Start"),
"2" => N_("Automatic"),
"3" => N_("Manual"),
"4" => N_("Disabled")
}

def start
s = self['start']
START_TYPES[s] || s
_(START_TYPES[s]) || s
end

def svc_type
svc = self['svc_type']
SVC_TYPES[svc] || svc
_(SVC_TYPES[svc]) || svc
end

def self.add_elements(parent, xmlNode)
Expand Down