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 21, 2024
1 parent 17aba98 commit 8eab3e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/resilient/abbr/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function package:registerCommands ()

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

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

0 comments on commit 8eab3e5

Please sign in to comment.