New answers tagged

0

For consistency, I'm assuming you'd prefer to use "Save" instead of "Publish" throughout Wordpress instead of just on the text of the button. Based on the solution provided by @Rarst, I expanded the code so it translates many (all?) other instances of the word "Publish" to the appropriate variation of "Save". add_filter("gettext", "...


0

You can wrap it inside double quotes: esc_html_e("I couldn't find the page you are looking for.", "themename");


1

You should use placeholders: $time = sprintf( '<i class="fa fa-clock-o" aria-hidden="true"></i> %s: <time datetime="%s">%s</time>', esc_html__('Posted on', 'textdomain'), get_the_time('Y-m-d'), get_the_time('j F Y') );


0

In wordpress a translation is part of the code. If you change translations you should track the .po files in "git" as if it was any other kind of code. An alternative option is to override the textdomain used for translation and use another one that uses another .mo file located at some "safe" location. But this is just a band-aid over the "translation is ...


0

Go to ADMIN Dashboard and than go to Settings -> General and select your language (Polish). Install New plugin "Loco Translate": https://wordpress.org/plugins/loco-translate/ and follow the Basic usage Under Installation Tab (In wordpress org)


1

I'm not completely sure whether this is what you want, but if the option page is in one language you can simply put the gettext call in the custom field itself to avoid using variables. For the admin you force the translation to spanish: function wpse227983_force_language ( $locale ) { if ( is_admin() ) { return 'es_ES'; } return $locale;...



Top 50 recent answers are included