Skip to content

Commit

Permalink
fix: Package abbr uses the language code only, not a full BCP47 tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Dec 29, 2024
1 parent 17aba98 commit dd04623
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/resilient/abbr/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function package:registerCommands ()

self:registerCommand("abbr:no", function (_, content)
local lang = SILE.settings:get("document.language")
-- We only need the language code, so truncate any BCP-47 tag
lang = lang:match("([^%-_]+)")
if SILE.Commands["abbr:no:"..lang] then
SILE.call("abbr:no:"..lang, {}, content)
else
Expand All @@ -62,6 +64,8 @@ function package:registerCommands ()

self:registerCommand("abbr:nos", function (_, content)
local lang = SILE.settings:get("document.language")
-- We only need the language code, so truncate any BCP-47 tag
lang = lang:match("([^%-_]+)")
if SILE.Commands["abbr:nos:"..lang] then
SILE.call("abbr:nos:"..lang, {}, content)
else
Expand Down

0 comments on commit dd04623

Please sign in to comment.