Changeset 1428144
- Timestamp:
- 06/01/2016 08:24:10 AM (9 years ago)
- Location:
- polylang-theme-strings
- Files:
-
- 10 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
polylang-theme-strings/trunk/js/admin.js
r1376884 r1428144 27 27 html += '<span>' + _this.lng[30] + ': <i><a href="' + _this.attr.urls['polylang_strings'] + '">' + _this.lng[31] + '</a></i></span>'; 28 28 html += '<span class="links">'; 29 html += '<a href=" //modeewine.com/en-polylang-theme-strings" target="_blank">' + _this.lng[40] + '</a>';30 html += '<a href=" //modeewine.com/en-donation" target="_blank">' + _this.lng[50] + '</a>';31 html += '<a href=" //wordpress.org/support/view/plugin-reviews/polylang-theme-strings" target="_blank">' + _this.lng[60] + '</a>';29 html += '<a href="http://modeewine.com/en-polylang-theme-strings" target="_blank">' + _this.lng[40] + '</a>'; 30 html += '<a href="http://modeewine.com/en-donation" target="_blank">' + _this.lng[50] + '</a>'; 31 html += '<a href="https://wordpress.org/support/view/plugin-reviews/polylang-theme-strings" target="_blank">' + _this.lng[60] + '</a>'; 32 32 html += '</span>'; 33 33 … … 38 38 plugins_page: function(){ 39 39 var slug = 'polylang-theme-strings'; 40 var pll_slug = 'polylang'; 40 41 41 42 var tr = jQuery('' + … … 45 46 ''); 46 47 47 if (tr.length) 48 var pll_tr = jQuery('' + 49 '#' + pll_slug + '.active' + // For WP < 4.5 50 ', ' + 51 '[data-slug="' + pll_slug + '"].active' + // For WP >= 4.5 52 ''); 53 54 if (tr.length && pll_tr.length) 48 55 { 49 56 jQuery('<div class="link-pll-strings"><a href="' + _this.attr.urls['polylang_strings'] + '">' + _this.lng[70] + '</a></div>').insertAfter(jQuery('.plugin-description', tr)); -
polylang-theme-strings/trunk/mw-polylang-theme-strings.php
r1376884 r1428144 5 5 Plugin URI: http://modeewine.com/en-polylang-theme-strings 6 6 Description: Automatic scanning of strings translation in the theme and registration of them in Polylang plugin. Extension for Polylang plugin. 7 Version: 3. 07 Version: 3.1 8 8 Author: Modeewine 9 9 Author URI: http://modeewine.com … … 16 16 { 17 17 static $prefix = 'mw_polylang_strings_'; 18 static $plugin_version = '3. 0';18 static $plugin_version = '3.1'; 19 19 static $pll_f = 'pll_register_string'; 20 20 private $paths; 21 21 private $var = array(); 22 22 23 function __construct()23 public function __construct() 24 24 { 25 25 $this->Init(); 26 26 } 27 27 28 public function Install()28 public static function Install() 29 29 { 30 30 if (!version_compare(phpversion(), '5', '>=')) … … 90 90 { 91 91 $this->Themes_PLL_Strings_Scan(); 92 93 if (!pll_default_language()) 94 { 95 wp_redirect(admin_url('options-general.php?page=mlang')); 96 exit; 97 } 98 92 99 $this->Themes_PLL_Strings_Init(); 93 100 } … … 160 167 } 161 168 162 static function Files_Recursive_Get($dir)169 public static function Files_Recursive_Get($dir) 163 170 { 164 171 $files = array(); … … 187 194 } 188 195 189 static function Is_PLL_Strings_Settings_Page()196 public static function Is_PLL_Strings_Settings_Page() 190 197 { 191 198 if … … 201 208 } 202 209 203 static function Is_WP_Plugins_Page()210 public static function Is_WP_Plugins_Page() 204 211 { 205 212 if (preg_match("/\/plugins.php[^a-z0-9]?/uis", $_SERVER['REQUEST_URI'])) … … 209 216 } 210 217 211 private function Themes_PLL_Strings_Scan()218 private static function Themes_PLL_Strings_Scan() 212 219 { 213 220 $themes = wp_get_themes(); -
polylang-theme-strings/trunk/readme.txt
r1376884 r1428144 5 5 Requires at least: 3.8 6 6 Tested up to: 4.5 7 Stable tag: 3. 07 Stable tag: 3.1 8 8 License: GPL2 9 9 … … 12 12 == Description == 13 13 14 = What is «Polylang Theme Strings» and wh y is he needed? =14 = What is «Polylang Theme Strings» and what for is it? = 15 15 16 This plugin gives additional features to the plugin Polylang. It automatically scans all templates files and scripts of the active WP theme for available strings that can be translated , for example:16 This plugin gives additional features to the plugin Polylang. It automatically scans all templates files and scripts of the active WP theme for available strings that can be translated. For example: 17 17 18 18 * `pll__('...');` 19 19 * `pll_e('...');` 20 20 21 and adds them to the Polylang registery, after what you can manage the translation of finded strings throughthe administration panel. It will make your life easier for the development of multilanguage’s projects, because you will not need to enter the needed strings to translate manually – the plugin will do all the work for you.21 and adds them to the Polylang registery, after what you can manage the translation of finded strings using the administration panel. It will make your life easier for the development of multilanguage’s projects, because you will not need to enter the needed strings to translate manually – the plugin will do all the work for you. 22 22 Don’t forget that in the example are described the PHP-function calls, that is why they have to be inside of PHP-tags. 23 23 24 24 = How works «Polylang Theme Strings»? = 25 25 26 You have to install the plugins «Polylang» and «Polylang Theme Strings» on your multilanguage WordPress CMS project and they have to be both active. When you are in the settings of plugin (Polylang) in the tab «Strings translation» the «Polylang Theme Strings» scans automatically the active theme of your project, find all the code strings that needed to be translated, adds them to the register and display them on that page to give theuser the ability to translate these strings.26 You have to install the plugins «Polylang» and «Polylang Theme Strings» on your multilanguage WordPress CMS project and they must be both active. When you are in the settings of plugin (Polylang) in the tab «Strings translation» the «Polylang Theme Strings» scans automatically the active theme of your project, find all the code strings that needed to be translated, adds them to the register, displays them on that page and gives to user the ability to translate these strings. 27 27 28 28 Like you can see, the «Polylang Theme Strings» is perfectly integrate with the «Polylang» plugin and works in automatically mode – it is comfortable, simple, and useful! … … 33 33 34 34 1. Make sure you are using WordPress 3.8 or later and that your server is running PHP 5.0 or later. 35 1. Install multilingual plugin «Polylang» and activate it. 36 1. Download the plugin «Polylang Theme Strings». 37 1. Extract all the files. 38 1. Upload everything (keeping the directory structure) to the `/wp-content/plugins/` directory. 39 1. Activate the plugin through the 'Plugins' menu in WordPress. 35 1. Install multilingual plugin «Polylang». 36 1. Install the plugin «Polylang Theme Strings». 37 1. Activate both plugins via the 'Plugins' menu in WordPress administration panel. 40 38 1. Go to the languages (Polylang) settings page. 41 1. When you are in the settings of plugin (Polylang) in the tab «Strings translation» the «Polylang Theme Strings» scans automatically the active theme of your project, find all the code strings that needed to be translated, adds them to the register and display them on that page to give theuser the ability to translate these strings.39 1. When you are in «Strings translation» tab of plugin settings (Polylang) – «Polylang Theme Strings» starts scan the active theme of your project automatically, it finds all the code strings that needed to be translated, adds them to the register, displays them on that page and gives to user the ability to translate these strings. 42 40 1. Learn more in <http://modeewine.com/en-polylang-theme-strings>. 43 41 … … 47 45 48 46 == Changelog == 47 48 = 3.1 (2016-06-01) = 49 50 * Improved code. 51 * Tested and optimized compatibility with PHP 7. 49 52 50 53 = 3.0 (2016-03-23) =
Note: See TracChangeset
for help on using the changeset viewer.