Fraser
Fraser

Reputation: 14244

Silverstripe: Adding to the translation tables

I need to add additional translations to the Silverstripe 3 translation tables in sapphire/lang/[lang].yml

I am pulling in 'sapphire' as an SVN external so cannot just add the new values to the existing yml files.

Am I able to create additional language yml files for languages to add to these translations in mysite directory?

Upvotes: 0

Views: 365

Answers (1)

Ingo Schommer
Ingo Schommer

Reputation: 716

Yes, just create a new module with the following structure:

z_translations/
    _config.php
    lang/
        en.yml

The z_ prefix ensures it comes alphabetically last, currently there's no way to influence loading order. the translations part can be anything. _config.php can be empty, but needs to be present for the folder to be detected as a module.

Note that in order to override translations in framework/admin/lang/, you have to create an admin subfolder in your module as well ... don't ask ;)

Upvotes: 1

Related Questions