math: fix error message

Fix badly formatted error message, and make it translatable

Part of #12594
This commit is contained in:
Nahor
2026-03-31 12:34:00 -07:00
committed by Johannes Altmanninger
parent 68c7baff90
commit 014e3b3aff
12 changed files with 33 additions and 3 deletions

View File

@@ -1818,6 +1818,9 @@ msgstr "Ungültige Genauigkeitsangabe: %s"
msgid "missing hexadecimal number in escape"
msgstr "fehlende Hexadezimal-Zahl in Escapesequenz"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1818,6 +1818,9 @@ msgstr "invalid precision: %s"
msgid "missing hexadecimal number in escape"
msgstr "missing hexadecimal number in escape"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1821,6 +1821,9 @@ msgstr "precisión inválida: %s"
msgid "missing hexadecimal number in escape"
msgstr "falta un número hexadecimal en la secuencia de escape"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr "solo se soportan f1 hasta f%d, no f%s"

View File

@@ -1947,6 +1947,9 @@ msgstr "précision invalide : %s"
msgid "missing hexadecimal number in escape"
msgstr "nombre hexadécimal manquant dans léchappement"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1820,6 +1820,9 @@ msgstr "無効な精度: %s"
msgid "missing hexadecimal number in escape"
msgstr "エスケープ内に16進数がありません"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr "f1からf%dまでのみサポートされています。'f%s'はサポートされていません"

View File

@@ -1814,6 +1814,9 @@ msgstr ""
msgid "missing hexadecimal number in escape"
msgstr ""
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1819,6 +1819,9 @@ msgstr "precisão inválida: %s"
msgid "missing hexadecimal number in escape"
msgstr "falta número hexadecimal no escape"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1815,6 +1815,9 @@ msgstr ""
msgid "missing hexadecimal number in escape"
msgstr "saknad hexadecimalt nummer i escapesekvens"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr ""

View File

@@ -1842,6 +1842,9 @@ msgstr "无效的精度:%s"
msgid "missing hexadecimal number in escape"
msgstr "在转义中缺少十六进制数字"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr "仅支持 f1 至 f%d不支持 'f%s'"

View File

@@ -1816,6 +1816,9 @@ msgstr "無效的精度:%s"
msgid "missing hexadecimal number in escape"
msgstr "轉義序列缺少十六進位數字"
msgid "non-zero scale value only valid for base 10"
msgstr ""
#, c-format
msgid "only f1 through f%d are supported, not 'f%s'"
msgstr "只支援 f1 至 f%d不包括「f%s」"

View File

@@ -145,8 +145,7 @@ fn parse_cmd_opts(
streams.err.appendln(&wgettext_fmt!(
BUILTIN_ERR_COMBO2,
cmd,
"non-zero scale value only valid
for base 10"
wgettext!("non-zero scale value only valid for base 10")
));
return Err(STATUS_INVALID_ARGS);
}

View File

@@ -23,6 +23,8 @@ math --scale=6 '5 / 3 * 0.3'
# CHECK: 0.5
math --scale=max '5 / 3'
# CHECK: 1.666666666666667
math --scale=1 --base=16 "2 / 3 - 1"
# CHECKERR: math: invalid option combination, non-zero scale value only valid for base 10
math "7^2"
# CHECK: 49
math -1 + 1
@@ -138,7 +140,6 @@ math n + 4
# CHECKERR: 'n + 4'
# CHECKERR: ^
not math 'sin()'
# CHECKERR: math: Error: Too few arguments
# CHECKERR: 'sin()'