Repository navigation
Load the back-office catalogs under the default-twig domain - #27
Merged
ThomasDaSilva merged 1 commit intoOct 22, 2026
Merged
ThomasDaSilva merged 1 commit into
ThomasDaSilva merged 1 commit into
Conversation
ThomasDaSilva
marked this pull request as ready for review
October 22, 2026 09:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 4.3.0 dropped the Smarty back-office, the module's back-office screens are no longer translated. In a French admin the side menu reads "Credit Notes" instead of "Avoirs", and every other label of the Twig screens falls back to its English source.
The templates translate with the
creditnote.bo.defaultdomain. The kernel registers a<module>.bo.<template>domain only for a template directory the module ships, and reads its catalogs fromI18n/backOffice/<template>/(TheliaKernel::loadModuleTranslationDirectories()). The module now ships onlytemplates/backOffice/default-twig/, so the kernel registerscreditnote.bo.default-twig, finds noI18n/backOffice/default-twig/, and never loadscreditnote.bo.default.Changes:
I18n/backOffice/default/toI18n/backOffice/default-twig/, and the templates translate withcreditnote.bo.default-twig.TranslationCatalogTestchecks that everyboorfodomain names a template directory the module ships, with its catalogs where the kernel reads them. Onmainit fails with "the creditnote.bo.default domain names a template the module does not ship".The domain follows the template the module ships, as TheliaGiftCard already does. Keeping
creditnote.bo.defaultwould need an emptytemplates/backOffice/default/directory, which the next cleanup would remove. The module domain (creditnote, the one the PHP code uses) would also work, at the cost of mixing the 138 back-office labels into its 23. If you prefer it, I can switch this PR to it.Upgrade note: a shop that overrides one of these labels in
local/I18nwith acreditnote.bo.default.key has to rename it tocreditnote.bo.default-twig..Tested: unit suite green (33 tests). In a shop with the module linked,
trans('Credit Notes', [], 'creditnote.bo.default-twig', 'fr_FR')returns "Avoirs" through both the framework translator and the Thelia translator, and the old domain still returns "Credit Notes".