1

Is there a way to easily override the translation of a word or phrase as produced by the t() function throughout the Concrete5 settings pages/dashboard, without altering core files?

For example, if several core files use this code:

<?= t('Empty Auto-Nav Block.') ?>

Can I somehow override this and specify my own translation without producing another whole language file?

Simon East
  • 55,742
  • 17
  • 139
  • 133
  • I don't think this is possible without overriding the whole language file into `/application/languages` – toesslab Jan 28 '16 at 06:46

1 Answers1

1

This does not appear to be easily possible.

Concrete 5.7 uses Zend Translate, and others on S.O. have asked about creating overrides for this (see override gettext .mo files).

If you only need to override a few words from the default US language, you can:

  1. Create a custom MO file using a tool such as POEditor.com, including just the words/terms you want to override
  2. Save the .mo file to /application/languages/[LANGUAGE-CODE]/LC_MESSAGES/
  3. Enable your new language file via C5 Dashboard > Settings > Basics > Languages

However if you need to override words from another language, it looks like you might have to create your own custom PO/MO files that contains the entire dictionary. You can probably import an existing one from the official c5 translations repository on Github.

This appears to be a major limitation of the Zend Translate library.

Community
  • 1
  • 1
Simon East
  • 55,742
  • 17
  • 139
  • 133