Skip to content

Commit

Permalink
Merge pull request #19403 from mzazrivec/dont_use_gettext_in_model_co…
Browse files Browse the repository at this point in the history
…nstants_5

SystemService: don't use gettext in model constants
  • Loading branch information
kbrock authored Oct 17, 2019
2 parents 3805adc + 61c39e9 commit faf4b02
Showing 1 changed file with 16 additions and 16 deletions.
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

0 comments on commit faf4b02

Please sign in to comment.