You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current state
This is how the translation for the theme works now
Suppose, the theme uses 200 texts, of which only 1 is not in the core.
When translating the theme it now show correctly only one text missing (thanks to this PR)
I translate the missing text and change the wording of another translation
I download the theme xlf files
I expect the xlf files for the theme to contain 2 translations, the one I added and the one I changed the wording, but the xlf files contain all the 200 texts of the theme.
Note: If a given wording is not translated, then the original wording should be used as translation in the exported file.
This note is about not translated wordings. It is not about wordings that are translated, but not overridden.
The two options when overriding wording
The translation of themes is special, because the theme translation is overriding the core translation. This problem is not related to BO and FO-core translations.
For modules that have an official translation in app/Resources/translations, the translation overriding the core translation, like for themes. Thus, in the following, you can read also module every time theme is used.
If we translate a theme, most of the wordings are already present in the core translation. There will be few wordings specific to the theme, and there will be some translations that will be adapted.
All texts: As for now, the exported xlf files may contain all texts used in the theme, and their translations.
Only specific: The exported xlf files may contain only texts either specific to the theme or overridden core translations.
Purpose of the xlf files
As far as I understand, the purpose of the exported xlf files is twofold:
Include the translation files in a public version of the theme
Save the translations in a VCS instead of the database
Comparing the two options Only specific has in my opinion several advantages over All texts:
From a theoretic perspective, All texts is clearly in contradiction with DRY principles.
In practice this means: When core translations are updated, the theme will never use them. The theme translation will be stuck at the wording at the time I first exported the xlf files.
When the files contain Only specific translations, they are more meaningful when looking at them. Only the relevant few wording are there, instead of dozens. This specially applies when we use the xlf files for VCS
When we include the translation files in a public version of the theme, we should never need All texts, because the core translation packs already contain all the other texts. This only requires to use the translation packs of the lowest supported PS version when generating the language files.
What are your thoughts about this?
The text was updated successfully, but these errors were encountered:
Current state
This is how the translation for the theme works now
I expect the xlf files for the theme to contain 2 translations, the one I added and the one I changed the wording, but the xlf files contain all the 200 texts of the theme.
Under The exported package it is written:
This note is about not translated wordings. It is not about wordings that are translated, but not overridden.
The two options when overriding wording
The translation of themes is special, because the theme translation is overriding the core translation. This problem is not related to BO and FO-core translations.
For modules that have an official translation in
app/Resources/translations
, the translation overriding the core translation, like for themes. Thus, in the following, you can read also module every time theme is used.If we translate a theme, most of the wordings are already present in the core translation. There will be few wordings specific to the theme, and there will be some translations that will be adapted.
Purpose of the xlf files
As far as I understand, the purpose of the exported xlf files is twofold:
Comparing the two options
Only specific has in my opinion several advantages over All texts:
What are your thoughts about this?
The text was updated successfully, but these errors were encountered: