Skip to content

Commit

Permalink
Merge branch 'devel' of github.com:transifex/transifex-live-wordpress
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Jackowski committed May 24, 2016
2 parents e322803 + 9ab4c59 commit 934f869
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 28 deletions.
11 changes: 4 additions & 7 deletions includes/admin/transifex-live-integration-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static function options_page() {
}

$transifex_settings = self::load_transifex_settings();

$transifex_settings_settings = $transifex_settings['settings'];

ob_start();
Expand Down Expand Up @@ -105,17 +106,13 @@ static function options_page() {
checked( $settings['static_frontpage_support'], 1 );
$checked_static_frontpage_support = ob_get_clean();

ob_start();
checked( $settings['enable_seo'], 1 );
$checked_enable_seo = ob_get_clean();

// These are used by the template: DO NOT REMOVE - Mjj 2/22/2016
$languages = [ ];
$languages = '';
if ( $settings['transifex_languages'] !== '' ) {
$languages = $settings['transifex_languages'];
}

$languages_regex = [ ];
$languages_regex = '';
if ( $settings['languages_regex'] !== '' ) {
$languages_regex = $settings['languages_regex'];
}
Expand All @@ -130,7 +127,7 @@ static function options_page() {
$language_lookup = $settings['language_lookup'];
}

$language_map = [ ];
$language_map = '';
if ( $settings['language_map'] !== '' ) {
$language_map = $settings['language_map'];
}
Expand Down
5 changes: 3 additions & 2 deletions includes/lib/transifex-live-integration-javascript.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ class Transifex_Live_Integration_Javascript {
* Public constructor, sets local settings
* @param array $settings Associative array of plugin settings.
*/
public function __construct( $settings ) {
public function __construct( $settings, $live_settings ) {
Plugin_Debug::logTrace();
$this->live_settings['api_key'] = $settings['api_key'];
$this->live_settings = $live_settings; // set defaults
$this->live_settings['api_key'] = $settings['api_key']; // add api key
$this->lang = false;
$this->source_language = $settings['source_language'];
$this->language_map = $settings['language_map'];
Expand Down
19 changes: 10 additions & 9 deletions includes/transifex-live-integration-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ static function get_options_text( $key ) {
*/
static function transifex_settings() {
return [
'settings' => null,
'picker' => 'no-picker',
'domain' => 'wpliveplugin.onpressidium.com',
'ignore_tags' => [ ],
'autocollect' => false,
'parse_attr' => [ ],
'dynamic' => false,
'detectlang' => false,
'ignore_class' => [ ]
'settings' => '',
//'picker' => 'no-picker',
//'domain' => '',
//'ignore_tags' => [ ],
//'autocollect' => false,
//'parse_attr' => [ ],
//'dynamic' => false,
//'detectlang' => false,
//'ignore_class' => [ ],
'wp' => true
];
}

Expand Down
4 changes: 2 additions & 2 deletions includes/transifex-live-integration-static-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static function create_hreflang( $settings, $rewrite_options ) {
* @return object/false Returns new onject or false
*/

static function create_live_snippet( $settings ) {
static function create_live_snippet( $settings, $live_settings ) {
Plugin_Debug::logTrace();

if ( !isset( $settings['api_key'] ) ) {
Expand All @@ -50,7 +50,7 @@ static function create_live_snippet( $settings ) {
}

include_once TRANSIFEX_LIVE_INTEGRATION_DIRECTORY_BASE . '/includes/lib/transifex-live-integration-javascript.php';
return new Transifex_Live_Integration_Javascript( $settings );
return new Transifex_Live_Integration_Javascript( $settings, $live_settings );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,6 @@ Patch for Prerender logic
Added additional Prerender options for caching

= 1.3.3 =
A few minor fixes. Revised admin UI
A few minor fixes. Revised admin UI

= 1.3.4 =
8 changes: 5 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Name: Transifex Live Translation Plugin
Contributors: txmatthew, ThemeBoy, brooksx
Tags: transifex, translate, translations, localize, localise, localization, localisation, multilingual, t9n, l10n, i18n, language, switcher, live, translation, translator
Requires at least: 3.5.2
Tested up to: 4.5
Stable tag: 1.3.3
Tested up to: 4.5.2
Stable tag: 1.3.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -123,4 +123,6 @@ Patch for Prerender logic
Added additional Prerender options for caching

= 1.3.3 =
A few minor fixes. Revised admin UI
A few minor fixes. Revised admin UI

= 1.3.4 =
3 changes: 2 additions & 1 deletion transifex-live-integration-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static function do_plugin( $is_admin, $version ) {

$settings = Transifex_Live_Integration_Defaults::settings();
}
$live_settings = Transifex_Live_Integration_Defaults::transifex_settings();
$debug_mode = ($settings['debug']) ? true : false;

require_once TRANSIFEX_LIVE_INTEGRATION_DIRECTORY_BASE . '/includes/common/plugin-debug.php';
Expand Down Expand Up @@ -71,7 +72,7 @@ static function do_plugin( $is_admin, $version ) {

add_filter( 'query_vars', [ 'Transifex_Live_Integration_Util', 'query_vars_hook' ] );

$live_snippet = Transifex_Live_Integration_Static_Factory::create_live_snippet( $settings );
$live_snippet = Transifex_Live_Integration_Static_Factory::create_live_snippet( $settings, $live_settings );
if ( $live_snippet ) {
// We need to wait until wp is setup to retrieve query var
add_action( 'wp', [ $live_snippet, 'wp_hook' ] );
Expand Down
6 changes: 3 additions & 3 deletions transifex-live-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*
* @link http://docs.transifex.com/developer/integrations/wordpress
* @package TransifexLiveIntegration
* @version 1.3.3
* @version 1.3.4
*
* @wordpress-plugin
* Plugin Name: Transifex Live Translation Plugin
* Plugin URI: http://docs.transifex.com/developer/integrations/wordpress
* Description: Translate your WordPress website or blog without the usual complex setups.
* Version: 1.3.3
* Version: 1.3.4
* License: GNU General Public License
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: transifex-live-integration
Expand Down Expand Up @@ -75,7 +75,7 @@
}

define( 'LANG_PARAM', 'lang' );
$version = '1.3.3';
$version = '1.3.4';

require_once( dirname( __FILE__ ) . '/transifex-live-integration-main.php' );
Transifex_Live_Integration::do_plugin( is_admin(), $version );

0 comments on commit 934f869

Please sign in to comment.