The quick localization plugin stores your translations within the database, meaning that each translation need to be fetched from the DB first, which slows it down a little. It’s a useful tool, but if your comfortable with PHP you can do is using the custom gettest function at the bottom:
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'People' => 'Instructors',
);
// See if the current string is in the $strings array
// If so, replace its translation
if ( isset( $strings[$original] ) ) {
// This accomplishes the same thing as __()
// but without running it through the filter again
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 );
Each translation just goes on a new line within the $strings array, like this:
$strings = array(
'People' => 'Instructors',
'Another string' => 'Another translation',
'And another' => 'This is another translation',
);
(original string on the left, translation on the right)
You can continue to use the quick localization plugin if you prefer, this will just be slightly quicker.
The support post ‘People Add-on – Change People label to something else’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.