[i18n] Add support for fledgling Hebrew translation (#6333)

See <https://hosted.weblate.org/languages/he/koreader/> if you'd like to contribute.
reviewable/pr6341/r1
Frans de Jonge 4 years ago committed by GitHub
parent 86db43a052
commit 4a3710b6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -211,6 +211,10 @@ 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 Hebrew which has 4 plural forms.
if plurals == "n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && n % 10 == 0) ? 2 : 3)" then
plurals = "n == 1 ? 0 : (n == 2) ? 1 : (n > 10 && n % 10 == 0) ? 2 : 3"
end
-- Hardcoded workaround for Romanian which has 3 plural forms.
if plurals == "n == 1) ? 0 : ((n == 0 || n != 1 && n % 100 >= 1 && n % 100 <= 19) ? 1 : 2" then
plurals = "n == 1 ? 0 : (n == 0 || n != 1 && n % 100 >= 1 && n % 100 <= 19) ? 1 : 2"

@ -15,7 +15,7 @@ local Language = {
fr = "Français",
gl = "Galego",
it_IT = "Italiano",
he = "Hebrew",
he = "עִבְרִית",
hu = "Magyar",
nl_NL = "Nederlands",
nb_NO = "Norsk",
@ -141,6 +141,7 @@ function Language:getLangMenuTable()
--self:genLanguageSubItem("bn"),
self:genLanguageSubItem("el"),
--self:genLanguageSubItem("fa"),
self:genLanguageSubItem("he"),
self:genLanguageSubItem("ja"),
--self:genLanguageSubItem("kk"),
self:genLanguageSubItem("ko_KR"),

Loading…
Cancel
Save