Skip to content

Commit 5ea6c75

Browse files
committed
added chinese+french translation: tested wp 5.2
1 parent 8ac4415 commit 5ea6c75

10 files changed

+100
-43
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM andidittrich/wp-dev:latest
1+
FROM wp-dev
22

33
# copy release files
4-
COPY --chown="www-data:www-data" dist/ /srv/app/wp-content/plugins/enlighter
4+
COPY --chown="www-data:www-data" dist/ /srv/app/public/wp-content/plugins/enlighter

Enlighter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Domain Path: /lang
66
Text Domain: enlighter
77
Description: All-in-one Syntax Highlighting solution. Full Gutenberg and Classic Editor integration. Graphical theme customizer. Based on EnlighterJS.
8-
Version: 3.10.0-BETA1
8+
Version: 3.10.0
99
Author: Andi Dittrich
1010
Author URI: https://andidittrich.de
1111
License: MIT X11-License
@@ -24,7 +24,7 @@
2424
*/
2525

2626
define('ENLIGHTER_INIT', true);
27-
define('ENLIGHTER_VERSION', '3.10.0-BETA1');
27+
define('ENLIGHTER_VERSION', '3.10.0');
2828
define('ENLIGHTER_PLUGIN_PATH', dirname(__FILE__));
2929
define('ENLIGHTER_PLUGIN_URL', plugins_url('/enlighter/'));
3030

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: Andi Dittrich, aenondynamics
33
Tags: syntax highlighting, javascript, code, coding, sourcecode, mootools, jquery, customizable, visual editor, tinymce, themes, css, html, php, js, xml, c, cpp, c#, ruby, shell, java, python, sql, rust, matlab, json, ini, config, cython, lua, assembly, asm
44
Donate link: https://enlighterjs.org
55
Requires at least: 3.9
6-
Tested up to: 5.1
6+
Tested up to: 5.2
77
Stable tag: 3.10.0
88
License: MIT X11-License
99
License URI: http://opensource.org/licenses/MIT
@@ -13,9 +13,12 @@ All-in-one Syntax Highlighting solution. Full Gutenberg and Classic Editor integ
1313
## Description ##
1414

