mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-09 15:06:39 +00:00
fix(i18n): translate texts with line breaks; drop the experimental label of OCI stacks
This commit is contained in:
+2
-1
@@ -265,7 +265,8 @@ translate() {
|
||||
local lang_file="$LANG_DIR/${dest_lang}.json"
|
||||
if [ -s "$lang_file" ] && command -v jq >/dev/null 2>&1; then
|
||||
local cached
|
||||
cached=$(jq -r --arg text "$text" '.[$text] // empty' "$lang_file" 2>/dev/null)
|
||||
# A text written with \n in a script is stored with real line breaks.
|
||||
cached=$(jq -r --arg text "$text" '.[$text] // .[($text | gsub("\\\\n"; "\n"))] // empty' "$lang_file" 2>/dev/null)
|
||||
if [ -n "$cached" ]; then
|
||||
echo "$cached"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user