Translating dynamic strings
Translating dynamic strings
Translating dynamic strings
Ok I made it, it was a problem in po file, missing some arguments or informations in headers. I’ve generated a new one and replaced with my previously done translations keeping only headers. Loco translate made it work. Cheers !
Translatable Categories
Best way around it would probably be to manually call load_textdomain() on the corresponding MO file in your theme’s functions.php.
Well, the way I work with Poedit is: Open Poedit Open the .pot file with Poedit Define the language of the translation Find the info you want to translate on the left collumn Place the translation on the right collumn Save the .po Compile the .mo Save both on the ‘language’ folder of the theme … Read more
Turns out the .po file I was editing was not the correct one for my plugin. i’ve reconstructed the .po and .mo with the .pot file inside the plugin, and now translations works just fine.
The first question here is why don’t you want to duplicate your pages? I would very much advise to use a plugin like PolyLang or WMPL that do exactly that. qTranslate X is a plugin that does not duplicate pages. It just copies the content of all translations into one post. https://de.wordpress.org/plugins/qtranslate-x/
How can i merge the translations from one .po file into the source on another .po file?
Correcting the answer given by Max. To use this approach, the filter you need is gettext_with_context because your string is translated via _x() not __(). Note that the filtered argument passed is the translation, so you should check the source string ($text and $context) to ensure you’re filtering the correct item. add_filter( ‘gettext_with_context’, ‘added_translation’, 20, … Read more
The “%s” will be replaced by strings translated in the WordPress Core “default” text domain. e.g. “%s mins”, “%s hours”, etc.. Find these in your core translation files and translate them too.