1515
Enlighter is a free, easy-to-use, syntax highlighting tool for WordPress. Highlighting is powered by the [EnlighterJS](http://enlighterjs.org) javascript library to provide a beautiful code-appearance.
16+
1617
Using it can be as simple as adding a new Enlighter Sourcecode block (Gutenberg) and insert the code which you want to highlight: Enlighter takes care of the rest!
18+
1719
An easy to use Theme-Customizer is included to modify the build-in themes **without any css knowlegde!**
1820
It also supports the automatic creation of tab-panes to display code-groups together (useful for multi-language examples - e.g. html+css+js)
21+
1922
[Theme Demo](https://enlighterjs.org/Theme.Enlighter.html "EnlighterJS Theme Browser") - [Language Examples](https://enlighterjs.org/Language.Javascript.html "EnlighterJS Language Example")
2023

2124
### Plugin Features ###

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
<!-- Run Webserver !-->
107107
<exec executable="docker" failonerror="true">
108-
<arg line="run --name enlighter-test -p 8080:8080 --rm -e WP_DSN=${WP.DSN} --interactive enlighter-test"/>
108+
<arg line="run --name enlighter-test-env -p 8080:8080 --rm -e WP_DSN=${WP.DSN} --interactive enlighter-test"/>
109109
</exec>
110110
</target>
111111

class/CompatibilityModeFilter.php

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Plugin URI: http://andidittrich.de/go/enlighterjs
88
License: MIT X11-License
99
10-
Copyright (c) 2018, Andi Dittrich
10+
Copyright (c) 2018-2019, Andi Dittrich
1111
1212
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1313
@@ -29,7 +29,8 @@ public function __construct($settingsUtil){
2929
$this->_defaultLanguage = $settingsUtil->getOption('compatDefaultLanguage');
3030
}
3131

32-
private function getCompatRegex(){
32+
// used by e.g. JetPack markdown
33+
private function getCompatRegexType1(){
3334
// opening tag, language identifier (optional)
3435
return '/<pre><code(?:\s+class="([a-z]+)")?>' .
3536

@@ -43,6 +44,30 @@ private function getCompatRegex(){
4344
'/Uim';
4445
}
4546

47+
// used by e.g. Gutenberg Codeblock
48+
private function getCompatRegexType2(){
49+
// opening tag - no language identifier
50+
return '/<pre(?:[^>]+?)?><code>' .
51+
52+
// arbitrary multi-line content
53+
'([\S\s]*)' .
54+
55+
// closing tags
56+
'\s*<\/code>\s*<\/pre>\s*' .
57+
58+
// ungreedy, case insensitive, multiline
59+
'/Uim';
60+
}
61+
62+
// used by e.g. Crayon
63+
private function getCompatRegexType3(){
64+
// opening tag, language identifier (optional)
65+
return '/<pre\s+class="lang:([a-z]+?)([^"]*)"\s*>' .
66+
67+
// case insensitive, multiline
68+
'/im';
69+
}
70+
4671

4772
// strip the content
4873
// internal regex function to replace gfm code sections with placeholders
@@ -52,7 +77,7 @@ public function stripCodeFragments($content){
5277
$T = $this;
5378

5479
// Block Code
55-
return preg_replace_callback($this->getCompatRegex(), function ($match) use ($T){
80+
return preg_replace_callback($this->getCompatRegexType1(), function ($match) use ($T){
5681

5782
// language identifier (tagname)
5883
$lang = $match[1];

lang/Enlighter.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ msgid ""
22
msgstr ""
33
"Content-Type: text/plain; charset=UTF-8\n"
44
"Content-Transfer-Encoding: 8bit\n"
5-
"POT-Creation-Date: 2019-01-13 16:44:28+00:00\n"
5+
"POT-Creation-Date: 2019-04-29 11:32:44+00:00\n"
66
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
77
"MIME-Version: 1.0\n"
8-
"Project-Id-Version: Enlighter 3.9.0\n"
8+
"Project-Id-Version: Enlighter 3.10.0\n"
99
"Report-Msgid-Bugs-To: andi DOT dittrich AT a3non DOT org\n"
1010
"Last-Translator: Andi Dittrich\n"
1111

lang/enlighter-fr_FR.mo

32.1 KB
Binary file not shown.

lang/enlighter-zh_CN.mo

28.8 KB
Binary file not shown.

readme.txt

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,77 @@ Contributors: Andi Dittrich, aenondynamics
33
Tags: syntax highlighting, javascript, code, coding, sourcecode, mootools, jquery, customizable, visual editor, tinymce, themes, css, html, php, js, xml, c, cpp, c#, ruby, shell, java, python, sql, rust, matlab, json, ini, config, cython, lua, assembly, asm
44
Donate link: https://enlighterjs.org
55
Requires at least: 3.9
6-
Tested up to: 5.0
7-
Stable tag: 3.9.0
6+
Tested up to: 5.2
7+
Stable tag: 3.10.0
88
License: MIT X11-License
99
License URI: http://opensource.org/licenses/MIT
1010

1111
All-in-one Syntax Highlighting solution. Full Gutenberg and Classic Editor integration. Graphical theme customizer. Based on EnlighterJS.
1212

1313
== Description ==
1414

15-
Enlighter is a free, easy-to-use, syntax highlighting tool for WordPress. It's build in PHP and uses the Javascript based [EnlighterJS](http://enlighterjs.org) library to provide a beautiful code-appearance.
16-
Using it can be as simple as selecting an editor style or adding shortcode around your scripts which you want to highlight and Enlighter takes care of the rest. An easy to use Theme-Customizer is included to modify the build-in themes **without any css knowlegde!**
15+
Enlighter is a free, easy-to-use, syntax highlighting tool for WordPress. Highlighting is powered by the [EnlighterJS](http://enlighterjs.org) javascript library to provide a beautiful code-appearance.
16+
17+
Using it can be as simple as adding a new Enlighter Sourcecode block (Gutenberg) and insert the code which you want to highlight: Enlighter takes care of the rest!
18+
19+
An easy to use Theme-Customizer is included to modify the build-in themes **without any css knowlegde!**
1720
It also supports the automatic creation of tab-panes to display code-groups together (useful for multi-language examples - e.g. html+css+js)
21+
1822
[Theme Demo](https://enlighterjs.org/Theme.Enlighter.html "EnlighterJS Theme Browser") - [Language Examples](https://enlighterjs.org/Language.Javascript.html "EnlighterJS Language Example")
1923

2024
= Plugin Features =
2125

22-
* **Full Gutenberg Editor Integration** (currently beta)
26+
* **Full Gutenberg Editor Integration**
2327
* **Full Classic Editor Integration** (TinyMCE)
24-
* Support for all common used languages including powerful generic highlighting
28+
* Support for all common used languages
29+
* Powerful generic highlighting engine for unknown languages
2530
* Theme Customizer including **LIVE Preview Mode**
2631
* Inline Syntax Highlighting
27-
* Tab-Indentation mode to align code with the `tab` key (single line and block selection)
28-
* Markdown fenced code blocks
2932
* [bbPress](https://bbpress.org/) shortcode + markdown code blocks support
30-
* Shortcodes within content, comments and widgets
31-
* Easy to use Text-Editor mode through the use of Shortcodes and QuickTags
3233
* Advanced configuration options (CDN usage, ..) are available within the options page.
3334
* Supports code-groups (displays multiple code-blocks within a tab-pane)
3435
* Extensible language and theme engines - add your own one.
3536
* Simple CSS based themes
3637
* Integrated CSS file caching (suitable for high traffic sites)
37-
* Standalone Shortcode-Processor to avoid wpautop filter issues in Text-Editor Mode
3838
* Webfont Loader to add missing Monospace Fonts to your website
39-
* Transform legacy codeblocks to Enlighter Gutenberg Blocks
4039
* **Full GPDR compliant** - no external resources are required, no data will be aggregated
4140

42-
= Tutorials and Examples =
41+
= Gutenberg Editor Integration =
42+
* **Full Editor Integration** via "Enlighter Sourcecode" block
43+
* Automatic transformations for classic editor posts (codeblocks converted to Enlighter Sourcecode block)
44+
* Transform legacy codeblocks to Enlighter Gutenberg Blocks (manual transformation)
45+
* [Docs and Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_GutenbergEditor.md)
46+
* [Editor plugin repository](https://github.com/EnlighterJS/Plugin.Gutenberg)
47+
48+
= Classic Editor (TinyMCE) Integration =
49+
* **Full Editor Integration** via Enlighter buttons in the toolbar
50+
* Inline Syntax Highlighting
51+
* Tab-Indentation mode to align code with the `tab` key (single line and block selection)
52+
* Editor formats to highlight existing code
53+
* [Docs and Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_VisualEditor.md)
54+
* [Editor plugin repository](https://github.com/EnlighterJS/Plugin.TinyMCE)
55+
* [Classic Editor Live-Demo](https://tinymce.enlighterjs.org/)
56+
57+
= Markdown =
58+
* Markdown fenced code blocks
59+
* Inline Syntax Highlighting via backtick code (including language specific addon)
60+
* [Docs and Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_Markdown.md)
61+
62+
= Texteditor/Shortcodes (Legacy) =
63+
64+
Shortcodes are deprecated and should be used in **text editor mode only** - never use them within Gutenberg Editor or Classic Editor!
4365

44-
* [Enlighter Classic Editor Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_VisualEditor.md) - Howto add Code Snippets to your posts and pages with TinyMCE (Classic Editor)
45-
* [Enlighter Gutenberg Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_GutenbergEditor.md) - Howto add Code Snippets to your posts and pages with Gutenberg
46-
* [Enlighter Markdown Usage](https://github.com/EnlighterJS/Plugin.WordPress/blob/master/docs/Usage_Markdown.md) - Howto use Markdown fenced codeblocks
47-
* [Enlighter Visual Editor Live-Demo](https://tinymce.enlighterjs.org/)
66+
* Easy to use Text-Editor mode through the use of Shortcodes and QuickTags
67+
* Shortcodes within content, comments and widgets
68+
* Standalone Shortcode-Processor to avoid wpautop filter issues in Text-Editor Mode
4869

4970
= Supported Languages (build-in) =
71+
72+
In case your language is not available try the **Generic Mode** which covers a lot of programming languages - or request a new language on [GitHub](https://github.com/EnlighterJS/EnlighterJS/issues)
73+
5074
Click to view Language/Theme Examples
5175

76+
* [Generic highlighting](https://enlighterjs.org/Language.Generic.html)
5277
* [AVR Assembly](https://enlighterjs.org/Language.AVR-Assembly.html)
5378
* [Generic Assembly](https://enlighterjs.org/Language.Assembly.html)
5479
* [C](https://enlighterjs.org/Language.C.html)
@@ -57,7 +82,6 @@ Click to view Language/Theme Examples
5782
* [C++](https://enlighterjs.org/Language.Cpp.html)
5883
* [Cython](https://enlighterjs.org/Language.Cython.html)
5984
* [Diff](https://enlighterjs.org/Language.Diff.html)
60-
* [Generic](https://enlighterjs.org/Language.Generic.html)
6185
* [HTML](https://enlighterjs.org/Language.HTML.html)
6286
* [Ini](https://enlighterjs.org/Language.Ini.html)
6387
* [JSON](https://enlighterjs.org/Language.JSON.html)
@@ -87,7 +111,7 @@ Click to view Language/Theme Examples
87111
== Compatibility ==
88112

89113
All browsers supported by MooTools (enabled Javascript required) and with HTML5 capabilities for "data-" attributes are compatible with Enlighter. It's possible that it may work with earlier/other browsers.
90-
Generally Enlighter (which javascript part [EnlighterJS](http://enlighterjs.org) is based on [MooTools Javascript Framework](http://mootools.net/)) should work together with jQuery in [noConflict Mode](http://docs.jquery.com/Using_jQuery_with_Other_Libraries) - when you are using jQuery within your Wordpress Theme/Page you have to take care of it!
114+
Generally Enlighter (which javascript part [EnlighterJS](https://enlighterjs.org) is based on [MooTools Javascript Framework](http://mootools.net/)) should work together with jQuery in [noConflict Mode](http://docs.jquery.com/Using_jQuery_with_Other_Libraries) - when you are using jQuery within your Wordpress Theme/Page you have to take care of it!
91115

92116
* Chrome 10+
93117
* Safari 5+
@@ -157,6 +181,10 @@ Added Visual-Editor (TinyMCE) Integration (will avoid auto-whitespace-removing i
157181

158182
== Frequently Asked Questions ==
159183

184+
= Autooptimize compatibility settings =
185+
To use Enlighter together with **autooptimize** it's required to exclude the Enlighter resources from autooptimize (EnlighterJS is already optimized!)
186+
Goto `Settings / Autooptimize / Javascript options / Exclude scripts from Autoptimize` and add `enlighter/resources/` to the end of the comma separated list.
187+
160188
= Can i use Enlighter togehter with Crayon ? =
161189
No, you can't use Enlighter together with the Crayon Syntax highlighter because it may take over the Enlighter elements.
162190

@@ -208,6 +236,15 @@ In case you found a security issue in this plugin - please write a message **dir
208236
Write a message to [Andi Dittrich](https://about.andidittrich.com/contact.html) (andi DOT dittrich AT a3non DOT O R G) or open a [New Issue on GitHub](https://github.com/EnlighterJS/Plugin.WordPress/issues)
209237
== Changelog ==
210238

239+
240+
= 3.10.0 =
241+
242+
* Added: french translation - thanks to [regisenguehard on GitHub](https://github.com/EnlighterJS/Plugin.WordPress/pull/144)
243+
* Added: simplified chinese translation - thanks to [XFY9326 on GitHub](https://github.com/EnlighterJS/Plugin.WordPress/pull/145)
244+
* Changed: jsdelivr mootools version pointed to `1.6.0`
245+
* Changed: the DRI detection is now limited to the condition `in_the_loop() && is_main_query()`
246+
* Bugfix: the experimental DRI feature failed in case `the_content` filter is called multiple times within a theme - thanks to [willstocks-tech on GitHub](https://github.com/EnlighterJS/Plugin.WordPress/pull/153)
247+
211248
= 3.9.0 =
212249

213250
* Added: Visual Editor Plugin ([EnlighterJS.TinyMCE](https://github.com/EnlighterJS/Plugin.TinyMCE)) **v3.5.1**

views/admin/Changes.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
<ul>
2-
<li>Added: Visual Editor Plugin (<a href="https://github.com/EnlighterJS/Plugin.TinyMCE">EnlighterJS.TinyMCE</a>) <strong>v3.5.1</strong></li>
3-
<li>Added: Gutenberg Editor Plugin - [EnlighterJS/Plugin.Gutenberg on GitHub] <strong>v0.4.0</strong></li>
4-
<li>Added: <a href="https://enlighterjs.org/" rel="nofollow">EnlighterJS v2.13.0</a></li>
5-
<li>Added: automatically transforms legacy Enlighter codeblocks (Classic Editor) to Gutenberg blocks in case the "Convert to Blocks" function is triggered</li>
6-
<li>Added: Support for jQuery Ajax content (post load) - requested by <a href="https://github.com/EnlighterJS/Plugin.WordPress/issues/126" data-hovercard-type="issue" data-hovercard-url="/EnlighterJS/Plugin.WordPress/issues/126/hovercard">wassereimer86 on GitHub</a></li>
7-
<li>Added: Description of possible <a href="https://github.com/EnlighterJS/Plugin.WordPress/tree/master/docs/PluginNotifications.md">Plugin Notficiations</a></li>
8-
<li>Changed: moved TinyMCE editor resources (editor plugin) from <code>enlighter/resources/editor</code> to <code>enlighter/resources/tinymce</code></li>
9-
<li>Changed: moved text editor resources (quicktags from <code>enlighter/resources/editor</code> to <code>enlighter/resources/texteditor</code></li>
10-
<li>Changed: moved Gutenberg Editor settings to "Visual Editor" Tab</li>
11-
<li>Changed: <code>data-enlighter-linenumbers</code> attribute is ignored in case it is not set (empty string) to be compatible with the new <a href="https://github.com/EnlighterJS/Plugin.Gutenberg">Gutenberg Editor Plugin</a> - explicit true/false required</li>
12-
<li>Changed: Gutenberg Plugin is enabled by default</li>
13-
<li>Bugfix: TinyMCE footer label may collide with editor content - added additional padding - thanks to <a href="https://github.com/EnlighterJS/Plugin.WordPress/issues/120" data-hovercard-type="issue" data-hovercard-url="/EnlighterJS/Plugin.WordPress/issues/120/hovercard">JavierSegoviaCordoba on GitHub</a></li>
14-
<li>Bugfix: On Windows platforms, the environment check throws the error message <code>plugin is located within an invalid path</code> - thanks to <a href="https://wordpress.org/support/topic/enlighter-plugin-error-the-plugin-is-located-within-an-invalid-path" rel="nofollow">ginaf40 on WordPress.org Forums</a></li>
2+
<li>Added: french translation - thanks to <a href="https://github.com/EnlighterJS/Plugin.WordPress/pull/144" data-hovercard-type="pull_request" data-hovercard-url="/EnlighterJS/Plugin.WordPress/pull/144/hovercard">regisenguehard on GitHub</a></li>
3+
<li>Added: simplified chinese translation - thanks to <a href="https://github.com/EnlighterJS/Plugin.WordPress/pull/145" data-hovercard-type="pull_request" data-hovercard-url="/EnlighterJS/Plugin.WordPress/pull/145/hovercard">XFY9326 on GitHub</a></li>
4+
<li>Changed: jsdelivr mootools version pointed to <code>1.6.0</code></li>
5+
<li>Changed: the DRI detection is now limited to the condition <code>in_the_loop() &amp;&amp; is_main_query()</code></li>
6+
<li>Bugfix: the experimental DRI feature failed in case <code>the_content</code> filter is called multiple times within a theme - thanks to <a href="https://github.com/EnlighterJS/Plugin.WordPress/pull/153" data-hovercard-type="pull_request" data-hovercard-url="/EnlighterJS/Plugin.WordPress/pull/153/hovercard">willstocks-tech on GitHub</a></li>
157
</ul>

0 commit comments

Comments
 (0)