Skip to content
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

[i18n] Wrap easy strings in gettext function #9398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Oct 9, 2024

This wraps the long hanging fruit of user-facing strings on the PHP side of LORIS in the gettext function (using the _ alias). It does not comprehensively do every string, because:

  1. Some strings have variables embedded. A lookup into the gettext would not translate these
  2. modules//ajax/ scripts are ignored, because they bypass the index.php/router/etc where the the domain is likely to be set by LORIS. The work of fixing them is assumed to be less than the work of updating them to proper endpoints.
  3. Strings that weren't obvious if they would break anything are ignored (ie. keys in an array)
  4. Probably some other that I'm forgetting

Nonetheless, it's a first pass at marking up our code with translatable strings.

This wraps the long hanging fruit of user-facing strings on the PHP
side of LORIS in the gettext function (using the _ alias). It does
not comprehensively do every string, because:
1. Some strings have variables embedded. A lookup into the gettext
   would not translate these
2. modules/*/ajax/* scripts are ignored, because they bypass the
   index.php/router/etc where the the domain is likely to be set
   by LORIS. The work of fixing them is assumed to be less than the
   work of updating them to proper endpoints.
3. Strings that weren't obvious if they would break anything are ignored
   (ie. keys in an array)
4. Probably some other that I'm forgetting

Nonetheless, it's a first pass at marking up our code with translatable
strings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant