mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[i18n] Fix Romanian plural forms (#5692)
Hardcode the plural forms logic for Romanian. This fixes #5661 and enables Romanian (Moldova) language in the menu.
This commit is contained in:
committed by
Frans de Jonge
parent
a838a6eb1d
commit
739a3009ff
@@ -201,6 +201,11 @@ function GetText_mt.__index.changeLang(new_lang)
|
||||
local nplurals = plural_forms:match("nplurals=([0-9]+);") or 2
|
||||
local plurals = plural_forms:match("plural=%((.*)%);")
|
||||
|
||||
-- Hardcoded workaround for Romanian which has 3 plural forms.
|
||||
if plurals == "n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1)" then
|
||||
plurals = "n==1 ? 0 : (n%100>19) || ((n%100==0) && (n!=0)) ? 2 : 1"
|
||||
end
|
||||
|
||||
if not plurals then
|
||||
-- Some languages (e.g., Arabic) may not use parentheses.
|
||||
-- However, the following more inclusive match is more likely
|
||||
|
||||
@@ -130,7 +130,7 @@ function Language:getLangMenuTable()
|
||||
self:genLanguageSubItem("pt_PT"),
|
||||
self:genLanguageSubItem("pt_BR"),
|
||||
--self:genLanguageSubItem("ro"),
|
||||
--self:genLanguageSubItem("ro_MD"),
|
||||
self:genLanguageSubItem("ro_MD"),
|
||||
self:genLanguageSubItem("sk"),
|
||||
self:genLanguageSubItem("sv"),
|
||||
self:genLanguageSubItem("vi"),
|
||||
|
||||
Reference in New Issue
Block a user