Improve use of Wikimedia i18n library to provide translated UI
Author: ostephensCreated Nov 22, 2018Updated Sep 9, 2026
LabelsModule: FrontendGood First Issuelocalization
Following #1846 we need to make further modifications to make use of the more powerful translation options offered by this library
- Amend the dictionary JSON returned by http://127.0.0.1:3333/command/core/load-language? (i.e. LoadLanguageCommand.java) to include multiple languages so the UI can fall back to an appropriate language if a term is not present in their preferred language. (Done - #2209)
- Change uses of string concatenation to use parameterized templates e.g. https://github.com/OpenRefine/OpenRefine/blob/9d72de1874726be82e458335deef7cd4aee0302f/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js#L262 should be translated as a single phrase with parameter replacement like
elmts.dialogHeader.text($.i18n('core-views/split-col-into-several-col', column.name'));with text like"Split column $1 into several columns". Note that phrases should also include any punctuation, so it can be localized correctly as well. - Similarly review / change uses of HTML layout to provide visual concatenation of phrases that may need to be localized
- Implement support for pluralization using the syntax described at (Wikimedia jQuery i18n plugin) anti-pattern looks like this: https://github.com/OpenRefine/OpenRefine/blob/ddd9bf9aa80a43c68bf6d8fb4dc9d0b8bb29dcd5/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js#L274-L275
Source: OpenRefine/OpenRefine