This project is read-only.

Localization priority in child theme

Topics: Customizing Orchard, General, Localization, Writing themes
Jan 28, 2015 at 10:13 AM
Edited Jan 28, 2015 at 3:20 PM
We have created 2 custom themes:
  • Parent Theme
  • Child Theme (based on parent theme)
According to the documentation, translations are looked up in this order in the .po files:
~/App_Data/Sites/<tenant name>/Localization/<culture-code>/orchard.po (Tenant)
~/App_Data/Localization/<culture-code>/orchard.root.po (Root)
~/Themes/<theme-name>/App_Data/Localization/<culture-code>/orchard.theme.po (Themes)
~/Modules/<module-name>/App_Data/Localization/<culture-code>/orchard.module.po (Modules)
~/Core/App_Data/Localization/<culture-code>/orchard.core.po (Core)
If we activate the "Child Theme" in our tenant and have a specific translation in both "Parent Theme" and "Child Theme" (but not in Root nor Tenant), the translation found in "Parent Theme" takes precedence. This is a little bit unexpected as it is the opposite behavior of the resource override mechanism used for the other files in the themes (cshtml lookup, style/script inclusions...).

Note that I don't know if the "Parent Theme" takes precedence because it is last in alphabetical order or because it is the highest theme in the hierarchy.

Worse... It seems that if a specific translation is present in the modules folder and in the "Child Theme" folder (and nowhere else), the translation is read from the "Child Theme" folder even though the active theme is "Parent Theme".
Jan 30, 2015 at 12:01 AM
Whoah - yeah that sounds odd. The correct behavior should be that the translation comes from the child theme, not the parent.

Could you raise an issue for this?