[wp-polyglots] plugin translation

Ralf Schmitt ralf.schmitt at schlund.de
Mon Aug 7 08:00:34 GMT 2006


Hi,

here my patch against '/wp-admin/admin-functions.php' (2.0.4)
to load a locale dependent plugin description.

Any better patches are welcome!

regards 

ralf

 function get_plugin_data($plugin_file) {
+    global $locale;
	$plugin_data = implode('', file($plugin_file));
        preg_match("|Plugin Name:(.*)|i", $plugin_data, $plugin_name);
        preg_match("|Plugin URI:(.*)|i", $plugin_data, $plugin_uri);
-       preg_match("|Description:(.*)|i", $plugin_data, $description);
+    if (!preg_match("|Description_".$locale.":(.*)|i", $plugin_data,
$description))
+        preg_match("|Description:(.*)|i", $plugin_data, $description);


More information about the wp-polyglots mailing list