NOOP_Translations

Provides the same interface as Translations but performs no actual translation. All lookups return the original string. Used as a stand-in when no translation file is loaded.

Source: wp-includes/pomo/translations.php Since: 2.8.0

Note: This class does not extend Translations. It is a standalone class with the same public interface. Uses #[AllowDynamicProperties].

Properties

PropertyTypeDefaultDescription
$entriesTranslation_Entry[]array()Always empty
$headersarray<string, string>array()Always empty

Methods

All methods match the Translations interface but are no-ops or passthroughs:

MethodReturnsBehavior
add_entry( $entry )trueNo-op, always returns true
set_header( $header, $value )voidNo-op
set_headers( $headers )voidNo-op
get_header( $header )falseAlways returns false
translate_entry( &$entry )falseAlways returns false
translate( $singular, $context = null )stringReturns $singular unchanged
select_plural_form( $count )intEnglish rules: 1 === $count ? 0 : 1
get_plural_forms_count()intAlways returns 2
translate_plural( $singular, $plural, $count, $context = null )stringReturns $singular if count is 1, $plural otherwise
merge_with( &$other )voidNo-op