Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

For core Revive Adserver plugins, do NOT commit changed .mo files to the repository. See above for how .mo files are managed using Crowdin.

Translation Strings in Plugin PHP Code

In plugin PHP code, to obtain a correctly translated string for display to a user, based on their settings, use either the MAX_Plugin_Translation class, or the OX_Component class:

Code Block
// MAX_Plugin_Translation Approach
// $this->extension and $this->group need to be set to the plugin's extension (hook) and group
// This will generally already be done when inside an instantiated plugin
require_once RV_PATH . '/lib/max/Plugin/Translation.php';
$text = MAX_Plugin_Translation::translate('TargetString', $this->extension, $this->group);
 
// OX_Component Approach
// Use when the plugin already extends the OX_Component class
$this->translate('TargetString');