Comments on: Multilingual WordPress – Internationalising themes http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/ Sun, 22 Mar 2015 14:44:25 +0000 hourly 1 http://wordpress.org/?v=4.1.1 By: Ade http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-32503 Thu, 21 Jul 2011 22:10:27 +0000 http://www.studiograsshopper.ch/?p=1026#comment-32503 No worries!

Glad you sorted it out. :-)

]]>
By: sui_iuris http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-32307 Sun, 17 Jul 2011 17:13:19 +0000 http://www.studiograsshopper.ch/?p=1026#comment-32307 I solved the problem.

?php comments_number(__(‘No Responses’, ‘mytext’), __(‘One Response’, ‘mytext’), __(‘% Responses’, ‘mytext’)) ;?

Here’s how “__(” is use when the phrase is already in brackets.

]]>
By: sui_iuris http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-32306 Sun, 17 Jul 2011 17:12:46 +0000 http://www.studiograsshopper.ch/?p=1026#comment-32306 I solved the problem.

Here’s how “__(” is use when the phrase is already in brackets.

]]>
By: sui_iuris http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-32293 Sun, 17 Jul 2011 11:47:27 +0000 http://www.studiograsshopper.ch/?p=1026#comment-32293 < ?php comments_number('No Responses', 'One Response', '% Responses') ;?>

Finally, really, reaaaally, sorry for triple posting but this code didn’t show up, twice :).

]]>
By: sui_iuris http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-32291 Sun, 17 Jul 2011 11:37:31 +0000 http://www.studiograsshopper.ch/?p=1026#comment-32291 Hallo!
Great work, great tutorial! Thank you. I’m almost ready with my multilingual site, but still I wonder how to internationalise phrases: “No Responses”, “One Response” and “Responses” in the code below:

Is it possible at all?

Thank you in advance!

]]>
By: Ade http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-10293 Mon, 08 Mar 2010 23:33:13 +0000 http://www.studiograsshopper.ch/?p=1026#comment-10293 This line:

$html .= ''.get_string_limit($post_title,50).' '.get_string_limit($post_content,300).'
"Read more"';

becomes this:

$html .= ''.get_string_limit($post_title,50).' '.get_string_limit($post_content,300).'
' . __("Read more", 'textdomain') . '';

Replace textdomain with the actual textdomain name you’re using.

]]>
By: Jepsiba http://www.studiograsshopper.ch/web-development/multilingual-wordpress-internationalising-themes/#comment-10279 Mon, 08 Mar 2010 16:06:44 +0000 http://www.studiograsshopper.ch/?p=1026#comment-10279 Hello,
Thank you very much for this great tutorial. I have followed the steps modifying my theme and everything went great, except for one phrase inside a function where I have no idea how to insert the php code. I tried everything I could think of but I always ended up braking the code.
I was wondering if you could help me placing it the way it should? This is the code part where the phrase “Read more” is what I would like to translate:
I can’t tell where the part of the code begins and ends so I just copy pasted the whole function here.
I hope you can help me please? I would really appreciate it :) Thank you very much!!


function carousel_featured_posts($max_posts=5, $offset=0) {
if(!function_exists('show_featured_posts'))
return false;

global $wpdb, $table_prefix;
$table_name = $table_prefix."features";

$sql = "SELECT * FROM $table_name ORDER BY date DESC LIMIT $offset, $max_posts";
$posts = $wpdb->get_results($sql);

$html = '';
$coint_i = 0;
foreach($posts as $post) {
$coint_i++;
$id = $post->id;
$posts_table = $table_prefix.'posts';
$sql_post = "SELECT * FROM $posts_table where id = $id";
$rs_post = $wpdb->get_results($sql_post);
$data = $rs_post[0];
$post_title = stripslashes($data->post_title);
$post_title = str_replace('"', '', $post_title);
$post_content = stripslashes($data->post_content);
$post_content = str_replace(']]>', ']]>', $post_content);
$post_content = strip_tags($post_content);
$permalink = get_permalink($data->ID);
$post_id = $data->ID;
$html .= '

';

$thumbnail = get_post_meta($post_id, 'thumbnail', true);

if( isset($thumbnail) && !empty($thumbnail) ):
$html .= '';
endif;

$html .= '<strong><a href="'.$permalink.'" rel="nofollow">'.get_string_limit($post_title,50).'</a></strong> '.get_string_limit($post_content,300).'
<a href="'.$permalink.'" rel="nofollow">"Read more"</a>

';
}
echo $html;
return $coint_i;
}

function theme_twitter_show($count=4)
{
$id = obwp_get_meta(SHORTNAME."_twitter_id");
if(!empty($id))
{
?>

<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/.json?callback=twitterCallback2&count=">
<?php
}
}

]]>