Changeset 373063
- Timestamp:
- 04/14/2011 09:53:03 PM (15 years ago)
- Location:
- gts-translation/trunk
- Files:
-
- 5 edited
-
Gts.php (modified) (1 diff)
-
readme.txt (modified) (5 diffs)
-
wordpress/GtsLinkRewriter.php (modified) (2 diffs)
-
wordpress/GtsPluginWordpress.php (modified) (5 diffs)
-
wordpress/GtsWidgets.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gts-translation/trunk/Gts.php
r370323 r373063 36 36 Plugin Name: GTS Translation 37 37 Plugin URI: http://gts-translation.com/ 38 Description: Th e only translation plugin that provides human translation of your blog content using community translation (crowdsourcing). Use our community of professional translators or use your own internal community. Currently translates from English to French, Italian, German, Spanish, Portuguese, Japanese, and Russian with more to come. All content is cached on your Wordpress database and indexed by search engines.39 Version: 1.1. 538 Description: This plugin is guaranteed to drive more international traffic to your site by providing high quality translation, and SEO of your translated content. 39 Version: 1.1.6 40 40 Author: Steve van Loben Sels 41 41 Author URI: http://gts-translation.com/ -
gts-translation/trunk/readme.txt
r370323 r373063 1 === Plugin Name===1 === GTS Translation Plugin === 2 2 Contributors: stevevls 3 Tags: translate, translation, crowdsourcing 3 Tags: crowdsourcing, translate, translation, translations, translator, blog translator, free translation, language, languages 4 Donate Link: http://www.gts-translation.com/ 4 5 Requires at least: 2.9 5 6 Tested up to: 3.1.1 6 Stable tag: 1.1.5 7 8 The only translation plugin that provides human translation of your blog content using community translation 9 (crowdsourcing). 7 Stable tag: 1.1.6 8 9 This plugin is guaranteed to drive more international traffic to your site by providing high quality translation, and SEO of your translated content. 10 10 11 11 == Description == 12 12 13 The GTS Translation WordPress plugin is the only free solution for human translation of blogs. And since the14 translated content is cached in your Wordpress database, it can be SEO optimized and indexed by search engines. 15 16 Your blog content is initially translated by our translation server. The content is then post-edited by human translators 17 through our online editing system. You can use the GTS community of translators, or you can assign the post-editing to 18 your own community of translators to maintain complete control of the process. 19 20 After you install the GTS Translation plugin, your blog home page is translated, as well as all of the blog posts that 21 appear on the home page. A translation widget is available for any widget-enabled WordPress theme. From this point 22 onward, each time a new blog post is published it is automatically translated into the selected languages. You can 23 choose to publish the translated content immediately (raw MT output), or to only publish the translated content after it 24 has been approved by a moderator. 25 26 Current release supports translating from English to French, Italian, German, Spanish, Portuguese, Japanese and Russian. 27 We're actively working to add more languages! 13 The GTS Translation plugin provides human quality translation by allowing you to combine automatic translation and human post-editing (crowdsourcing). Your blog content is initially translated by our translation server. The content is then post-edited by human translators through our online editing system. You can use the GTS community of translators, or you can assign the post-editing to your own community of translators to maintain complete control of the process. 14 15 When you use the GTS Translation plugin, translated content is cached in your Wordpress database and indexed by search engines. This will increase the traffic to your website and grow your international readership. 16 17 **Features:** 18 19 * Guaranteed to increase your traffic by at least 30% after 2 months; some customers have seen over 100% increase in traffic 20 * Supports over 10 languages 21 * Uses private, secure translation server 22 * Publish translated content immediately or following review 23 * Crowdsourcing: create your own community of translators or use our community 24 * SEO: translates Permalink URL names and meta tags 25 * Custom online, side-by-side editor makes post-editing easy 26 * Translated posts can be retweeted 27 28 28 29 29 == Installation == … … 75 75 = Which languages are supported? = 76 76 * Input: English 77 * Output: French, German, Italian, Spanish, Portuguese, Japanese, and Russian 78 77 * Output: Chinese (Simplified and Traditional), Finnish, French, German, Italian, Japanese, Portuguese, Russian, Spanish, and Swedish. 78 79 We're continually adding new languages, so for the latest list, click [here](http://translate.gts-translation.com/api/supportedLanguages). 79 80 80 81 = What URLs will the translated blogs have? = … … 111 112 112 113 113 = When I switch my blog to Russian, all I see are question marks...what gives?114 = When I switch my blog to Russian, Japanese, Chinese, etc. all I see are question marks...what gives? = 114 115 This happens when the data is stored in MySQL with the wrong character encoding. Execute the following SQL (being sure to 115 116 replace 'wp_' with the prefix specified in wp-config.php if you've changed that value): 116 117 117 ALTER TABLE wp_gts_translated_options CONVERT TO CHARACTER SET 'utf8';118 `ALTER TABLE wp_gts_translated_options CONVERT TO CHARACTER SET 'utf8'; 118 119 ALTER TABLE wp_gts_translated_posts CONVERT TO CHARACTER SET 'utf8'; 119 ALTER TABLE wp_gts_translated_terms CONVERT TO CHARACTER SET 'utf8'; 120 ALTER TABLE wp_gts_translated_terms CONVERT TO CHARACTER SET 'utf8';` 120 121 121 122 Then get in touch with us so that we can help you reload your content. 123 124 = I enabled Chinese language, but hardly any of the links work. What should I do? = 125 In order to work correctly, translations to Chinese require plugin version 1.1.6 or greater. Version 1.1.5 will 126 translate your posts, but won't properly display them. Upgrade using your WP Admin panel, and you'll be good to go. 122 127 123 128 … … 173 178 == Changelog == 174 179 180 = 1.1.6 = 181 * Chinese support : Language pattern matching changes and quoted widget JS array keys. 182 * Added search functionality in translated blogs. 183 175 184 = 1.1.5 = 176 185 * Added support for translation from English to Japanese and Portuguese. … … 248 257 Simply click the "Delete" link in the plugin management window. This will delete all of your translated data, so 249 258 please be careful! 259 260 == Screenshots == 261 262 1. Translation Widget on your blog 263 2. Side-by-side Editor 264 3. Popup Editor 265 4. Crowdsourcing Admin Panel 266 267 == Upgrade Notice == 268 269 So far, the plugin is self-upgrading...if there's something to report later, we'll add it! 250 270 251 271 == Security == -
gts-translation/trunk/wordpress/GtsLinkRewriter.php
r369686 r373063 443 443 if( $wp_rewrite->permalink_structure ) { 444 444 445 $wp_rewrite->add_rewrite_tag('%'.GtsLinkRewriter::$LANG_PARAM.'%', '([a-z]{2})', GtsLinkRewriter::$LANG_PARAM . '=' ); 445 $lang_regex = '(' . GtsPluginWordpress::$LANGUAGE_CODE_REGEX . ')'; 446 $wp_rewrite->add_rewrite_tag('%'.GtsLinkRewriter::$LANG_PARAM.'%', $lang_regex, GtsLinkRewriter::$LANG_PARAM . '=' ); 446 447 447 448 // todo - option-ize and localize this prefix. … … 489 490 unset($newrules[$match]); 490 491 491 $match = preg_replace( '/ (\[a\-z\]\{2\})/', '($1)', $match );492 $match = preg_replace( '/' . preg_quote( $lang_regex ) . '/', '($1)', $match ); 492 493 $params = $params . '>s_lang=$matches[0]'; 493 494 $params = preg_replace_callback( '/\$matches\[(\d+)\]/', array( $this, 'callback_reindex_match_array' ), $params); -
gts-translation/trunk/wordpress/GtsPluginWordpress.php
r369968 r373063 36 36 class GtsPluginWordpress extends GtsPlugin { 37 37 38 // matches standard 2 character ISO codes or the semi-formal 39 // zh-XXX chinese language codes. optional group is non-capturing 40 // so that this doesn't wreak havoc with other regexs it may be 41 // embedded within. 42 static $LANGUAGE_CODE_REGEX = "[a-z]{2}(?:\\-[A-Z]{3})?"; 38 43 39 44 static $TRANSLATE_OPTIONS = array( … … 66 71 // be able to switch off values in there. 67 72 if( get_option( 'permalink_structure') ) { 68 if( preg_match('/\/language\/( [a-z]{2})\//', $_SERVER['REQUEST_URI'], $matches)) {73 if( preg_match('/\/language\/(' . GtsPluginWordpress::$LANGUAGE_CODE_REGEX . ')\//', $_SERVER['REQUEST_URI'], $matches)) { 69 74 $this->theme_language = $matches[1]; 70 75 } … … 237 242 $this->config->plugin_version = GTS_PLUGIN_VERSION; 238 243 $this->save_config(); 239 244 240 245 update_option( GTS_DB_INITIALIZED_OPTION_NAME, true ); 241 246 … … 352 357 353 358 add_filter( 'posts_join', array( $this, 'add_posts_join_criteria' ), 1 ); 359 add_filter( 'posts_search', array( $this, 'add_posts_search_criteria' ), 1); 354 360 } 355 361 … … 410 416 $tp_table = $wpdb->prefix . 'gts_translated_posts'; 411 417 return "$join INNER JOIN $tp_table ON ($tp_table.local_id = $wp_table.id AND $tp_table.language = '". $this->language. "')"; 418 } 419 420 return $join; 421 } 422 423 function add_posts_search_criteria( $join ) { 424 425 if( $join && $this->language ) { 426 $join = preg_replace( '/_posts\.post_title/', '_gts_translated_posts.post_title', $join ); 427 $join = preg_replace( '/_posts\.post_content/', '_gts_translated_posts.post_body', $join ); 412 428 } 413 429 -
gts-translation/trunk/wordpress/GtsWidgets.php
r369686 r373063 92 92 <?php 93 93 foreach ( $languages_with_links as $lang => $link ) { 94 echo " $lang: '$link',\n";94 echo "\"$lang\" : '$link',\n"; 95 95 } 96 96 ?> … … 166 166 if( $is_source ) { 167 167 168 $interesting_part = preg_replace( '/^language\/ [a-z]{2}\/?/', '', $interesting_part);168 $interesting_part = preg_replace( '/^language\/' . GtsPluginWordpress::$LANGUAGE_CODE_REGEX . '\/?/', '', $interesting_part); 169 169 170 170 if( is_tag() && get_query_var( 'tag' ) ) { … … 204 204 $link = $gts_plugin->do_with_language( array( $this, 'callback_get_page_link' ), $lang->code); 205 205 } 206 else if(!preg_match( '/^(language\/) ([a-z]{2})(\/.*)?$/', $interesting_part, $matches ) ) {206 else if(!preg_match( '/^(language\/)' . GtsPluginWordpress::$LANGUAGE_CODE_REGEX . '(\/.*)?$/', $interesting_part, $matches ) ) { 207 207 $link = $home . 'language/' . $lang->code . '/' . $interesting_part; 208 208 }
Note: See TracChangeset
for help on using the changeset viewer.