[3.3] Drop translation of ContentType files … with a bonus #6802
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.
Background
There has been an ongoing debate in the internal team about the "correct" way to handle translation strings for ContentType files.
The debate has centred around data domains, as those of us (myself included for years) do not think they belong in
app/config/contenttypes.yml
. Personally, I still don't.Problem 1
Language is hard. Structurally speaking, languages can be very different, and making assumptions of that structure in other languages using Proto-Germanic rooted languages as a base breaks pretty quickly. Ironically, other Proto-Germanic languages (e.g. Dutch) also break when making this base assumption.
tl;dr ContentType translations are invalid in both
app/config/contenttypes.yml
, andvendor/bolt/bolt/app/resources/xx_XX/contenttypes.xx_XX.yml
Problem 2
Our translation layer is in need of love. Currently maintenance is falling to @CarsonF and myself. The two of busiest/overloaded people in the project. We no longer have the bandwidth or desire to carry what has become a massive burden finishing of the general migration work on v3, brought about by it's release nearly a year before it was ready.
Problem 3
ContentType translations are currently only working "as intended". While debugging these changes in preparation for PR I found a bunch of places in our translation layer where ContentType strings are missing the currently implemented keyword.
Time to fix, and LoC changed, is significantly greater than simply removing & replacing. See "Problem 2".
Breaking changes
Visual … mostly.
ContentType translations are now handled by default via the
name:
&singular_name:
keys inapp/config/contenttypes.yml
for that ContentType.So where in a number of languages you can't now correctly handle things like pluralisation automatically, you can.
What about my translations?
@bobdenotter commented to me recently, that I have a very positive habit of taking things out and giving something better back in its place …
Localised translations can now be enabled in this branch!
To use, in your site project create
app/translation/xx_XX/messages.xx_XX.yml
orapp/translation/messages.xx_XX.yml
(all translations in the one directory) filese.g.
Results in: