Get default_language value

As far as I know, there is currently no way to do this. Form definitions can query values in the "main instance" which defines the structure of submissions, but they can't query other elements outside of that, including translation definitions.

We've recently talked about better detection of the current language and language changes (e.g. in Jr:choice-name() not re-evaluated on form language change). This is thematically related. If it feels like functionality that's missing, consider changing the category of this post to "Ideas" and adding more detail on how you'd use this functionality.

Note that the rules for determining what language will actually be shown to users are a bit complex and aren't identical between Collect and Enketo (I've just added this to the differences doc). In both, default_language is the language that's shown the first time a form is opened. But if the user changes the language, that selection is remembered moving forward (and essentially becomes a local default). If no explicit default_language is set:

  • Enketo: matches browser language if IANA language tags are used, otherwise the first language defined is an implicit default
  • Collect: the first language defined is an implicit default
1 Like