Skip to content

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Sep 22, 2025

The importing of a named variable for every language at the top of multilingual files, just to pass it to addResourceBundle is getting a little unwieldy.

Replace them with an inline require() at the addResourceBundle call site so that we don't need to pollute the import namespace for every language (and to make life easier if dialects are added such as en-CA and en-US).

Testing instructions: Nothing should be affected in LORIS. In particular, translations should still be translated.

@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Module: candidate_list PR or issue related to candidate_list module Module: datadict PR or issue related to (old) datadict module Module: dictionary PR or issue related to (new) dictionary module Module: data_release PR or issue related to data_release module labels Sep 22, 2025
@driusan driusan added Cleanup PR or issue introducing/requiring at least one clean-up operation Meta PR does something that organizes, upgrades, or manages the functionality of the codebase Multilingual Any tasks related to making LORIS multilingual and removed Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Module: candidate_list PR or issue related to candidate_list module Module: datadict PR or issue related to (old) datadict module Module: dictionary PR or issue related to (new) dictionary module Module: data_release PR or issue related to data_release module labels Sep 22, 2025
@driusan driusan force-pushed the SimplifyLanguageImports branch from 10839c9 to de90550 Compare September 29, 2025 14:05
@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Module: candidate_list PR or issue related to candidate_list module Module: datadict PR or issue related to (old) datadict module Module: dictionary PR or issue related to (new) dictionary module Module: data_release PR or issue related to data_release module labels Sep 29, 2025
The importing of a named variable for every language at the top
of multilingual files, just to pass it to addResourceBundle is
getting a little unwieldy.

Replace them with an inline require() at the addResourceBundle call
site so that we don't need to pollute the import namespace for every
language (and to make life easier if dialects are added such as en-CA
and en-US).
@driusan driusan force-pushed the SimplifyLanguageImports branch from de90550 to 977ef8c Compare September 29, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup PR or issue introducing/requiring at least one clean-up operation Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Meta PR does something that organizes, upgrades, or manages the functionality of the codebase Module: candidate_list PR or issue related to candidate_list module Module: data_release PR or issue related to data_release module Module: datadict PR or issue related to (old) datadict module Module: dictionary PR or issue related to (new) dictionary module Module: statistics PR or issue related to statistics module Multilingual Any tasks related to making LORIS multilingual
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants