Version Description
Download this release
Release Info
Developer | oferwald |
Plugin | Transposh WordPress Translation |
Version | 0.1.7 |
Comparing to | |
See all releases |
Code changes from version 0.1.6 to 0.1.7
- core/globals.php +1 -1
- core/parser.php +1 -1
- core/utils.php +11 -1
- readme.txt +5 -2
- transposh.php +13 -10
- transposh_admin.php +2 -2
- transposh_db.php +2 -2
- transposh_widget.php +5 -5
core/globals.php
CHANGED
@@ -31,7 +31,7 @@ $home_url;
|
|
31 |
$home_url_quoted;
|
32 |
|
33 |
//The url pointing to the base of the plugin. Used for generating urls to resources
|
34 |
-
$
|
35 |
|
36 |
//The language to which the current page will be translated to.
|
37 |
$lang;
|
31 |
$home_url_quoted;
|
32 |
|
33 |
//The url pointing to the base of the plugin. Used for generating urls to resources
|
34 |
+
$tr_plugin_url;
|
35 |
|
36 |
//The language to which the current page will be translated to.
|
37 |
$lang;
|
core/parser.php
CHANGED
@@ -910,7 +910,7 @@ function update_translated_page($start, $end, $translated_text)
|
|
910 |
*/
|
911 |
function process_anchor_tag($start, $end)
|
912 |
{
|
913 |
-
global $home_url, $
|
914 |
|
915 |
$href = get_attribute($start, $end, 'href');
|
916 |
|
910 |
*/
|
911 |
function process_anchor_tag($start, $end)
|
912 |
{
|
913 |
+
global $home_url, $lang, $is_edit_mode, $enable_permalinks_rewrite;
|
914 |
|
915 |
$href = get_attribute($start, $end, 'href');
|
916 |
|
core/utils.php
CHANGED
@@ -16,13 +16,14 @@
|
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
*/
|
18 |
|
19 |
-
|
20 |
/**
|
21 |
*
|
22 |
* Contains utility functions which are shared across the plugin.
|
23 |
*
|
24 |
*/
|
25 |
|
|
|
|
|
26 |
|
27 |
/*
|
28 |
* Update the given url to include language params.
|
@@ -35,7 +36,16 @@ function rewrite_url_lang_param($url, $lang, $is_edit, $use_params_only=FALSE)
|
|
35 |
{
|
36 |
global $home_url, $home_url_quoted, $enable_permalinks_rewrite;
|
37 |
|
|
|
|
|
|
|
|
|
38 |
$url = html_entity_decode($url, ENT_NOQUOTES);
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
if(!$enable_permalinks_rewrite)
|
41 |
{
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
*/
|
18 |
|
|
|
19 |
/**
|
20 |
*
|
21 |
* Contains utility functions which are shared across the plugin.
|
22 |
*
|
23 |
*/
|
24 |
|
25 |
+
require_once("constants.php");
|
26 |
+
|
27 |
|
28 |
/*
|
29 |
* Update the given url to include language params.
|
36 |
{
|
37 |
global $home_url, $home_url_quoted, $enable_permalinks_rewrite;
|
38 |
|
39 |
+
//
|
40 |
+
//
|
41 |
+
//
|
42 |
+
|
43 |
$url = html_entity_decode($url, ENT_NOQUOTES);
|
44 |
+
$url = str_replace('&', '&', $url);
|
45 |
+
|
46 |
+
|
47 |
+
//remove prev lang and edit params?
|
48 |
+
$url = preg_replace("/(" . LANG_PARAM . "|" . EDIT_PARAM . ")=[^&]*/i", "", $url);
|
49 |
|
50 |
if(!$enable_permalinks_rewrite)
|
51 |
{
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://transposh.org/
|
|
4 |
Tags: translation, widget, filter, bilingual, multilingual, transposh, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.7.1
|
7 |
-
Stable tag: 0.1.
|
8 |
|
9 |
Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
|
10 |
|
@@ -91,9 +91,12 @@ Also - please take extra care to validate your html, adding extra tags that are
|
|
91 |
5. Widget style selection
|
92 |
|
93 |
== Release notes ==
|
|
|
|
|
|
|
94 |
* 2009/05/05 - 0.1.6
|
95 |
* Fix a problem with translating Traditional Chinese and Portuguese (thanks Fernanda)
|
96 |
-
* Fixed several issues with html comment tags (thanks [ekerem](http://www.top100freesoftware.com))
|
97 |
* 2009/05/03 - 0.1.5
|
98 |
* Improved end-user experience by switching order of posts and page changes
|
99 |
* 2009/04/30 - 0.1.4
|
4 |
Tags: translation, widget, filter, bilingual, multilingual, transposh, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.7.1
|
7 |
+
Stable tag: 0.1.7
|
8 |
|
9 |
Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
|
10 |
|
91 |
5. Widget style selection
|
92 |
|
93 |
== Release notes ==
|
94 |
+
* 2009/05/07 - 0.1.7
|
95 |
+
* Fix issues with IIS/Windows/Non standard installations (thanks [Fabrizio](http://www.sulmare.it/))
|
96 |
+
* Fixed namespace conflict with more plugins (For example - Lazyest Gallery)
|
97 |
* 2009/05/05 - 0.1.6
|
98 |
* Fix a problem with translating Traditional Chinese and Portuguese (thanks Fernanda)
|
99 |
+
* Fixed several issues with html comment tags (thanks [ekerem](http://www.top100freesoftware.com/))
|
100 |
* 2009/05/03 - 0.1.5
|
101 |
* Improved end-user experience by switching order of posts and page changes
|
102 |
* 2009/04/30 - 0.1.4
|
transposh.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin URI: http://transposh.org/
|
5 |
Description: Translation filter for WordPress, After enabling please set languages at the <a href="options-general.php?page=Transposh">the options page</a> Want to help? visit our development site at <a href="http://trac.transposh.org/">trac.transposh.org</a>.
|
6 |
Author: Team Transposh
|
7 |
-
Version: 0.1.
|
8 |
Author URI: http://transposh.org/
|
9 |
License: GPL (http://www.gnu.org/licenses/gpl.txt)
|
10 |
*/
|
@@ -40,7 +40,7 @@ $admin_msg;
|
|
40 |
*/
|
41 |
function process_page(&$buffer) {
|
42 |
|
43 |
-
global $wp_query, $tr_page, $page, $
|
44 |
|
45 |
$start_time = microtime(TRUE);
|
46 |
|
@@ -88,12 +88,15 @@ function process_page(&$buffer) {
|
|
88 |
*/
|
89 |
function init_global_vars()
|
90 |
{
|
91 |
-
global $home_url, $home_url_quoted, $
|
92 |
|
93 |
$home_url = get_option('home');
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
97 |
$home_url_quoted = preg_quote($home_url);
|
98 |
$home_url_quoted = preg_replace("/\//", "\\/", $home_url_quoted);
|
99 |
|
@@ -344,7 +347,7 @@ function get_plugin_name()
|
|
344 |
* Add custom css, i.e. transposh.css
|
345 |
*/
|
346 |
function add_transposh_css() {
|
347 |
-
global $
|
348 |
|
349 |
if(!is_editing_permitted() && !is_auto_translate_permitted())
|
350 |
{
|
@@ -352,7 +355,7 @@ function add_transposh_css() {
|
|
352 |
return;
|
353 |
}
|
354 |
//include the transposh.css
|
355 |
-
wp_enqueue_style("transposh","$
|
356 |
wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/ui-lightness/jquery-ui.css",array(),'1.0');
|
357 |
|
358 |
}
|
@@ -362,7 +365,7 @@ function add_transposh_css() {
|
|
362 |
* version of the page.
|
363 |
*/
|
364 |
function add_transposh_js() {
|
365 |
-
global $
|
366 |
|
367 |
$enable_auto_translate = is_auto_translate_permitted();
|
368 |
if(!is_editing_permitted() && !$enable_auto_translate)
|
@@ -396,7 +399,7 @@ function add_transposh_js() {
|
|
396 |
wp_deregister_script('jquery');
|
397 |
wp_enqueue_script("jquery","http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",array(),'1.3.2');
|
398 |
wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1');
|
399 |
-
wp_enqueue_script("transposh","$
|
400 |
}
|
401 |
}
|
402 |
|
4 |
Plugin URI: http://transposh.org/
|
5 |
Description: Translation filter for WordPress, After enabling please set languages at the <a href="options-general.php?page=Transposh">the options page</a> Want to help? visit our development site at <a href="http://trac.transposh.org/">trac.transposh.org</a>.
|
6 |
Author: Team Transposh
|
7 |
+
Version: 0.1.7
|
8 |
Author URI: http://transposh.org/
|
9 |
License: GPL (http://www.gnu.org/licenses/gpl.txt)
|
10 |
*/
|
40 |
*/
|
41 |
function process_page(&$buffer) {
|
42 |
|
43 |
+
global $wp_query, $tr_page, $page, $lang, $is_edit_mode;
|
44 |
|
45 |
$start_time = microtime(TRUE);
|
46 |
|
88 |
*/
|
89 |
function init_global_vars()
|
90 |
{
|
91 |
+
global $home_url, $home_url_quoted, $tr_plugin_url, $enable_permalinks_rewrite, $wp_rewrite;
|
92 |
|
93 |
$home_url = get_option('home');
|
94 |
+
// Handle windows ('C:\wordpress')
|
95 |
+
$local_dir = preg_replace("/\\\\/", "/", dirname(__FILE__));
|
96 |
+
// Get last directory name
|
97 |
+
$local_dir = preg_replace("/.*\//", "", $local_dir);
|
98 |
+
$tr_plugin_url= WP_PLUGIN_URL .'/'. $local_dir;
|
99 |
+
|
100 |
$home_url_quoted = preg_quote($home_url);
|
101 |
$home_url_quoted = preg_replace("/\//", "\\/", $home_url_quoted);
|
102 |
|
347 |
* Add custom css, i.e. transposh.css
|
348 |
*/
|
349 |
function add_transposh_css() {
|
350 |
+
global $tr_plugin_url;
|
351 |
|
352 |
if(!is_editing_permitted() && !is_auto_translate_permitted())
|
353 |
{
|
355 |
return;
|
356 |
}
|
357 |
//include the transposh.css
|
358 |
+
wp_enqueue_style("transposh","$tr_plugin_url/css/transposh.css",array(),'0.1.7');
|
359 |
wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/ui-lightness/jquery-ui.css",array(),'1.0');
|
360 |
|
361 |
}
|
365 |
* version of the page.
|
366 |
*/
|
367 |
function add_transposh_js() {
|
368 |
+
global $tr_plugin_url, $wp_query, $lang, $home_url, $enable_auto_translate;
|
369 |
|
370 |
$enable_auto_translate = is_auto_translate_permitted();
|
371 |
if(!is_editing_permitted() && !$enable_auto_translate)
|
399 |
wp_deregister_script('jquery');
|
400 |
wp_enqueue_script("jquery","http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",array(),'1.3.2');
|
401 |
wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1');
|
402 |
+
wp_enqueue_script("transposh","$tr_plugin_url/js/transposh.js?post_url=$post_url{$edit_mode}&lang={$lang}&prefix=".SPAN_PREFIX,array("jquery"),'0.1.7');
|
403 |
}
|
404 |
}
|
405 |
|
transposh_admin.php
CHANGED
@@ -70,7 +70,7 @@ function transposh_admin_page()
|
|
70 |
*/
|
71 |
function insert_supported_langs()
|
72 |
{
|
73 |
-
global $languages, $
|
74 |
|
75 |
echo '<script type="text/javascript">'.
|
76 |
'function chbx_change(lang)'.
|
@@ -106,7 +106,7 @@ function insert_supported_langs()
|
|
106 |
|
107 |
$i++;
|
108 |
|
109 |
-
echo "<td><img src=\"$
|
110 |
echo '<td align="center"> <input type="checkbox" id="' . $code .'_view" name="' .
|
111 |
$code . '_view" onchange="chbx_change(\'' . $code . '\')" ' . is_viewable($code) . '/></td>';
|
112 |
echo "\n";
|
70 |
*/
|
71 |
function insert_supported_langs()
|
72 |
{
|
73 |
+
global $languages, $tr_plugin_url;
|
74 |
|
75 |
echo '<script type="text/javascript">'.
|
76 |
'function chbx_change(lang)'.
|
106 |
|
107 |
$i++;
|
108 |
|
109 |
+
echo "<td><img src=\"$tr_plugin_url/img/flags/$flag.png\" alt=\"\"/> $language</td>";
|
110 |
echo '<td align="center"> <input type="checkbox" id="' . $code .'_view" name="' .
|
111 |
$code . '_view" onchange="chbx_change(\'' . $code . '\')" ' . is_viewable($code) . '/></td>';
|
112 |
echo "\n";
|
transposh_db.php
CHANGED
@@ -139,7 +139,7 @@ function update_translation()
|
|
139 |
$original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
|
140 |
|
141 |
//add our own custom header - so we will know that we got here
|
142 |
-
header("Transposh: ver-0.1.
|
143 |
|
144 |
list($translated_text, $old_source) = fetch_translation($original, $lang);
|
145 |
if ($translated_text) {
|
@@ -243,7 +243,7 @@ function get_translation_history($token, $lang)
|
|
243 |
$original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
|
244 |
|
245 |
//add our own custom header - so we will know that we got here
|
246 |
-
header("Transposh: ver-0.1.
|
247 |
|
248 |
$query = "SELECT translated, translated_by, timestamp, source, user_login ".
|
249 |
"FROM $table_name ".
|
139 |
$original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
|
140 |
|
141 |
//add our own custom header - so we will know that we got here
|
142 |
+
header("Transposh: ver-0.1.7 db_version-". DB_VERSION);
|
143 |
|
144 |
list($translated_text, $old_source) = fetch_translation($original, $lang);
|
145 |
if ($translated_text) {
|
243 |
$original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
|
244 |
|
245 |
//add our own custom header - so we will know that we got here
|
246 |
+
header("Transposh: ver-0.1.7 db_version-". DB_VERSION);
|
247 |
|
248 |
$query = "SELECT translated, translated_by, timestamp, source, user_login ".
|
249 |
"FROM $table_name ".
|
transposh_widget.php
CHANGED
@@ -82,10 +82,10 @@ function transposh_widget_init()
|
|
82 |
* Add custom css, i.e. transposh.css
|
83 |
*/
|
84 |
function add_transposh_widget_css() {
|
85 |
-
global $
|
86 |
|
87 |
//include the transposh_widget.css
|
88 |
-
wp_enqueue_style("transposh_widget","$
|
89 |
|
90 |
}
|
91 |
|
@@ -95,7 +95,7 @@ function add_transposh_widget_css() {
|
|
95 |
function transposh_widget($args)
|
96 |
{
|
97 |
|
98 |
-
global $languages, $wp_query, $
|
99 |
extract($args);
|
100 |
|
101 |
$page_url = ($_SERVER['HTTPS'] == 'on' ?
|
@@ -113,7 +113,7 @@ function transposh_widget($args)
|
|
113 |
|
114 |
$is_showing_languages = FALSE;
|
115 |
//TODO: improve this shortening
|
116 |
-
$plugpath = parse_url($
|
117 |
|
118 |
echo $before_widget . $before_title . __("Translation") . $after_title;
|
119 |
|
@@ -204,7 +204,7 @@ function transposh_widget($args)
|
|
204 |
|
205 |
echo "</form>";
|
206 |
//echo "<button onClick=\"do_auto_translate();\">translate all</button>";
|
207 |
-
echo "<div id=\"".SPAN_PREFIX."credit\">by <a href=\"http://transposh.org\"><img src=\"$plugpath/img/tplogo.png\" title=\"Transposh\" alt=\"Transposh\"/></a></div>";
|
208 |
echo $after_widget;
|
209 |
}
|
210 |
|
82 |
* Add custom css, i.e. transposh.css
|
83 |
*/
|
84 |
function add_transposh_widget_css() {
|
85 |
+
global $tr_plugin_url;
|
86 |
|
87 |
//include the transposh_widget.css
|
88 |
+
wp_enqueue_style("transposh_widget","$tr_plugin_url/css/transposh_widget.css",array(),'0.1.7');
|
89 |
|
90 |
}
|
91 |
|
95 |
function transposh_widget($args)
|
96 |
{
|
97 |
|
98 |
+
global $languages, $wp_query, $tr_plugin_url,$lang;
|
99 |
extract($args);
|
100 |
|
101 |
$page_url = ($_SERVER['HTTPS'] == 'on' ?
|
113 |
|
114 |
$is_showing_languages = FALSE;
|
115 |
//TODO: improve this shortening
|
116 |
+
$plugpath = parse_url($tr_plugin_url, PHP_URL_PATH);
|
117 |
|
118 |
echo $before_widget . $before_title . __("Translation") . $after_title;
|
119 |
|
204 |
|
205 |
echo "</form>";
|
206 |
//echo "<button onClick=\"do_auto_translate();\">translate all</button>";
|
207 |
+
echo "<div id=\"".SPAN_PREFIX."credit\">by <a href=\"http://transposh.org\"><img src=\"$plugpath/img/tplogo.png\" style=\"padding:1px;border:0px\" title=\"Transposh\" alt=\"Transposh\"/></a></div>";
|
208 |
echo $after_widget;
|
209 |
}
|
210 |
|