From e9111c1aecf7e0c435d655e132b3387d29acf5a2 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:45:35 +0800 Subject: [PATCH] update the translation override instructions --- README.md | 27 +++++++++---------- .../locales/en/LC_MESSAGES/material.po | 3 +++ .../locales/es/LC_MESSAGES/material.po | 3 +++ .../locales/fr/LC_MESSAGES/material.po | 3 +++ .../locales/ko/LC_MESSAGES/material.po | 3 +++ 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9332e79..8c4ce01 100644 --- a/README.md +++ b/README.md @@ -221,22 +221,21 @@ docker composer up -d ssp-hub.local ## Overriding translations / dictionaries If you use this Docker image but want to change some of the translations, you -can do so by providing identically-named dictionary files into an "overrides" -subfolder with just the desired changes, then running the -"apply-dictionaries-overrides.php" script. +can do so by appending the translations on the end of the base image's files. +Use the modules/material/locales/en/LC_MESSAGES/material.po file for reference. +Reference the [GNU gettext PO Files](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files) +documentation for more information about the file format. -Example Dockerfile (overriding text in the MFA module's material theme): +Example Dockerfile excerpt (overriding text in the MFA module's material theme): ```dockerfile -FROM silintl/ssp-base:7.1.0 - -# ... do your other custom Docker stuff... - -# Copy your translation changes into an "overrides" subfolder: -COPY ./dictionaries/* /data/vendor/simplesamlphp/simplesamlphp/modules/material/dictionaries/overrides/ - -# Merge those changes into the existing translation files: -RUN cd /data/vendor/simplesamlphp/simplesamlphp/modules/material/dictionaries/overrides/ \ - && php /data/apply-dictionaries-overrides.php +# Copy your translation changes into the working folder: +COPY locales/* /data + +# Append those changes onto the existing translation files: +RUN cat /data/en.material.po >> $SSP_PATH/modules/material/locales/en/LC_MESSAGES/material.po +RUN cat /data/es.material.po >> $SSP_PATH/modules/material/locales/es/LC_MESSAGES/material.po +RUN cat /data/fr.material.po >> $SSP_PATH/modules/material/locales/fr/LC_MESSAGES/material.po +RUN cat /data/ko.material.po >> $SSP_PATH/modules/material/locales/ko/LC_MESSAGES/material.po ``` ## Custom Modules diff --git a/modules/material/locales/en/LC_MESSAGES/material.po b/modules/material/locales/en/LC_MESSAGES/material.po index e1e3741..745912b 100644 --- a/modules/material/locales/en/LC_MESSAGES/material.po +++ b/modules/material/locales/en/LC_MESSAGES/material.po @@ -364,3 +364,6 @@ msgstr "%idpName% coming soon" msgid "{selectidp-links:help}" msgstr "Help" + +# leave an extra empty line to separate the last non-empty line in this file from the first line in an override file + diff --git a/modules/material/locales/es/LC_MESSAGES/material.po b/modules/material/locales/es/LC_MESSAGES/material.po index 8ab3621..eba02c3 100644 --- a/modules/material/locales/es/LC_MESSAGES/material.po +++ b/modules/material/locales/es/LC_MESSAGES/material.po @@ -364,3 +364,6 @@ msgstr "%idpName% próximamente" msgid "{selectidp-links:help}" msgstr "Ayuda" + +# leave an extra empty line to separate the last non-empty line in this file from the first line in an override file + diff --git a/modules/material/locales/fr/LC_MESSAGES/material.po b/modules/material/locales/fr/LC_MESSAGES/material.po index 7c0318b..1d905c6 100644 --- a/modules/material/locales/fr/LC_MESSAGES/material.po +++ b/modules/material/locales/fr/LC_MESSAGES/material.po @@ -364,3 +364,6 @@ msgstr "%idpName% à venir" msgid "{selectidp-links:help}" msgstr "Aidez-moi" + +# leave an extra empty line to separate the last non-empty line in this file from the first line in an override file + diff --git a/modules/material/locales/ko/LC_MESSAGES/material.po b/modules/material/locales/ko/LC_MESSAGES/material.po index 4350fe6..368f620 100644 --- a/modules/material/locales/ko/LC_MESSAGES/material.po +++ b/modules/material/locales/ko/LC_MESSAGES/material.po @@ -364,3 +364,6 @@ msgstr "%idpName% 곧 제공됨" msgid "{selectidp-links:help}" msgstr "도움" + +# leave an extra empty line to separate the last non-empty line in this file from the first line in an override file +