WPtouch in french – update 1.9.9.6
A new version again… The translation for the WPtouch 1.9.9.6 update is available ! You can download the language file.
A new version again… The translation for the WPtouch 1.9.9.6 update is available ! You can download the language file.
The translation for the WPtouch 1.9.9.3 update is available ! You can download the language file.
WPML 1.7.1 is online. This version is now properly working for the function bloginfo(‘home’) : then my post “how-to” patch WPML to manage search engine and multi-language is not necessary any more ! All is working out of the box.
The new WPtouch 1.9.8.3 is just released… but it just removes some bugs : there is no new string inside. Then you can use the french translation file for the 1.9.8.1 version without any modification.
The translation for the WPtouch 1.9.8.1 update is available ! You can download the language file.
It stays some sentences not managed to be translated… By exemple, the “Search…” wich appears when you click on the “Search” button in the WPtouch menu. To solve this, you have just to modify the file wp-content/plugins/wptouch/themes/default/header.php and replace the line
<input type="text" value="Search..."
onfocus="if (this.value == "Search...")
{this.value = ''}" name="s" id="s" />
by
<input type="text" value="<?php _e('Search...', "wptouch"); ?>"
onfocus="if (this.value == "<?php _e('Search...', "wptouch"); ?>")
{this.value = ''}" name="s" id="s" />
If you see something else not properly translated in WPtouch, thanks to alert me !
Finaly, if you manage your website with more than one language, then I suggest that you modify the file wp-content/plugins/wptouch/themes/core/core-functions.php to update the SQL request below in the bnc_get_ordered_cat_list() function :
$sql = "select * from " . $table_prefix .
"term_taxonomy inner join " . $table_prefix .
"terms on " . $table_prefix .
"term_taxonomy.term_id = " . $table_prefix .
"terms.term_id where taxonomy =
'category' order by count desc";
replaced by
$sql = "SELECT " . $table_prefix . "terms.term_id, count,
CASE WHEN INSTR( name, '@' ) >0 THEN
TRIM( LEFT( name, INSTR( name, '@' ) -1 ) ) ELSE
TRIM( name ) END AS name FROM " . $table_prefix .
"icl_translations INNER JOIN " . $table_prefix .
"term_taxonomy ON " . $table_prefix .
"term_taxonomy.term_taxonomy_id = " . $table_prefix .
"icl_translations.element_id INNER JOIN " .
$table_prefix . "terms ON " . $table_prefix .
"term_taxonomy.term_id = " . $table_prefix .
"terms.term_id WHERE element_type = 'category'
AND taxonomy = 'category' AND
language_code = '" . get_bloginfo('short_language') .
"' ORDER BY count DESC";
Then your WPtouch “Category” will display only the categories for the current language…
To test iPhone WebApp on Linux we don’t have Safari…
We can use Safari for Windows with Wine, or Safari in a Windows virtual machine with VMWare Server or VirtualBox…
But we can also simply use a browser with the same core engine than Safari ie Webkit : Epiphany ou Chromium. Then we have just to change the user-agent to forge a fake Safari on iPhone. If you search on Google, you’ll find very exotic solution : someone uses hexadecimal editor to modify the Chromium binary files… like using an atomic bomb against a fly) : the solution is much easier, you have just to pass through the –user-agent parameter to chromium like this :
chromium-browser --user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; fr-fr) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16"
The translation for the WPtouch 1.9.5 update is available ! You can download the language file.
A little tip to secure your Wordpress blog (you can use it with another CMS indeed) : just put a .htaccess into you admin folder : for Wordpress it’s in wp-admin
Example .htaccess
AuthUserFile /dev/null AuthGroupFile /dev/null AuthName "Access Control" AuthType Basic <LIMIT GET> order deny,allow deny from all # whitelist home IP address allow from my.ip.at.home # whitelist work IP address allow from my.ip.at.work </LIMIT>
And of course, you change this file with your own IP addresses…
Sometimes it happens we want to create his own .deb package from the sources repository (e.g. when you like to use the last up-to-date version and the binary package doesn’t exist…)
It’s very easy if you follow the rules in the good order
You know the way now…
If you are using Wordpress and the WPML plugin to manage your web site in multi language, you have surely noticed that when a visitor uses the search engine, Wordpress displays the result list of the default language and not of the language currently used by the visitor…
To upgrade this feature, I’ve done a little patch… It’s a quick and dirty one but it works (you can easily optimise this by using a function to overload the default behavior of Wordpress instead of directly modifying the standard Wordpress files (and loosing your modification during the next upgrade…)
Update the file wp-includes/general-template.php for the function get_bloginfo like this :
case 'short_language':
$output = get_locale();
$short_language = explode("_", $output);
$output = $short_language[0];
break;
And the on your theme (e.g. iNove in wp-content/themes/inove/templates/header.php file) :
You just have to modify the form like this :
<form action="<?php bloginfo('home'); ?>/<?php bloginfo('short_language'); ?>/"
method="get">
Have fun with Wordpress and WPML !
ps : you can also modify the links to your title/home to avoid switching language when a user click on the logo
<h1 id="title">
<a href="<?php bloginfo('url'); ?>/<?php bloginfo('short_language'); ?>/">
<?php bloginfo('name'); ?>
</a>
</h1>
and for the breadcrumbs…
<a title="<?php _e('Home', 'inove'); ?>"
href="<?php echo get_settings('home'); ?>/<?php bloginfo('short_language'); ?>/">
<?php _e('Home', 'inove'); ?>
</a>
By the way, the idea comes from this thread…