Module packages.bibtex.csl.locale

Reader for CSL 1.0.2 locale files

Info:

  • Copyright: License: MIT (c) 2024 Omikhleia

    Public API: - (static method) CslLocale.parse(doc) -> CslLocale - (static method) CslLocale.read(filename) -> CslLocale - CslLocale:date(form) -> table - CslLocale:term(name, form?, plural?) -> string, gender - CslLocale:ordinal(number, form?, gender-form?, plural?) -> string - CslLocale:case(text, textCase) -> string

Functions

CslLocale:date(form) Lookup a date format in the locale.
CslLocale:term(name, form, plural) Lookup a term in the locale.
CslLocale:ordinal(number, name, form, genderf, plural) Lookup an ordinal term in the locale.
CslLocale:case(text, textCase) Apply a text case transformation.
CslLocale.parse(doc) Parse a CSL locale file (static method).
CslLocale.read(filename) Read a CSL locale file (static method).


Functions

CslLocale:date(form)
Lookup a date format in the locale.

Parameters:

  • form string The form of the date ('numeric' or 'text')

Returns:

    table The date format as a table of cs:date-parts
CslLocale:term(name, form, plural)
Lookup a term in the locale. Reserved for non-ordinal terms.

Parameters:

  • name string The name of the term
  • form string The form of the term (default: "long")
  • plural boolean Whether to return the plural form (default: false)

Returns:

    string,string The term (or empty string), and the gender or the term (or nil)
CslLocale:ordinal(number, name, form, genderf, plural)
Lookup an ordinal term in the locale. Reserved for ordinal terms.

Parameters:

  • number number The numeric value to be formatted
  • name string The name of the term
  • form string The form of the term (default: "short")
  • genderf string The gender-form of the term (default: "neuter")
  • plural boolean Whether to return the plural form (default: false)
CslLocale:case(text, textCase)
Apply a text case transformation.

Parameters:

  • text string Text to transform
  • textCase string CSL case transformation

Returns:

    string The transformed text
CslLocale.parse(doc)
Parse a CSL locale file (static method).

Parameters:

  • doc string The CSL locale file content

Returns:

    CslLocale The locale object (or nil, error message on failure)
CslLocale.read(filename)
Read a CSL locale file (static method).

Parameters:

  • filename string The resolved filename of the locale file

Returns:

    CslLocale The locale object (or nil, error message on failure)
generated by LDoc 1.5.0 Last updated 1980-01-01 00:00:00