0

I'd like to translate one word in WP but I don't want to replace the whole translation files (.mo and .po) because of only one word (it will be overriden with the next WP version and I'll have to remember about it constantly).

Is it possible to translate only one word without overriding the rest?

P.S.: I need to translate 'no-subset' to 'cyrillic' in /wp-includes/script-loader.php:

            /* translators: To add an additional Open Sans character subset specific to your language,
             * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
             */
            $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );

            if ( 'cyrillic' == $subset ) {
                    $subsets .= ',cyrillic,cyrillic-ext';
            } elseif ( 'greek' == $subset ) {
                    $subsets .= ',greek,greek-ext';
            } elseif ( 'vietnamese' == $subset ) {
                    $subsets .= ',vietnamese';
            }

            // Hotlink Open Sans, for now
            $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";
    }
0

OMFG that is the most stupid code I saw in core for some time. Don't follow the comments there, if you want to use a different flavor of open sans just write a plugin that deregister the style and add the one you want to be used instead

function replace_open_sans() {
  wp_deregister_style('open-sans');
  wp_register_style('open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans:300');
  wp_enqueue_style('open-sans');
}
add_action( 'wp_enqueue_styles', 'replace_open_sans' );

code taken from http://www.webdevelopmentgroup.com/2014/01/replace-open-sans-in-wordpress-3-8/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.