mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] GetText: Support Arabic plurals (#5517)
Fixes <https://github.com/koreader/koreader/issues/5516>. Cf. <https://github.com/koreader/koreader/pull/5515>.
This commit is contained in:
@@ -202,8 +202,12 @@ function GetText_mt.__index.changeLang(new_lang)
|
||||
local plurals = plural_forms:match("%((.*)%)")
|
||||
|
||||
if not plurals then
|
||||
-- we might be dealing with a language without plurals
|
||||
plurals = plural_forms:match("plural=(0)")
|
||||
-- Some languages (e.g., Arabic) may not use parentheses.
|
||||
-- However, the following more inclusive match is more likely
|
||||
-- to accidentally include junk and seldom relevant.
|
||||
-- We might also be dealing with a language without plurals.
|
||||
-- That would look like `plural=0`.
|
||||
plurals = plural_forms:match("plural=(.*)")
|
||||
end
|
||||
|
||||
if plurals:find("[^n!=%%<>&:%(%)|?0-9 ]") then
|
||||
|
||||
Reference in New Issue
Block a user