Skip to content

Commit

Permalink
feat(languages): Validate languages against CLDR database
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Apr 16, 2022
1 parent ad87995 commit f96a331
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/languages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SILE.languageSupport = {
if SILE.languageSupport.languages[language] then return end
if SILE.hyphenator.languages[language] then return end
if not(language) or language == "" then language = "en" end
language = SILE.cldr.locales[language] and language or "und"
ok, fail = pcall(function () SILE.require("languages/" .. language) end)
if fail then
if fail:match("not found") then fail = "no support for this language" end
Expand Down

0 comments on commit f96a331

Please sign in to comment.