New answers tagged translation
1
Technically, this is possible. Just make sure to use your strings after the parent plugin has loaded its language file.
In terms of maintainability, this is not optimal. Your create a very strond dependency here: each time the parent plugin changes a string (adding a dot, removing a white space), you have to change your strings too.
I would do this only to ...
0
I sometimes do borrow strings from WordPress and it is fine to do. The biggest problem I see is that the main plugin (WordPress in my case) can change the string and then it isn't translated anymore.
Another problem is that when you generate a pot file that it include all translatable strings. It doesn't look which textdomain it is using. In my case I ...
0
For archives you can use the get_archives_link filter like this:
add_filter('get_archives_link', 'translate_archive_month');
function translate_archive_month($list) {
$patterns = array(
'/January/', '/February/', '/March/', '/April/', '/May/', '/June/',
'/July/', '/August/', '/September/', '/October/', '/November/', '/December/'
);
...
2
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 ...
0
I've finally found why this strange thing was happening on my website.
It appears there was a conflict with the WPML String translation module which was already installed and configured to translate widget strings.
fr_FR.po file was never called because the WPML plugin was configured to use database translated strings and not .po/.mo files for widgets.
1
That plugin loads its language the moment its main file is included:
load_plugin_textdomain( 'wordpress-seo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
So when your locale filter is used, the language is already there. :/
Move your small plugin into the mu-plugins directory. You can create it if it doesn’t exists in wp-content. That ...
2
Use date_i18n():
date_i18n( 'Y. F j.', strtotime( get_the_time( "Y-m-d" ) ) );
From the function’s description:
Retrieve the date in localized format, based on timestamp.
If the locale specifies the locale month and weekday, then the locale will
take over the format for the date. If it isn't, then the date format string
will be used instead.
...
Top 50 recent answers are included