Plugin Directory

Changeset 1428144


Ignore:
Timestamp:
06/01/2016 08:24:10 AM (9 years ago)
Author:
modeewine
Message:

New version (3.1):

  • Improved code.
  • Tested and optimized compatibility with PHP 7.
Location:
polylang-theme-strings
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • polylang-theme-strings/trunk/js/admin.js

    r1376884 r1428144  
    2727                        html += '<span>' + _this.lng[30] + ': <i><a href="' + _this.attr.urls['polylang_strings'] + '">' + _this.lng[31] + '</a></i></span>';
    2828                        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>';
    3232                        html += '</span>';
    3333
     
    3838            plugins_page: function(){
    3939                var slug = 'polylang-theme-strings';
     40                var pll_slug = 'polylang';
    4041
    4142                var tr = jQuery('' +
     
    4546                '');
    4647
    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)
    4855                {
    4956                    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  
    55    Plugin URI: http://modeewine.com/en-polylang-theme-strings
    66    Description: Automatic scanning of strings translation in the theme and registration of them in Polylang plugin. Extension for Polylang plugin.
    7     Version: 3.0
     7    Version: 3.1
    88    Author: Modeewine
    99    Author URI: http://modeewine.com
     
    1616    {
    1717        static $prefix = 'mw_polylang_strings_';
    18         static $plugin_version = '3.0';
     18        static $plugin_version = '3.1';
    1919        static $pll_f = 'pll_register_string';
    2020        private $paths;
    2121        private $var = array();
    2222
    23         function __construct()
     23        public function __construct()
    2424        {
    2525            $this->Init();
    2626        }
    2727
    28         public function Install()
     28        public static function Install()
    2929        {
    3030            if (!version_compare(phpversion(), '5', '>='))
     
    9090            {
    9191                $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
    9299                $this->Themes_PLL_Strings_Init();
    93100            }
     
    160167        }
    161168
    162         static function Files_Recursive_Get($dir)
     169        public static function Files_Recursive_Get($dir)
    163170        {
    164171            $files = array();
     
    187194        }
    188195
    189         static function Is_PLL_Strings_Settings_Page()
     196        public static function Is_PLL_Strings_Settings_Page()
    190197        {
    191198            if
     
    201208        }
    202209
    203         static function Is_WP_Plugins_Page()
     210        public static function Is_WP_Plugins_Page()
    204211        {
    205212            if (preg_match("/\/plugins.php[^a-z0-9]?/uis", $_SERVER['REQUEST_URI']))
     
    209216        }
    210217
    211         private function Themes_PLL_Strings_Scan()
     218        private static function Themes_PLL_Strings_Scan()
    212219        {
    213220            $themes = wp_get_themes();
  • polylang-theme-strings/trunk/readme.txt

    r1376884 r1428144  
    55Requires at least: 3.8
    66Tested up to: 4.5
    7 Stable tag: 3.0
     7Stable tag: 3.1
    88License: GPL2
    99
     
    1212== Description ==
    1313
    14 = What is «Polylang Theme Strings» and why is he needed?  =
     14= What is «Polylang Theme Strings» and what for is it?  =
    1515
    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:
     16This 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:
    1717
    1818* `pll__('...');`
    1919* `pll_e('...');`
    2020
    21 and adds them to the Polylang registery, after what you can manage the translation of finded strings through 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.
     21and 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.
    2222Don’t forget that in the example are described the PHP-function calls, that is why they have to be inside of PHP-tags.
    2323
    2424= How works «Polylang Theme Strings»? =
    2525
    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 the user the ability to translate these strings.
     26You 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.
    2727
    2828Like 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!
     
    3333
    34341. 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.
     351. Install multilingual plugin «Polylang».
     361. Install the plugin «Polylang Theme Strings».
     371. Activate both plugins via the 'Plugins' menu in WordPress administration panel.
    40381. 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 the user the ability to translate these strings.
     391. 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.
    42401. Learn more in <http://modeewine.com/en-polylang-theme-strings>.
    4341
     
    4745
    4846== Changelog ==
     47
     48= 3.1 (2016-06-01) =
     49
     50* Improved code.
     51* Tested and optimized compatibility with PHP 7.
    4952
    5053= 3.0 (2016-03-23) =
Note: See TracChangeset for help on using the changeset viewer.