Skip to content

[candidate_list] Translate candidate_list module #9797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented May 16, 2025

This translates the candidate list module as an example of how to do localization of a loris module that is written in React with class based components.

JSON files are generated from the same .po files used by the PHP side of file, which are then imported into the i18next resources. They are generated at compile time with the i18next-conv package. Modules (in this case candidate_list) must call the addResourceBundle method of i18next to add the strings which are specific to their module.

This example uses the withTranslation HOC, but functional components can use the useTranslation hook instead.

Note that in this PR I only translated the strings from the candidate_list module itself used by the filters/headers to serve as an example. There are other strings which come from components in the jsx/ directory which are shared across all modules. Those will be in other PRs since they are a one-time effort for all modules.

This translates the candidate list module as an example of how
to do localization of a loris module that is written in React
with class based components.
@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: candidate_list PR or issue related to candidate_list module labels May 16, 2025
@driusan driusan force-pushed the TranslateCandidateList branch from 0a97362 to 4cc141e Compare May 16, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Module: candidate_list PR or issue related to candidate_list module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant