build icon indicating copy to clipboard operation
build copied to clipboard

Default language should contain valid language code

Open florianm opened this issue 2 years ago • 1 comments

ODK Build uses English as default language. Exported as XForm, the import to ODK Central works fine and the form is usable - this is likely what most users will do. However, when exported via XLSForm, ODK Central shows the following warning:

This XLSForm file can be used, but it has the following possible problems (conversion warnings):

    The following language declarations do not contain valid machine-readable codes: English. Learn more: http://xlsform.org#multiple-language-support

This warning can be corrected by either manually changing the language from English to English (en) in the XLSX spreadsheet, or directly in ODK Build (Edit > Manage translations > Active language > add the (en).

florianm avatar Dec 09 '21 01:12 florianm

This could be as simple as changing https://github.com/getodk/build/blob/master/public/javascripts/i18n.js#L13 from

    var defaultLanguages = function() { return { 0: 'English', _counter: 0, _display: '0' }; };

to

    var defaultLanguages = function() { return { 0: 'English (en)', _counter: 0, _display: '0' }; };

and possible update the "Displayed Language" in index.erb:91

Edit: the above idea does not work but may be an entry point.

Alternatively, this could be handled in build2xlsform.

florianm avatar Dec 13 '21 04:12 florianm