Remove hardcoding filename in localization files

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
This commit is contained in:
Reagan Lopez
2019-05-22 17:40:06 -07:00
parent 0ecd594053
commit fc2bc1806c
4 changed files with 13 additions and 9 deletions
+3 -2
View File
@@ -490,8 +490,9 @@ msgstr "System failed to pass pre-install checks."
msgid "System Check Failed"
msgstr "System Check Failed"
msgid "Unable to read /proc/cpuinfo"
msgstr "Unable to read /proc/cpuinfo"
#, c-format
msgid "Unable to read %s"
msgstr "Unable to read %s"
msgid "Missing CPU feature: "
msgstr "Missing CPU feature: "
+3 -2
View File
@@ -490,8 +490,9 @@ msgstr "El sistema no pasó las comprobaciones previas a la instalación."
msgid "System Check Failed"
msgstr "Comprobación del sistema fallida"
msgid "Unable to read /proc/cpuinfo"
msgstr "No puede leer /proc/cpuinfo"
#, c-format
msgid "Unable to read %s"
msgstr "No puede leer %s"
msgid "Missing CPU feature: "
msgstr "Característica de la CPU que falta: "
+3 -2
View File
@@ -490,8 +490,9 @@ msgstr "系统无法通过安装前检查。"
msgid "System Check Failed"
msgstr "系统检查失败"
msgid "Unable to read /proc/cpuinfo"
msgstr "无法读取 /proc/cpuinfo"
#, c-format
msgid "Unable to read %s"
msgstr "无法读取 %s"
msgid "Missing CPU feature: "
msgstr "缺少CPU功能: "
+4 -3
View File
@@ -16,10 +16,11 @@ import (
)
func getCPUFeature(feature string) error {
cpuInfo, err := ioutil.ReadFile("/proc/cpuinfo")
fName := "/proc/cpuinfo"
cpuInfo, err := ioutil.ReadFile(fName)
if err != nil {
log.Error("Unable to read /proc/cpuinfo")
return errors.New(utils.Locale.Get("Unable to read /proc/cpuinfo"))
log.Error("Unable to read %s", fName)
return errors.New(utils.Locale.Get("Unable to read %s", fName))
}
if strings.Contains(string(cpuInfo), feature) {
return nil