Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I see the way how to translate custom configs.
I see the way how to translate custom configs.
Comments
Comment #1
victor-shelepen CreditAttribution: victor-shelepen commentedWhile this meeting, I am investigating this problem.
Comment #2
Gábor HojtsyHere is a short summary:
Drupal best practices:
1. Your config should be stored with the config .yml system in core
2. You should write configuration schemas for your config (docs: https://drupal.org/node/1905070, module to test/inspect: https://drupal.org/project/config_inspector)
3. Make sure your config file has langcode: en (or another langcode as appropriate) at all times; put up a language selector for users if the config can change language (see core has for views, vocabularies, etc).
Config translation UI enablement
4. If (1), (2) and (3) are true, you can use hook_config_translation_group_info() (see docs in https://drupal.org/project/config_translation) to map config keys to paths (or config entities, if you have those)
5. If the config you are dealing with is a config entity and you also have a listing page for your entities, add a translate operation to the list if the config_entity module is turned on (this will hopefully be automated later as well)
This will magically expose a translation tab on your config settings page (or config entity editing page), which lists languages and lets people submit translations (and go back edit original config values).
Any questions? :)
Comment #3
victor-shelepen CreditAttribution: victor-shelepen commentedThank you. Sorry for my late reply. I have been trying to reproduce it.
Comment #4
Gábor Hojtsy