Creating a custom multilingual form

What would be the easiest, cheapest approach for this? Simple, create one form per language. In functions.php or, preferably, as a custom plugin: add_shortcode( ‘my-lingo-form’, ‘shortcode_wpse_98360’); function shortcode_wpse_98360() { $lingo = your_language_detection_method(); switch( $lingo ) { case ‘en’: echo do_shortcode(‘[form-en]’); break; default: echo do_shortcode(‘[form-other-languages]’); break; } } In your post or page: [my-lingo-form].

Change / tweak existing wordpress translations

It is better to use a separate file to prevent an overwriting during an upgrade. Filter load_textdomain_mofile and replace the old file with your own: add_filter( ‘load_textdomain_mofile’, function( $mofile, $domain ) { if ( ‘name_of_the_textdomain’ === $domain ) return ‘path_to_your_file.mo’; return $mofile; });

Read text defined under __()

You should look at gettext filter hook which is applied to the translated text by the internationalization functions (__(), _e(), etc.). eg: add_filter( ‘gettext’, ‘my_sanitizer’, 20, 3 ); /** * my_sanitizer * @param string $translated_text the translation * @param string $text the origial text from __() * @param string $domain text domain * @return string … Read more

Replacing strings within posts with the translatable string

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 … Read more

translating wordpress with poedit

Take a closer look at next_post_link and previous_post_link. Specifically; how the function arguments are arranged. Next, take a closer look at translating strings; and how the function arguments are arranged. Now, when you put the two together; you should have something like this: <?php previous_post_link( ‘<span class=”meta-nav”> %link </span>’, __( ‘&#9668; Previous’,’twentyten’), TRUE ); ?> … Read more