Skip to content

class Language

The language object is the first argument to most of the other functions in the lang library.

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!


methods


Language.id


function Language.id() ->  integer

@return - The number returned is the internal language id number this object refers to.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Return the current internal language id number.

Example:

local l = lang.new(123)
print(l:id())
-- 123

Reference:

  • Corresponding C source code: llanglib.c#L50-L56
  • https://gitlab.lisn.upsaclay.fr/texlive/luatex/-/blob/f52b099f3e01d53dc03b315e1909245c3d5418d3/manual/luatex-languages.tex#L956-960

Language.hyphenation


function Language.hyphenation(hyphenation_exceptions: string)

Add hyphenation exceptions.

Example:

local l = lang.new()
l:hyphenation("man-u-script")
print(l:hyphenation()) -- man-u-script
l:hyphenation("ca-tas-tro-phe")
print(l:hyphenation()) -- man-u-script ca-tas-tro-phe

Reference:

  • Corresponding C source code: llanglib.c#L86-L104
  • https://gitlab.lisn.upsaclay.fr/texlive/luatex/-/blob/f52b099f3e01d53dc03b315e1909245c3d5418d3/manual/luatex-languages.tex#L968-980

Language.hyphenation


function Language.hyphenation() -> hyphenation_exceptions string?

Get the hyphenation exceptions.

Example:

local l = lang.new()
l:hyphenation("man-u-script")
print(l:hyphenation()) -- man-u-script

Reference:

  • Corresponding C source code: llanglib.c#L86-L104
  • https://gitlab.lisn.upsaclay.fr/texlive/luatex/-/blob/f52b099f3e01d53dc03b315e1909245c3d5418d3/manual/luatex-languages.tex#L968-980

Language.clear_hyphenation


function Language.clear_hyphenation()

Clear the set of hyphenation exceptions.

Example:

local l = lang.new()
print(l:hyphenation()) -- nil
lang.hyphenation(l, "man-u-script")
lang.hyphenation(l, "ca-tas-tro-phe")
print(lang.hyphenation(l)) --  man-u-script ca-tas-tro-phe
lang.clear_hyphenation(l)
print(lang.hyphenation(l)) -- nil

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!

Language.patterns


function Language.patterns(patterns: string)
@param patterns - For example .ab3a .abb2 .ab5erk

😱 Types incomplete or incorrect? 🙏 Please contribute!

Add additional patterns for this language object.

Reference:

Language.patterns


function Language.patterns() -> pattterns string?

@return pattterns - For example .ab3a .abb2 .ab5erk

😱 Types incomplete or incorrect? 🙏 Please contribute!

Return the current set of patterns.

Reference: