| @@ -5,16 +5,11 @@ | ||
| 5 | 5 | trait TranslationTrait { |
| 6 | 6 | /** |
| 7 | 7 | * It is not possible to use esc_html__ or esc_attr__ this way. |
| 8 | 8 | */ |
| 9 | - public function __( string $text, string $domain = 'default' ): string { | |
| 9 | + public function __( string $text, string $domain = 'default' ): ?string { | |
| 10 | 10 | // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralDomain |
| 11 | - $translation = __( $text, $domain ); | |
| 12 | - if ( is_string( $translation ) ) { | |
| 13 | - return $translation; | |
| 14 | - } | |
| 15 | - | |
| 16 | - return ''; | |
| 11 | + return __( $text, $domain ); | |
| 17 | 12 | } |
| 18 | 13 | |
| 19 | 14 | public function getLocale(): string { |
| 20 | 15 | return get_locale(); |