Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function vk_customize_woocommerce_strings( $translation, $text, $domain ) {
- if ( 'woocommerce' !== $domain ) {
- return $translation;
- }
- // Массив точных соответствий
- $custom_text = array(
- 'Товар' => 'Продукт',
- 'Товары' => 'Продукты',
- );
- if ( isset( $custom_text[ $translation ] ) ) {
- $translation = $custom_text[ $translation ];
- } else {
- // Правила для гибкой замены
- $translation = str_ireplace( 'товар', 'продукт', $translation );
- }
- return $translation;
- }
- add_filter( 'gettext', 'vk_customize_woocommerce_strings', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement