Skip to content

Language tags: xlsform2lstsv accepts 2-letter codes only, convention:languageTagging allows BCP 47 #67

Description

@jstet

Found while doing #64.

convention:languageTagging (registry/conventions/languageTagging.jsonld) says language codes in label::<lang> columns and settings.default_language SHOULD be valid IETF BCP 47 tags, e.g. de, en, fr-BE. The XLSForm → LimeSurvey TSV pipeline accepts 2-letter codes only:

  • isValidLanguageCode (src/utils/languageUtils.ts) requires exactly two letters from a fixed list. The loader drops language columns whose code fails it, so a label::fr-BE column is silently ignored.
  • resolveConfig (formerly ConfigManager.validateConfig) rejects any defaults.language that isn't two characters.

To decide:

  • LimeSurvey's own language codes include regional and variant forms (de-informal, pt-BR, zh-Hans, …), so a BCP 47 tag can't always be passed straight through. Decide on a mapping from BCP 47 tags to LimeSurvey codes, and what happens to an unmapped tag. It should be an error or a warning, never a silent drop.
  • DDI (xml:lang) takes BCP 47 as is.

Either change the convention to "ISO 639-1 two-letter codes", or make the pipeline accept tags per the convention. Right now the two disagree.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions