From @sthomen. Moving from https://github.com/backdrop/backdrop-issues/issues/704 because it's closed and proposes a very different approach to translating config:
I'm probably not expressing myself properly, the idea was to make something like this: https://www.youtube.com/watch?v=p-1z72YgPCc
In this example video there is no change to the site settings code. It uses the standard language selector block in the admin layout. The only difference is a little special handling in config.inc. Now this is a very crude thing I cooked up this afternoon, and calling the new method setLangcode in get() and set() is probably suboptimal, but it works and it's easy to make configuration strings translatable and it should make it much easier for end users to find them.
There could perhaps be a separate UI page for converting strings to be translatable, drupal8 does something like that I think. Profile builders, module builders could easily bundle translations with their default configs.
Perhaps I'm totally out sailing, but isn't this a better approach than going via t() and also having a configuration setting?
system.core.json looks like this:
"site_name": {
"_translated": true,
"sv": "Test sajt",
"en": "Test site"
},
[...]
"site_slogan": {
"_translated": true,
"sv": "Detta är ett häftigt test!",
"en": "This is a test."
},
Here's a zip with my changes: translatable_config.zip
Recent comments
@yorkshirepudding - Thank you! That's just what I needed. In the code, it's actually fontyourface_ui_settings_form (with underscores rather than dashes). Now it's working ... I only have to figure...
Question about hook_form_FORM_ID_alter
Oh the benefits of a new set of eyes.... I don't know how many times I've looked at that css and not spotted that! Mind you, in my defense, my eyes are over 70 years old (and obviously in need of...
How to over-ride grid-flexbox.css
thanks yorkshirepudding, i used the CSS Injector option with this code and it works .views-table caption { font-weight: bold; color: blue; font-size: 26px; }
How to change the format of the Views group title field?