Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-jacob committed Oct 2, 2024
2 parents f668d37 + ac33411 commit 7d1f19c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
6 changes: 6 additions & 0 deletions data.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ function wplng_data_json_to_translate() {
array( 'wc_country_select_params', 'i18n_searching' ),
array( 'wc_address_i18n_params', 'i18n_required_text' ),
array( 'wc_address_i18n_params', 'i18n_optional_text' ),

// Plugin : YITH
array( 'yith_wcwl_l10n', 'labels', 'cookie_disabled' ),

// Plugin : WF Cookie Consent
array( 'wfCookieConsentSettings', 'wf_cookietext' ),
array( 'wfCookieConsentSettings', 'wf_dismisstext' ),
array( 'wfCookieConsentSettings', 'wf_linktext' ),
)
);
}
Expand Down
8 changes: 4 additions & 4 deletions inc/parser/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ function wplng_parse_js( $js ) {
}

preg_match_all(
'#var\s(.*)\s?=\s?(\{.*\});#Ui',
'#(var\s|let\s|window\._)(.*)\s?=\s?(\{.*\});?#Ui',
$js,
$json
);

if ( ! empty( $json[1][0] ) && ! empty( $json[2][0] ) ) {
if ( ! empty( $json[2][0] ) && ! empty( $json[3][0] ) ) {

$var_name = $json[1][0];
$var_json = $json[2][0];
$var_name = $json[2][0];
$var_json = $json[3][0];

$texts = wplng_parse_json(
$var_json,
Expand Down
8 changes: 4 additions & 4 deletions inc/translator/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ function wplng_translate_js( $js, $args = array() ) {
$json = array();

preg_match_all(
'#var\s(.*)\s?=\s?(\{.*\});#Ui',
'#(var\s|let\s|window\._)(.*)\s?=\s?(\{.*\});?#Ui',
$js,
$json
);

if ( ! empty( $json[1][0] ) && ! empty( $json[2][0] ) ) {
if ( ! empty( $json[2][0] ) && ! empty( $json[3][0] ) ) {

$var_name = $json[1][0];
$var_json = $json[2][0];
$var_name = $json[2][0];
$var_json = $json[3][0];

wplng_args_setup( $args );

Expand Down
14 changes: 13 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://wplingua.com/
Tags: translate, translation, multilingual, localization, language
Requires at least: 6.0
Tested up to: 6.6
Stable tag: 2.0.1
Stable tag: 2.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -28,6 +28,12 @@ The highlights:
✓ Open source, find [wpLingua on GitHub](https://github.com/julien-jacob/wplingua)
✓ And more!

### 🎬 6 minutes to translate your website

[youtube https://www.youtube.com/watch?v=T1fTHnZhH-0]

Video tutorial available in [Chinese](https://youtu.be/ET2ijgN3cUw?si=6L2_KlZJ6Dw3kOJq), [Danish](https://youtu.be/cxoMK5UamXA?si=sbaK-Fx8GAfsl8Bu), [English](https://youtu.be/T1fTHnZhH-0?si=rELV5g5I4i9KwVG0), [Finnish](https://youtu.be/niuBK79uK4Y?si=fKs6mvNqLCTliOIV), [French](https://youtu.be/No6PdIJrbrk?si=2w2yJERXIhdSfqFb), [German](https://youtu.be/TvyHn8n9zr4?si=FSWSHd8YkW17V07u), [Greek](https://youtu.be/MMrkmhzVrNM?si=A0BM0Mq-gBgIQ-rT), [Hindi](https://youtu.be/TCoaBMCusbE?si=eXACXPXZtAeC4J2P), [Italian](https://youtu.be/yYNkJqbFGeo?si=VBkJrNck4_kPma-0), [Japanese](https://youtu.be/H9jL6B9ZoRk?si=ZOoNKdxE67LMt4Sv), [Korean](https://youtu.be/FGi68qYvzWg?si=zNZKYPUvf12FNxCz), [Polish](https://youtu.be/QkQ8fn7XZkY?si=Z4aEfcVHs05_AOLS), [Portuguese](https://youtu.be/W8lGMYeE-wQ?si=SorUAE_AVW8-ezKE) and [Spanish](https://youtu.be/ePsri0sP99Y?si=l3JCik3Z-B0hg4CR).

### 🔥 One free target language ###
The first language translation is completely free for non-commercial websites. If your website is of a commercial nature (e-commerce, advertising, etc.), a commercial licence is available.

Expand Down Expand Up @@ -154,6 +160,12 @@ No, not at the moment but in the meantime, you can easily display the language s

== Changelog ==

= 2.0.2 =

* Better JSON detection in JavaScript
* Added plugin compatibility: WF Cookie Consent
* Add videos on WordPress description

= 2.0.1 =

* Better SEO: Translate meta[name="description"]
Expand Down
4 changes: 2 additions & 2 deletions wplingua.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://wplingua.com/
* Text Domain: wplingua
* Domain Path: /languages/
* Version: 2.0.1
* Version: 2.0.2
* Requires PHP: 7.4
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -24,7 +24,7 @@
define( 'WPLNG_API_URL', 'https://api.wplingua.com' );
define( 'WPLNG_API_VERSION', '2.0' );
define( 'WPLNG_API_SSLVERIFY', true );
define( 'WPLNG_PLUGIN_VERSION', '2.0.1' );
define( 'WPLNG_PLUGIN_VERSION', '2.0.2' );
define( 'WPLNG_PLUGIN_FILE', plugin_basename( __FILE__ ) );
define( 'WPLNG_PLUGIN_PATH', dirname( __FILE__ ) );
define( 'WPLNG_MAX_TRANSLATIONS', 256 );
Expand Down

0 comments on commit 7d1f19c

Please sign in to comment.