Tag Info

New answers tagged

0

i finally figured out a solution. I guess it's not the perfect one, because all posts are still looped and the wrong language just doesn't show, but for now it works. I am still open for ideas. My idea right now is to get the language of the post and don't display it if it doesn't match the pages language. Here's the new part. global $polylang; $postlang ...


0

Yes, you can load multiple translation files for multiple text domains in one plugin. This is sometimes useful, for example when you need just one string in AJAX calls and many strings in the rest of the application: to make AJAX faster, load a separate translation. Be aware, automatic language updates for the plugin from wordpress.org will probably not ...


1

Use get_post_types( ['public' => TRUE ], 'objects' );. This will return the already translated post type labels and other information. Example for tests: add_action( 'wp_footer', function() { $post_types = get_post_types( [ 'public' => TRUE, '_builtin' => TRUE ], 'objects' // complete information, not just the name ); ...


2

Modify your installation such that your custom Farsi language files are associated with a non-standard WPLANG value. For example, instead of the standard 'fa-IR', maybe try something non-standard like 'farsi-IR' (or even 'myCustomFarsi-IR'). This way, when new WordPress versions are released for the "official" Farsi version, you will no longer get ...


0

You can not translated dynamic strings with he translation API, you can translate only static strings that you know in advance.


2

Instead of using poedit to generate your translation strings from your code, use the WordPress i18n tools to generate a POT file for you. This has the advantages of a) not needing you to do anything special in poedit and b) getting everything that is possible for translation, including headers and non-standard translation string calls (not everything is __ ...


1

Ok. I Found the problem. Several tutorials told me to put __() and _e() in my poedit. Which, now I've found the answer is pretty stupid. Because there simply don't exist any strings with these search values. As there is always something in between those brackets. Solution is thus very simple (and quite stupid). Put the search values to __ and _e


1

Being part of the post content, the string can't be translated using translation function. You probably need a multilanguage plugin like WPML or Multilingual Press. In that way you'll be able to have different "version" (one per language supported) of the same post. However, if the only thing you need to translate is the word "Download" you can mind to ...



Top 50 recent answers are included