[fix] gettext: unescape \\ for ID matching (#8357)

Fixes <https://github.com/koreader/koreader/issues/8356>.
This commit is contained in:
Frans de Jonge
2021-10-28 17:48:23 +02:00
committed by GitHub
parent 3483238546
commit 0aab7d7378

View File

@@ -268,6 +268,8 @@ function GetText_mt.__index.changeLang(new_lang)
s = s:gsub("\\n", "\n")
-- unescape " or msgid won't match
s = s:gsub('\\"', '"')
-- unescape \\ or msgid won't match
s = s:gsub("\\\\", "\\")
data[what] = (data[what] or "") .. s
else
-- Don't save this fuzzy string and unset fuzzy for the next one.