Version Description
- Added WP-CLI sync and extract commands
- Fixed {locale} placeholder bug introduced in 2.4.4
- Improved handling of invalid character encodings
- Sync (msgmerge) moved to back end
- New fuzzy matching with fuzziness setting
- Bumped WordPress version to 5.5.3
Download this release
Release Info
Developer | timwhitlock |
Plugin | Loco Translate |
Version | 2.4.5 |
Comparing to | |
See all releases |
Code changes from version 2.4.4 to 2.4.5
- languages/loco-translate.pot +60 -49
- lib/compiled/gettext.php +14 -12
- lib/data/locales.php +1 -1
- loco.php +13 -7
- pub/css/admin.css +1 -1
- pub/css/editor.css +1 -1
- pub/css/podiff.css +1 -1
- pub/css/poview.css +1 -1
- pub/css/skins/blue.css +1 -1
- pub/css/skins/coffee.css +1 -1
- pub/css/skins/ectoplasm.css +1 -1
- pub/css/skins/light.css +1 -1
- pub/css/skins/midnight.css +1 -1
- pub/css/skins/modern.css +1 -1
- pub/css/skins/ocean.css +1 -1
- pub/css/skins/sunrise.css +1 -1
- pub/js/min/admin.js +182 -186
- pub/js/min/editor.js +1 -1
- readme.txt +11 -3
- src/admin/bundle/LocaleController.php +1 -1
- src/admin/file/EditController.php +3 -1
- src/admin/init/InitPoController.php +2 -2
- src/admin/init/InitPotController.php +0 -11
- src/admin/init/UploadController.php +1 -1
- src/admin/list/ThemesController.php +1 -3
- src/ajax/DownloadController.php +3 -4
- src/ajax/MsginitController.php +10 -7
- src/ajax/SyncController.php +95 -20
- src/cli/Commands.php +90 -0
- src/cli/ExtractCommand.php +90 -0
- src/cli/SyncCommand.php +205 -0
- src/cli/Utils.php +142 -0
- src/compat/MbstringExtension.php +17 -3
- src/config/BundleWriter.php +1 -1
- src/data/Preferences.php +2 -2
- src/data/Settings.php +2 -0
- src/error/AdminNotices.php +31 -10
- src/error/Debug.php +8 -0
- src/error/Exception.php +10 -1
- src/error/Notice.php +8 -0
- src/error/ParseException.php +23 -19
- src/error/Success.php +9 -0
- src/error/Warning.php +8 -0
- src/fs/File.php +2 -2
- src/fs/FileMode.php +1 -0
- src/gettext/Data.php +5 -13
- src/gettext/Extraction.php +4 -4
- src/mvc/AdminController.php +2 -3
- src/mvc/FileParams.php +5 -1
- src/output/DiffRenderer.php +19 -4
- src/package/Locale.php +12 -31
- src/package/Plugin.php +18 -1
- src/package/Project.php +38 -3
- src/package/TextDomain.php +10 -6
- src/package/Theme.php +17 -0
- tpl/admin/config/settings.php +17 -0
languages/loco-translate.pot
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
#, fuzzy
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
-
"Project-Id-Version: Loco Translate 2.4.
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
-
"POT-Creation-Date: 2020-
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
@@ -13,7 +13,7 @@ msgstr ""
|
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
"X-Generator: Loco https://localise.biz/\n"
|
16 |
-
"X-Loco-Version: 2.4.
|
17 |
|
18 |
#: src/fs/FileWriter.php:214
|
19 |
#, php-format
|
@@ -131,7 +131,7 @@ msgid_plural "%s words"
|
|
131 |
msgstr[0] ""
|
132 |
msgstr[1] ""
|
133 |
|
134 |
-
#: tpl/admin/config/settings.php:
|
135 |
msgid "About file system access"
|
136 |
msgstr ""
|
137 |
|
@@ -204,7 +204,7 @@ msgstr ""
|
|
204 |
msgid "Allow (with warning)"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: tpl/admin/config/settings.php:
|
208 |
msgid "Allow full access to these roles"
|
209 |
msgstr ""
|
210 |
|
@@ -436,8 +436,8 @@ msgstr ""
|
|
436 |
msgid "Disallow"
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: src/data/Settings.php:
|
440 |
-
#: src/admin/bundle/LocaleController.php:130 tpl/admin/config/settings.php:
|
441 |
#: tpl/admin/config/apis.php:122 tpl/admin/config/prefs.php:45
|
442 |
#: tpl/admin/common/inc-fsconn.php:16 tpl/admin/common/inc-fsconn.php:41
|
443 |
#: tpl/admin/errors/no-backups.php:22
|
@@ -474,7 +474,7 @@ msgstr ""
|
|
474 |
msgid "Editing %1$s in %2$s"
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: tpl/admin/config/settings.php:
|
478 |
msgid "Editing of POT (template) files"
|
479 |
msgstr ""
|
480 |
|
@@ -490,13 +490,13 @@ msgid "%s translation"
|
|
490 |
msgstr ""
|
491 |
|
492 |
#. button for adding a new string when manually editing a POT file
|
493 |
-
#: src/admin/file/EditController.php:
|
494 |
msgctxt "Editor"
|
495 |
msgid "Add"
|
496 |
msgstr ""
|
497 |
|
498 |
#. Button that opens window for auto-translating
|
499 |
-
#: src/admin/file/EditController.php:
|
500 |
msgctxt "Editor"
|
501 |
msgid "Auto"
|
502 |
msgstr ""
|
@@ -520,7 +520,7 @@ msgid "Context not loaded"
|
|
520 |
msgstr ""
|
521 |
|
522 |
#. Button for downloading a PO, MO or POT file
|
523 |
-
#: src/admin/file/EditController.php:
|
524 |
msgctxt "Editor"
|
525 |
msgid "Download"
|
526 |
msgstr ""
|
@@ -532,19 +532,19 @@ msgid "Plural"
|
|
532 |
msgstr ""
|
533 |
|
534 |
#. button for removing a string when manually editing a POT file
|
535 |
-
#: src/admin/file/EditController.php:
|
536 |
msgctxt "Editor"
|
537 |
msgid "Remove"
|
538 |
msgstr ""
|
539 |
|
540 |
#. Button that reloads current screen
|
541 |
-
#: src/admin/file/EditController.php:
|
542 |
msgctxt "Editor"
|
543 |
msgid "Revert"
|
544 |
msgstr ""
|
545 |
|
546 |
#. Button that saves translations to disk
|
547 |
-
#: src/admin/file/EditController.php:
|
548 |
msgctxt "Editor"
|
549 |
msgid "Save"
|
550 |
msgstr ""
|
@@ -574,13 +574,13 @@ msgid "Suggest translation"
|
|
574 |
msgstr ""
|
575 |
|
576 |
#. Button that runs in-editor sync/operation
|
577 |
-
#: src/admin/file/EditController.php:
|
578 |
msgctxt "Editor"
|
579 |
msgid "Sync"
|
580 |
msgstr ""
|
581 |
|
582 |
#. Button that toggles between "code" and regular text editing modes
|
583 |
-
#: src/admin/file/EditController.php:
|
584 |
msgctxt "Editor"
|
585 |
msgid "Toggle code view"
|
586 |
msgstr ""
|
@@ -591,7 +591,7 @@ msgid "Toggle Fuzzy"
|
|
591 |
msgstr ""
|
592 |
|
593 |
#. Button that toggles invisible characters
|
594 |
-
#: src/admin/file/EditController.php:
|
595 |
msgctxt "Editor"
|
596 |
msgid "Toggle invisibles"
|
597 |
msgstr ""
|
@@ -632,7 +632,7 @@ msgstr ""
|
|
632 |
msgid "Enter a new location for this file"
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: src/js/Strings.php:98 src/error/Exception.php:
|
636 |
msgid "Error"
|
637 |
msgstr ""
|
638 |
|
@@ -691,7 +691,7 @@ msgid "Failed to save file"
|
|
691 |
msgstr ""
|
692 |
|
693 |
#. %s will be replaced with the name of a missing POT file
|
694 |
-
#: src/ajax/SyncController.php:
|
695 |
#, php-format
|
696 |
msgid "Falling back to source extraction because %s is missing"
|
697 |
msgstr ""
|
@@ -793,7 +793,7 @@ msgstr ""
|
|
793 |
msgid "File size"
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: tpl/admin/config/settings.php:
|
797 |
msgid "File system access"
|
798 |
msgstr ""
|
799 |
|
@@ -813,7 +813,7 @@ msgid ""
|
|
813 |
msgstr ""
|
814 |
|
815 |
#. Placeholder text for text filter above editor
|
816 |
-
#: src/admin/file/EditController.php:
|
817 |
msgid "Filter translations"
|
818 |
msgstr ""
|
819 |
|
@@ -844,6 +844,10 @@ msgstr ""
|
|
844 |
msgid "Full documentation"
|
845 |
msgstr ""
|
846 |
|
|
|
|
|
|
|
|
|
847 |
#: tpl/admin/config/settings.php:27
|
848 |
msgid "Generate hash tables"
|
849 |
msgstr ""
|
@@ -860,15 +864,15 @@ msgstr ""
|
|
860 |
msgid "Go to WordPress Core"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: tpl/admin/config/settings.php:
|
864 |
msgid "Grant access to roles"
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: src/ajax/ApisController.php:26 src/admin/file/EditController.php:
|
868 |
msgid "Help"
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: src/mvc/AdminController.php:
|
872 |
msgid "Help & support"
|
873 |
msgstr ""
|
874 |
|
@@ -951,7 +955,7 @@ msgid "Just copy English source strings"
|
|
951 |
msgstr ""
|
952 |
|
953 |
#. relative time when something happened in the last 30 seconds
|
954 |
-
#: src/mvc/FileParams.php:
|
955 |
msgid "Just now"
|
956 |
msgstr ""
|
957 |
|
@@ -1021,13 +1025,6 @@ msgstr ""
|
|
1021 |
msgid "Loco interrupted by output from %s:%u"
|
1022 |
msgstr ""
|
1023 |
|
1024 |
-
#: loco.php:140
|
1025 |
-
#, php-format
|
1026 |
-
msgid ""
|
1027 |
-
"Loco requires the \"%s\" PHP extension. Ask your hosting provider to install "
|
1028 |
-
"it"
|
1029 |
-
msgstr ""
|
1030 |
-
|
1031 |
#. change "en" in the URL to your language if it's available at http://php.net/docs.php
|
1032 |
#: tpl/admin/errors/no-tokenizer.php:17
|
1033 |
msgid ""
|
@@ -1047,16 +1044,26 @@ msgstr ""
|
|
1047 |
msgid "Loco Translate %s"
|
1048 |
msgstr ""
|
1049 |
|
1050 |
-
#: src/data/Settings.php:
|
1051 |
msgid ""
|
1052 |
"Loco Translate 2.4 supports third party translation providers. Set up your "
|
1053 |
"API keys in the plugin settings!"
|
1054 |
msgstr ""
|
1055 |
|
1056 |
-
#: src/mvc/AdminController.php:
|
1057 |
msgid "Loco Translate is powered by"
|
1058 |
msgstr ""
|
1059 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
#. Page title for plugin home screen
|
1061 |
#: src/mvc/AdminRouter.php:39
|
1062 |
msgid "Loco, Translation Management"
|
@@ -1090,7 +1097,7 @@ msgid "MO file exists for this language already. Delete it first"
|
|
1090 |
msgstr ""
|
1091 |
|
1092 |
#. @var Loco_mvc_ViewParams $verbose
|
1093 |
-
#: tpl/admin/config/settings.php:
|
1094 |
msgid "Modification of installed files"
|
1095 |
msgstr ""
|
1096 |
|
@@ -1136,11 +1143,11 @@ msgstr ""
|
|
1136 |
msgid "New template"
|
1137 |
msgstr ""
|
1138 |
|
1139 |
-
#: src/admin/init/InitPotController.php:
|
1140 |
msgid "New template file"
|
1141 |
msgstr ""
|
1142 |
|
1143 |
-
#: src/admin/init/InitPotController.php:
|
1144 |
#, php-format
|
1145 |
msgid "New translations template for \"%s\""
|
1146 |
msgstr ""
|
@@ -1175,7 +1182,7 @@ msgstr ""
|
|
1175 |
msgid "no wildcards"
|
1176 |
msgstr ""
|
1177 |
|
1178 |
-
#: tpl/admin/config/settings.php:89 tpl/admin/config/settings.php:
|
1179 |
msgid "Not recommended"
|
1180 |
msgstr ""
|
1181 |
|
@@ -1241,7 +1248,7 @@ msgstr[0] ""
|
|
1241 |
msgstr[1] ""
|
1242 |
|
1243 |
#. Where %2$s is the maximum size of a file that will be included and %3$s is the largest encountered
|
1244 |
-
#: src/ajax/SyncController.php:
|
1245 |
#, php-format
|
1246 |
msgid ""
|
1247 |
"One file has been skipped because it's %3$s. (Max is %2$s). Check all "
|
@@ -1306,7 +1313,7 @@ msgstr ""
|
|
1306 |
msgid "Permission denied to update file"
|
1307 |
msgstr ""
|
1308 |
|
1309 |
-
#: src/package/Plugin.php:
|
1310 |
#, php-format
|
1311 |
msgid "Plugin not found: %s"
|
1312 |
msgstr ""
|
@@ -1400,7 +1407,7 @@ msgstr ""
|
|
1400 |
msgid "POT file saved"
|
1401 |
msgstr ""
|
1402 |
|
1403 |
-
#: tpl/admin/config/settings.php:
|
1404 |
msgid "POT template files"
|
1405 |
msgstr ""
|
1406 |
|
@@ -1468,11 +1475,11 @@ msgstr ""
|
|
1468 |
msgid "Save config"
|
1469 |
msgstr ""
|
1470 |
|
1471 |
-
#: tpl/admin/config/settings.php:
|
1472 |
msgid "Save credentials in session"
|
1473 |
msgstr ""
|
1474 |
|
1475 |
-
#: tpl/admin/config/settings.php:
|
1476 |
#: tpl/admin/config/prefs.php:44
|
1477 |
msgid "Save settings"
|
1478 |
msgstr ""
|
@@ -1529,8 +1536,8 @@ msgid "Sets"
|
|
1529 |
msgstr ""
|
1530 |
|
1531 |
#: src/mvc/AdminRouter.php:67 src/mvc/AdminRouter.php:72
|
1532 |
-
#: src/data/Settings.php:
|
1533 |
-
#: src/admin/file/EditController.php:
|
1534 |
#: tpl/admin/common/inc-fsconn.php:43 tpl/admin/errors/no-backups.php:24
|
1535 |
msgid "Settings"
|
1536 |
msgstr ""
|
@@ -1613,6 +1620,10 @@ msgstr ""
|
|
1613 |
msgid "Support forum"
|
1614 |
msgstr ""
|
1615 |
|
|
|
|
|
|
|
|
|
1616 |
#: src/admin/config/DebugController.php:47
|
1617 |
msgid "System diagnostics"
|
1618 |
msgstr ""
|
@@ -1623,7 +1634,7 @@ msgstr ""
|
|
1623 |
msgid "Template file"
|
1624 |
msgstr ""
|
1625 |
|
1626 |
-
#: src/admin/init/InitPotController.php:
|
1627 |
msgid "Template file already exists"
|
1628 |
msgstr ""
|
1629 |
|
@@ -1785,7 +1796,7 @@ msgid "This information is for developers to find problems in the bundle setup"
|
|
1785 |
msgstr ""
|
1786 |
|
1787 |
#. Warning when POT file is opened in the file editor. It can be disabled in settings.
|
1788 |
-
#: src/admin/file/EditController.php:
|
1789 |
msgid ""
|
1790 |
"This is NOT a translation file. Manual editing of source strings is not "
|
1791 |
"recommended."
|
@@ -1864,12 +1875,12 @@ msgid "Translation progress %s%%"
|
|
1864 |
msgstr ""
|
1865 |
|
1866 |
#. Where %s is the name of the invalid POT file
|
1867 |
-
#: src/ajax/SyncController.php:
|
1868 |
#, php-format
|
1869 |
msgid "Translation template is invalid (%s)"
|
1870 |
msgstr ""
|
1871 |
|
1872 |
-
#: src/admin/file/EditController.php:
|
1873 |
#, php-format
|
1874 |
msgid "Translations don't match template. Run sync to update from %s"
|
1875 |
msgstr ""
|
1 |
#, fuzzy
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
+
"Project-Id-Version: Loco Translate 2.4.5-dev\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2020-11-19 17:26+0000\n"
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
"X-Generator: Loco https://localise.biz/\n"
|
16 |
+
"X-Loco-Version: 2.4.5-dev; wp-5.5.3"
|
17 |
|
18 |
#: src/fs/FileWriter.php:214
|
19 |
#, php-format
|
131 |
msgstr[0] ""
|
132 |
msgstr[1] ""
|
133 |
|
134 |
+
#: tpl/admin/config/settings.php:165
|
135 |
msgid "About file system access"
|
136 |
msgstr ""
|
137 |
|
204 |
msgid "Allow (with warning)"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: tpl/admin/config/settings.php:176
|
208 |
msgid "Allow full access to these roles"
|
209 |
msgstr ""
|
210 |
|
436 |
msgid "Disallow"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: src/data/Settings.php:173 src/admin/file/EditController.php:164
|
440 |
+
#: src/admin/bundle/LocaleController.php:130 tpl/admin/config/settings.php:194
|
441 |
#: tpl/admin/config/apis.php:122 tpl/admin/config/prefs.php:45
|
442 |
#: tpl/admin/common/inc-fsconn.php:16 tpl/admin/common/inc-fsconn.php:41
|
443 |
#: tpl/admin/errors/no-backups.php:22
|
474 |
msgid "Editing %1$s in %2$s"
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: tpl/admin/config/settings.php:155
|
478 |
msgid "Editing of POT (template) files"
|
479 |
msgstr ""
|
480 |
|
490 |
msgstr ""
|
491 |
|
492 |
#. button for adding a new string when manually editing a POT file
|
493 |
+
#: src/admin/file/EditController.php:189
|
494 |
msgctxt "Editor"
|
495 |
msgid "Add"
|
496 |
msgstr ""
|
497 |
|
498 |
#. Button that opens window for auto-translating
|
499 |
+
#: src/admin/file/EditController.php:200
|
500 |
msgctxt "Editor"
|
501 |
msgid "Auto"
|
502 |
msgstr ""
|
520 |
msgstr ""
|
521 |
|
522 |
#. Button for downloading a PO, MO or POT file
|
523 |
+
#: src/admin/file/EditController.php:202
|
524 |
msgctxt "Editor"
|
525 |
msgid "Download"
|
526 |
msgstr ""
|
532 |
msgstr ""
|
533 |
|
534 |
#. button for removing a string when manually editing a POT file
|
535 |
+
#: src/admin/file/EditController.php:191
|
536 |
msgctxt "Editor"
|
537 |
msgid "Remove"
|
538 |
msgstr ""
|
539 |
|
540 |
#. Button that reloads current screen
|
541 |
+
#: src/admin/file/EditController.php:198
|
542 |
msgctxt "Editor"
|
543 |
msgid "Revert"
|
544 |
msgstr ""
|
545 |
|
546 |
#. Button that saves translations to disk
|
547 |
+
#: src/admin/file/EditController.php:194
|
548 |
msgctxt "Editor"
|
549 |
msgid "Save"
|
550 |
msgstr ""
|
574 |
msgstr ""
|
575 |
|
576 |
#. Button that runs in-editor sync/operation
|
577 |
+
#: src/admin/file/EditController.php:196
|
578 |
msgctxt "Editor"
|
579 |
msgid "Sync"
|
580 |
msgstr ""
|
581 |
|
582 |
#. Button that toggles between "code" and regular text editing modes
|
583 |
+
#: src/admin/file/EditController.php:208
|
584 |
msgctxt "Editor"
|
585 |
msgid "Toggle code view"
|
586 |
msgstr ""
|
591 |
msgstr ""
|
592 |
|
593 |
#. Button that toggles invisible characters
|
594 |
+
#: src/admin/file/EditController.php:206
|
595 |
msgctxt "Editor"
|
596 |
msgid "Toggle invisibles"
|
597 |
msgstr ""
|
632 |
msgid "Enter a new location for this file"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: src/js/Strings.php:98 src/error/Exception.php:158
|
636 |
msgid "Error"
|
637 |
msgstr ""
|
638 |
|
691 |
msgstr ""
|
692 |
|
693 |
#. %s will be replaced with the name of a missing POT file
|
694 |
+
#: src/ajax/SyncController.php:50
|
695 |
#, php-format
|
696 |
msgid "Falling back to source extraction because %s is missing"
|
697 |
msgstr ""
|
793 |
msgid "File size"
|
794 |
msgstr ""
|
795 |
|
796 |
+
#: tpl/admin/config/settings.php:132 tpl/admin/config/settings.php:136
|
797 |
msgid "File system access"
|
798 |
msgstr ""
|
799 |
|
813 |
msgstr ""
|
814 |
|
815 |
#. Placeholder text for text filter above editor
|
816 |
+
#: src/admin/file/EditController.php:204
|
817 |
msgid "Filter translations"
|
818 |
msgstr ""
|
819 |
|
844 |
msgid "Full documentation"
|
845 |
msgstr ""
|
846 |
|
847 |
+
#: tpl/admin/config/settings.php:110
|
848 |
+
msgid "Fuzzy matching tolerance:"
|
849 |
+
msgstr ""
|
850 |
+
|
851 |
#: tpl/admin/config/settings.php:27
|
852 |
msgid "Generate hash tables"
|
853 |
msgstr ""
|
864 |
msgid "Go to WordPress Core"
|
865 |
msgstr ""
|
866 |
|
867 |
+
#: tpl/admin/config/settings.php:172
|
868 |
msgid "Grant access to roles"
|
869 |
msgstr ""
|
870 |
|
871 |
+
#: src/ajax/ApisController.php:26 src/admin/file/EditController.php:192
|
872 |
msgid "Help"
|
873 |
msgstr ""
|
874 |
|
875 |
+
#: src/mvc/AdminController.php:52
|
876 |
msgid "Help & support"
|
877 |
msgstr ""
|
878 |
|
955 |
msgstr ""
|
956 |
|
957 |
#. relative time when something happened in the last 30 seconds
|
958 |
+
#: src/mvc/FileParams.php:149
|
959 |
msgid "Just now"
|
960 |
msgstr ""
|
961 |
|
1025 |
msgid "Loco interrupted by output from %s:%u"
|
1026 |
msgstr ""
|
1027 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1028 |
#. change "en" in the URL to your language if it's available at http://php.net/docs.php
|
1029 |
#: tpl/admin/errors/no-tokenizer.php:17
|
1030 |
msgid ""
|
1044 |
msgid "Loco Translate %s"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
+
#: src/data/Settings.php:171
|
1048 |
msgid ""
|
1049 |
"Loco Translate 2.4 supports third party translation providers. Set up your "
|
1050 |
"API keys in the plugin settings!"
|
1051 |
msgstr ""
|
1052 |
|
1053 |
+
#: src/mvc/AdminController.php:115
|
1054 |
msgid "Loco Translate is powered by"
|
1055 |
msgstr ""
|
1056 |
|
1057 |
+
#: loco.php:140
|
1058 |
+
#, php-format
|
1059 |
+
#| msgid ""
|
1060 |
+
#| "Loco requires the \"%s\" PHP extension. Ask your hosting provider "
|
1061 |
+
#| "to install it"
|
1062 |
+
msgid ""
|
1063 |
+
"Loco Translate requires the \"%s\" PHP extension. Ask your hosting provider "
|
1064 |
+
"to install it"
|
1065 |
+
msgstr ""
|
1066 |
+
|
1067 |
#. Page title for plugin home screen
|
1068 |
#: src/mvc/AdminRouter.php:39
|
1069 |
msgid "Loco, Translation Management"
|
1097 |
msgstr ""
|
1098 |
|
1099 |
#. @var Loco_mvc_ViewParams $verbose
|
1100 |
+
#: tpl/admin/config/settings.php:147
|
1101 |
msgid "Modification of installed files"
|
1102 |
msgstr ""
|
1103 |
|
1143 |
msgid "New template"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: src/admin/init/InitPotController.php:105
|
1147 |
msgid "New template file"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: src/admin/init/InitPotController.php:106
|
1151 |
#, php-format
|
1152 |
msgid "New translations template for \"%s\""
|
1153 |
msgstr ""
|
1182 |
msgid "no wildcards"
|
1183 |
msgstr ""
|
1184 |
|
1185 |
+
#: tpl/admin/config/settings.php:89 tpl/admin/config/settings.php:142
|
1186 |
msgid "Not recommended"
|
1187 |
msgstr ""
|
1188 |
|
1248 |
msgstr[1] ""
|
1249 |
|
1250 |
#. Where %2$s is the maximum size of a file that will be included and %3$s is the largest encountered
|
1251 |
+
#: src/ajax/SyncController.php:80
|
1252 |
#, php-format
|
1253 |
msgid ""
|
1254 |
"One file has been skipped because it's %3$s. (Max is %2$s). Check all "
|
1313 |
msgid "Permission denied to update file"
|
1314 |
msgstr ""
|
1315 |
|
1316 |
+
#: src/package/Plugin.php:225
|
1317 |
#, php-format
|
1318 |
msgid "Plugin not found: %s"
|
1319 |
msgstr ""
|
1407 |
msgid "POT file saved"
|
1408 |
msgstr ""
|
1409 |
|
1410 |
+
#: tpl/admin/config/settings.php:119
|
1411 |
msgid "POT template files"
|
1412 |
msgstr ""
|
1413 |
|
1475 |
msgid "Save config"
|
1476 |
msgstr ""
|
1477 |
|
1478 |
+
#: tpl/admin/config/settings.php:141
|
1479 |
msgid "Save credentials in session"
|
1480 |
msgstr ""
|
1481 |
|
1482 |
+
#: tpl/admin/config/settings.php:193 tpl/admin/config/apis.php:121
|
1483 |
#: tpl/admin/config/prefs.php:44
|
1484 |
msgid "Save settings"
|
1485 |
msgstr ""
|
1536 |
msgstr ""
|
1537 |
|
1538 |
#: src/mvc/AdminRouter.php:67 src/mvc/AdminRouter.php:72
|
1539 |
+
#: src/data/Settings.php:172 tpl/ajax/modal-apis-empty.php:15
|
1540 |
+
#: src/admin/file/EditController.php:163 tpl/admin/common/inc-fsconn.php:18
|
1541 |
#: tpl/admin/common/inc-fsconn.php:43 tpl/admin/errors/no-backups.php:24
|
1542 |
msgid "Settings"
|
1543 |
msgstr ""
|
1620 |
msgid "Support forum"
|
1621 |
msgstr ""
|
1622 |
|
1623 |
+
#: tpl/admin/config/settings.php:102 tpl/admin/config/settings.php:106
|
1624 |
+
msgid "Syncing PO files"
|
1625 |
+
msgstr ""
|
1626 |
+
|
1627 |
#: src/admin/config/DebugController.php:47
|
1628 |
msgid "System diagnostics"
|
1629 |
msgstr ""
|
1634 |
msgid "Template file"
|
1635 |
msgstr ""
|
1636 |
|
1637 |
+
#: src/admin/init/InitPotController.php:57
|
1638 |
msgid "Template file already exists"
|
1639 |
msgstr ""
|
1640 |
|
1796 |
msgstr ""
|
1797 |
|
1798 |
#. Warning when POT file is opened in the file editor. It can be disabled in settings.
|
1799 |
+
#: src/admin/file/EditController.php:162
|
1800 |
msgid ""
|
1801 |
"This is NOT a translation file. Manual editing of source strings is not "
|
1802 |
"recommended."
|
1875 |
msgstr ""
|
1876 |
|
1877 |
#. Where %s is the name of the invalid POT file
|
1878 |
+
#: src/ajax/SyncController.php:62 src/admin/file/EditController.php:124
|
1879 |
#, php-format
|
1880 |
msgid "Translation template is invalid (%s)"
|
1881 |
msgstr ""
|
1882 |
|
1883 |
+
#: src/admin/file/EditController.php:119
|
1884 |
#, php-format
|
1885 |
msgid "Translations don't match template. Run sync to update from %s"
|
1886 |
msgstr ""
|
lib/compiled/gettext.php
CHANGED
@@ -5,17 +5,18 @@
|
|
5 |
interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable { public function getArrayCopy(); }
|
6 |
class LocoHeaders extends ArrayIterator implements LocoArrayInterface { private $map = array(); public function __construct(array $raw = array() ){ if( $raw ){ $keys = array_keys( $raw ); $this->map = array_combine( array_map( 'strtolower', $keys ), $keys ); parent::__construct($raw); } } public function normalize( $key ){ $k = strtolower($key); return isset($this->map[$k]) ? $this->map[$k] : null; } public function add($key, $val ){ $this->offsetSet( $key, $val ); return $this; } public function __toString(){ $pairs = array(); foreach( $this as $key => $val ){ $pairs[] = $key.': '.$val; } return implode("\n", $pairs ); } public function trimmed($prop ){ return trim( $this->__get($prop) ); } public function has($key ){ $k = strtolower($key); return isset($this->map[$k]); } public function __get($key ){ return $this->offsetGet( $key ); } public function __set($key, $val ){ $this->offsetSet( $key, $val ); } public function offsetExists($k ){ return ! is_null( $this->normalize($k) ); } public function offsetGet($k ){ $k = $this->normalize($k); if( is_null($k) ){ return ''; } return parent::offsetGet($k); } public function offsetSet($key, $v ){ $k = strtolower($key); if( isset($this->map[$k]) && $key !== $this->map[$k] ){ parent::offsetUnset( $this->map[$k] ); } $this->map[$k] = $key; parent::offsetSet( $key, $v ); } public function offsetUnset($key ){ $k = strtolower($key); if( isset($this->map[$k]) ){ parent::offsetUnset( $this->map[$k] ); unset( $this->map[$k] ); } } public function jsonSerialize(){ return $this->getArrayCopy(); } public function keys(){ trigger_error('Is this required?', E_USER_NOTICE); return array_values( $this->map ); } }
|
7 |
function loco_normalize_charset( $cs ){ if( preg_match('/^UTF-?8$/i',$cs) ){ return 'UTF-8'; } $aliases = @mb_encoding_aliases($cs); if( false === $aliases ){ throw new InvalidArgumentException('Unsupported character encoding: '.$cs ); } if( $r = preg_grep('/^ISO[-_]\\d+[-_]\\d+$/i',$aliases) ){ $cs = current($aliases); $cs = strtr( strtoupper($cs), '_', '-' ); } else if( in_array('US-ASCII',$aliases,true) ){ $cs = 'US-ASCII'; } return $cs; }
|
8 |
-
class LocoPoHeaders extends LocoHeaders { private
|
9 |
-
function loco_convert_utf8( $str, $enc ){ if( '' === $enc ){ if( false === preg_match('//u',$str) ){ $
|
10 |
-
|
|
|
11 |
function loco_remove_bom( $s, &$c ){ $bom = substr($s,0,2); if( "\xFF\xFE" === $bom ){ $c = 'UTF-16LE'; return substr($s,2); } if( "\xFE\xFF" === $bom ){ $c = 'UTF-16BE'; return substr($s,2); } if( "\xEF\xBB" === $bom && "\xBF" === $s[2] ){ $c = 'UTF-8'; return substr($s,3); } $c = ''; return $s; }
|
12 |
function loco_parse_reference_id( $refs, &$_id ){ if( false === ( $n = strpos($refs,'loco:') ) ){ $_id = ''; return $refs; } $_id = substr($refs, $n+5, 24 ); $refs = substr_replace( $refs, '', $n, 29 ); return trim( $refs ); }
|
13 |
-
class LocoPoParser extends LocoGettextParser implements Iterator { private
|
14 |
class LocoMoParser extends LocoGettextParser { private $bin; private $be; private $n; private $o; private $t; private $v; public function __construct( $bin ){ $this->bin = $bin; } public function getAt( $idx ){ $offset = $this->targetOffset(); $offset += ( $idx * 8 ); $len = $this->integerAt( $offset ); $idx = $this->integerAt( $offset + 4 ); $txt = $this->bytes( $idx, $len ); if( false === strpos( $txt, "\0") ){ return $txt; } return explode( "\0", $txt ); } public function parse( $limit = -1 ){ $i = -1; $r = array(); $sourceOffset = $this->sourceOffset(); $targetOffset = $this->targetOffset(); $soffset = $sourceOffset; $toffset = $targetOffset; while( $soffset < $targetOffset ){ $len = $this->integerAt( $soffset ); $idx = $this->integerAt( $soffset + 4 ); $src = $this->bytes( $idx, $len ); $eot = strpos( $src, "\x04" ); if( false === $eot ){ $context = null; } else { $context = $this->str( substr($src, 0, $eot ) ); $src = substr( $src, $eot+1 ); } $sources = explode( "\0", $src, 2 ); $len = $this->integerAt( $toffset ); $idx = $this->integerAt( $toffset + 4 ); $targets = explode( "\0", $this->bytes( $idx, $len ) ); if( -1 === $i && '' === $sources[0] && is_null($context) ){ $this->setHeader( LocoPoHeaders::fromMsgstr($targets[0]) ); } if( ++$i === $limit ){ break; } $r[$i] = array( 'source' => $this->str( $sources[0] ), 'target' => $this->str( $targets[0] ), 'context' => $context, ); if( isset($sources[1]) ){ $p = count($r) - 1; $nforms = max( 2, count($targets) ); for( $i = 1; $i < $nforms; $i++ ){ $r[] = array( 'source' => isset($sources[$i]) ? $this->str( $sources[$i] ) : sprintf('%s (plural %u)',$r[$p]['source'],$i), 'target' => isset($targets[$i]) ? $this->str( $targets[$i] ) : '', 'parent' => $p, 'plural' => $i, ); } } $soffset += 8; $toffset += 8; } return $r; } public function isBigendian(){ if( is_null($this->be) ){ $str = $this->words( 0, 1 ); if( "\xDE\x12\x04\x95" === $str ){ $this->be = false; } else if( "\x95\x04\x12\xDE" === $str ){ $this->be = true; } else { throw new Loco_error_ParseException('Invalid MO format'); } } return $this->be; } public function version(){ if( is_null($this->v) ){ $this->v = $this->integerWord(1); } return $this->v; } public function count(){ if( is_null($this->n) ){ $this->n = $this->integerWord(2); } return $this->n; } public function sourceOffset(){ if( is_null($this->o) ){ $this->o = $this->integerWord(3); } return $this->o; } public function targetOffset(){ if( is_null($this->t) ){ $this->t = $this->integerWord(4); } return $this->t; } public function getHashTable(){ $s = $this->integerWord(5); $h = $this->integerWord(6); return $this->bytes( $h, $s * 4 ); } private function bytes( $offset, $length ){ $s = substr( $this->bin, $offset, $length ); if( strlen($s) !== $length ){ throw new Loco_error_ParseException('Failed to read '.$length.' bytes at ['.$offset.']' ); } return $s; } private function words( $offset, $length ){ return $this->bytes( $offset * 4, $length * 4 ); } private function integerWord( $offset ){ return $this->integerAt( $offset * 4 ); } private function integerAt( $offset ){ $str = $this->bytes( $offset, 4 ); $fmt = $this->isBigendian() ? 'N' : 'V'; $arr = unpack( $fmt, $str ); if( ! isset($arr[1]) || ! is_int($arr[1]) ){ throw new Loco_error_ParseException('Failed to read integer at byte '.$offset); } return $arr[1]; } }
|
15 |
-
abstract class LocoPo { public static function pair( $key, $text, $width = 79, $eol = "\n", $esc = '\\n' ){ if( '' === $text ){ return $key.' ""'; } $text = addcslashes( $text, "\t\x0B\x0C\x07\x08\\\"" ); if( $esc ) { $text = preg_replace('/(?:\\r\\n?|\\n)/', $esc.$eol, $text, -1, $nbr ); } else { $eol = "\n"; $text = preg_replace_callback('/(?:\\r\\n?|\\n)/',array(__CLASS__,'replace_br'), $text, -1, $nbr ); } if( $nbr ){ } else if( $width && $width < mb_strlen($text,'UTF-8') + strlen($key) + 3 ){ } else { return $key.' "'.$text.'"'; } $lines = array( $key.' "' ); if( $width ){ $width -= 2; $a = '/^.{0,'.($width-1).'}[-– \\.,:;\\?!\\)\\]\\}\\>]/u'; $b = '/^[^-– \\.,:;\\?!\\)\\]\\}\\>]+/u'; foreach( explode($eol,$text) as $unwrapped ){ $length = mb_strlen( $unwrapped, 'UTF-8' ); while( $length > $width ){ if( preg_match( $a, $unwrapped, $r ) ){ $line = $r[0]; } else if( preg_match( $b, $unwrapped, $r ) ){ $line = $r[0]; } else { throw new Exception('Wrapping error'); } $lines[] = $line; $trunc = mb_strlen($line,'UTF-8'); $length -= $trunc; $unwrapped = (string) substr( $unwrapped, strlen($line) ); if( ( '' === $unwrapped && 0 !== $length ) || ( 0 === $length && '' !== $unwrapped ) ){ throw new Exception('Truncation error'); } } if( 0 !== $length ){ $lines[] = $unwrapped; } } } else { foreach( explode($eol,$text) as $unwrapped ){ $lines[] = $unwrapped; } } return implode('"'.$eol.'"',$lines).'"'; } private static function replace_br( array $r ){ return addcslashes($r[0],"\r\n")."\n"; } public static function refs( $text, $width = 76, $eol = "\n" ){ $text = preg_replace('/\\s+/u', ' ', $text ); if( $width ){ $text = wordwrap( $text, $width, $eol.'#: ', false ); } return '#: '.$text; } public static function prefix( $text, $prefix, $eol = "\n" ){ $lines = preg_split('/\\R/u', $text, -
|
16 |
class LocoPoIndex extends ArrayIterator { public function compare( LocoPoMessage $a, LocoPoMessage $b ){ $h = $a->getHash(); if( ! isset($this[$h]) ){ return 1; } $j = $b->getHash(); if( ! isset($this[$j]) ){ return -1; } return $this[$h] > $this[$j] ? 1 : -1; } }
|
17 |
-
class LocoPoMessage extends ArrayObject { public function __construct( array $r ){ $r['key'] = $r['source']; parent::__construct($r); } public function __get( $prop ){ return
|
18 |
-
class LocoPoIterator implements Iterator, Countable { private
|
19 |
class LocoMoTable { private $size = 0; private $bin = ''; private $map; public function __construct( $data = null ){ if( is_array($data) ){ $this->compile( $data ); } else if( $data ){ $this->parse( $data ); } } public function count(){ if( ! isset($this->size) ){ if( $this->bin ){ $this->size = (int) ( strlen( $this->bin ) / 4 ); } else if( is_array($this->map) ){ $this->size = count($this->map); } else { return 0; } if( ! self::is_prime($this->size) || $this->size < 3 ){ throw new Exception('Size expected to be prime number above 2, got '.$this->size); } } return $this->size; } public function bytes(){ return $this->count() * 4; } public function __toString(){ return $this->bin; } public function export(){ if( ! is_array($this->map) ){ $this->parse( $this->bin ); } return $this->map; } private function reset( $length ){ $this->size = max( 3, self::next_prime ( $length * 4 / 3 ) ); $this->bin = null; $this->map = array(); return $this->size; } public function compile( array $msgids ){ $hash_tab_size = $this->reset( count($msgids) ); $packed = array_fill( 0, $hash_tab_size, "\0\0\0\0" ); $j = 0; foreach( $msgids as $msgid ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $hash_tab_size; if( array_key_exists($idx, $this->map) ){ $incr = 1 + ( $hash_val % ( $hash_tab_size - 2 ) ); do { $idx += $incr; if( $hash_val === $idx ){ throw new Exception('Unable to find empty slot in hash table'); } $idx %= $hash_tab_size; } while( array_key_exists($idx, $this->map ) ); } $this->map[$idx] = $j; $packed[$idx] = pack('V', ++$j ); } return $this->bin = implode('',$packed); } public function lookup( $msgid, array $msgids ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $this->size; $incr = 1 + ( $hash_val % ( $this->size - 2 ) ); while( true ){ if( ! array_key_exists($idx, $this->map) ){ break; } $j = $this->map[$idx]; if( isset($msgids[$j]) && $msgid === $msgids[$j] ){ return $j; } $idx += $incr; if( $idx === $hash_val ){ break; } $idx %= $this->size; } return -1; } public function parse( $bin ){ $this->bin = (string) $bin; $this->size = null; $hash_tab_size = $this->count(); $this->map = array(); $idx = -1; $byte = 0; while( ++$idx < $hash_tab_size ){ $word = substr( $this->bin, $byte, 4 ); if( "\0\0\0\0" !== $word ){ list(,$j) = unpack('V', $word ); $this->map[$idx] = $j - 1; } $byte += 4; } return $this->map; } public static function hashpjw( $str ){ $i = -1; $hval = 0; $len = strlen($str); while( ++$i < $len ){ $ord = ord( substr($str,$i,1) ); $hval = ( $hval << 4 ) + $ord; $g = $hval & 0xf0000000; if( $g !== 0 ){ $hval ^= $g >> 24; $hval ^= $g; } } return $hval; } private static function next_prime( $seed ){ $seed |= 1; while ( ! self::is_prime($seed) ){ $seed += 2; } return $seed; } private static function is_prime( $num ) { if ($num === 1 ){ return false; } if( $num === 2 ){ return true; } if( $num % 2 == 0 ) { return false; } for( $i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if($num % $i == 0 ){ return false; } } return true; } }
|
20 |
class LocoMo { private $bin; private $msgs; private $head; private $hash; private $use_fuzzy = false; private $cs; public function __construct( Iterator $export, LocoPoHeaders $head = null ){ if( $head ){ $this->head = $head; } else { $this->head = new LocoPoHeaders; $this->setHeader('Project-Id-Version','Loco'); } $this->msgs = $export; $this->bin = ''; } public function setCharset( $cs ){ $cs = $this->head->setCharset($cs); $this->cs = 'UTF-8' === $cs ? null : $cs; } public function enableHash(){ return $this->hash = new LocoMoTable; } public function useFuzzy(){ $this->use_fuzzy = true; } public function setHeader( $key, $val ){ $this->head->add($key, $val); return $this; } private function str( $s ){ $s = (string) $s; if( $cs = $this->cs ){ $s = mb_convert_encoding($s,$cs,array('UTF-8')); } return $s; } public function compile(){ $table = array(''); $sources = array(''); $targets = array( (string) $this->head ); $fuzzy_flag = 4; $skip_fuzzy = ! $this->use_fuzzy; foreach( $this->msgs as $r ){ if( $skip_fuzzy && isset($r['flag']) && $fuzzy_flag === $r['flag'] ){ continue; } $msgid = $this->str( $r['key'] ); if( isset($r['context']) ){ $msgctxt = $this->str( $r['context'] ); if( '' !== $msgctxt ){ if( '' === $msgid ){ $msgid = '('.$msgctxt.')'; } $msgid = $msgctxt."\x04".$msgid; } } if( '' === $msgid ){ continue; } $msgstr = $this->str( $r['target'] ); if( '' === $msgstr ){ continue; } $table[] = $msgid; if( isset($r['plurals']) ){ foreach( $r['plurals'] as $i => $p ){ if( $i === 0 ){ $msgid .= "\0".$p['key']; } $msgstr .= "\0".$p['target']; } } $sources[] = $msgid; $targets[] = $msgstr; } asort( $sources, SORT_STRING ); $this->bin = "\xDE\x12\x04\x95\x00\x00\x00\x00"; $n = count($sources); $this->writeInteger( $n ); $offset = 28; $this->writeInteger( $offset ); $offset += $n * 8; $this->writeInteger( $offset ); if( $this->hash ){ sort( $table, SORT_STRING ); $this->hash->compile( $table ); $s = $this->hash->count(); } else { $s = 0; } $this->writeInteger( $s ); $offset += $n * 8; $this->writeInteger( $offset ); if( $s ){ $offset += $s * 4; } $source = ''; foreach( $sources as $i => $str ){ $source .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } $target = ''; foreach( array_keys($sources) as $i ){ $str = $targets[$i]; $target .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } if( $this->hash ){ $this->bin .= $this->hash->__toString(); } $this->bin .= $source; $this->bin .= $target; return $this->bin; } private function writeInteger( $num ){ $this->bin .= pack( 'V', $num ); return $this; } }
|
21 |
interface LocoTokensInterface extends Iterator { public function advance(); public function ignore( array $a ); }
|
@@ -23,10 +24,10 @@ class LocoTokenizer implements LocoTokensInterface { const T_LITERAL = 0; const
|
|
23 |
function loco_utf8_chr( $u ){ if( $u < 0x80 ){ if( $u < 0 ){ throw new RangeException( sprintf('%d is out of Unicode range', $u ) ); } return chr($u); } if( $u < 0x800 ) { return chr( ($u>>6) & 0x1F | 0xC0 ).chr( $u & 0x3F | 0x80 ); } if( $u < 0x10000 ) { return chr( $u>>12 & 15 | 0xE0 ).chr( $u>>6 & 0x3F | 0x80 ).chr( $u & 0x3F | 0x80 ); } if( $u < 0x110000 ) { return chr( $u>>18 & 7 | 0xF0 ).chr( $u>>12 & 0x3F | 0x80 ).chr( $u>>6 & 0x3F | 0x80 ).chr( $u & 0x3F | 0x80 ); } throw new RangeException( sprintf('\\x%X is out of Unicode range', $u ) ); }
|
24 |
function loco_resolve_surrogates( $s ){ return preg_replace_callback('/\\xED([\\xA0-\\xAF])([\\x80-\\xBF])\\xED([\\xB0-\\xBF])([\\x80-\\xBF])/', '_loco_resolve_surrogates', $s ); }
|
25 |
function _loco_resolve_surrogates( array $r ){ return loco_utf8_chr ( ( ( ( ( 832 | ( ord($r[1]) & 0x3F ) ) << 6 ) | ( ord($r[2]) & 0x3F ) ) - 0xD800 ) * 0x400 + ( ( ( ( 832 | ( ord($r[3]) & 0x3F ) ) << 6 ) | ( ord($r[4]) & 0x3F ) ) - 0xDC00 ) + 0x10000 ); }
|
26 |
-
class LocoEscapeParser { private
|
27 |
class LocoJsTokens extends LocoTokenizer { const T_KWORD = 1; const T_REGEX = 2; private static $lex; protected static $words = array( 'true' => 1, 'false' => 1, 'null' => 1, 'break' => T_BREAK, 'else' => T_ELSE, 'new' => T_NEW, 'var' => 1, 'case' => T_CASE, 'finally' => T_FINALLY, 'return' => T_RETURN, 'void' => 1, 'catch' => T_CATCH, 'for' => T_FOR, 'switch' => T_SWITCH, 'while' => T_WHILE, 'continue' => T_CONTINUE, 'function' => T_FUNCTION, 'this' => T_STRING, 'with' => 1, 'default' => T_DEFAULT, 'if' => T_IF, 'throw' => T_THROW, 'delete' => 1, 'in' => 1, 'try' => T_TRY, 'do' => T_DO, 'instanceof' => 1, 'typeof' => 1, ); public static function decapse( $encapsed ){ $s = substr($encapsed,1,-1); $l = self::$lex; if( is_null($l) ){ $l = new LocoEscapeParser( array( 'U' => 'U', 'a' => 'a', ) ); self::$lex = $l; } return $l->unescape($s); } public function __construct( $src = '' ){ $this->define('/^(?:\\\\u[0-9A-F]{4,4}|[$_\\pL\\p{Nl}])(?:\\\\u[0-9A-F]{4}|[$_\\pL\\pN\\p{Mn}\\p{Mc}\\p{Pc}])*/ui', array($this,'matchWord') ); $this->define('/^\\s+/u', T_WHITESPACE ); $this->define('!^//.*!', T_COMMENT ); $this->define('!^/\\*.*\\*/!Us', array($this,'matchComment') ); $this->define('/^"(?:\\\\.|[^\\r\\n\\p{Zl}\\p{Zp}"\\\\])*"/u', T_CONSTANT_ENCAPSED_STRING ); $this->define('/^\'(?:\\\\.|[^\\r\\n\\p{Zl}\\p{Zp}\'\\\\])*\'/u', T_CONSTANT_ENCAPSED_STRING ); $this->define('/^[-+;,<>.=:|&^!?*%~(){}[\\]]/'); parent::__construct($src); } public function matchWord( $s ){ if( array_key_exists($s,self::$words) ){ return self::$words[$s]; } return T_STRING; } public function matchComment( $s ){ if( '/**' === substr($s,0,3) ){ return T_DOC_COMMENT; } return T_COMMENT; } }
|
28 |
-
class LocoExtracted implements Countable { private
|
29 |
-
abstract class LocoExtractor { private
|
30 |
class LocoPHPTokens implements LocoTokensInterface, Countable { private $i; private $tokens; private $skip_tokens = array(); private $literal_tokens = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function literal( array $a ){ foreach( $a as $t ){ $this->literal_tokens[ $t ] = 1; } return $this; } public function ignore( array $a ){ foreach( $a as $t ){ $this->skip_tokens[$t] = true; } return $this; } public function export(){ $arr = array(); $this->rewind(); while( $tok = $this->advance() ){ $arr[] = $tok; } return $arr; } public function advance(){ $tok = $this->current(); $this->next(); return $tok; } public function rewind(){ $this->i = ( false === reset($this->tokens) ? null : key($this->tokens) ); } public function valid(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( array_key_exists( is_array($tok) ? $tok[0] : $tok, $this->skip_tokens ) ){ $this->next(); } else { return true; } } return false; } public function key(){ return $this->i; } public function next(){ $this->i = ( false === next($this->tokens) ? null : key($this->tokens) ); } public function current(){ if( ! $this->valid() ){ return false; } $tok = $this->tokens[$this->i]; if( is_array($tok) && isset($this->literal_tokens[$tok[0]]) ){ return $tok[1]; } return $tok; } public function __toString(){ $s = array(); foreach( $this as $token ){ $s[] = is_array($token) ? $token[1] : $token; } return implode('',$s); } public function count(){ return count($this->tokens); } }
|
31 |
class LocoPHPEscapeParser extends LocoEscapeParser { public function __construct(){ parent::__construct( array( 'n' => "\n", 'r' => "\r", 't' => "\t", 'v' => "\x0B", 'f' => "\x0C", 'e' => "\x1B", '$' => '$', '\\' => '\\', '"' => '"', ) ); } protected function stripSlashes( $s ){ return preg_replace_callback('/\\\\(x[0-9A-Fa-f]{1,2}|[0-3]?[0-7]{1,2})/', array($this,'unescapeMatch'), $s, -1, $n ); } }
|
32 |
function loco_unescape_php_string( $s ){ static $l; if( is_null($l) ) { $l = new LocoPHPEscapeParser; } return $l->unescape($s); }
|
@@ -35,7 +36,7 @@ function loco_parse_php_comment($comment){ $comment = trim( $comment,"/ \n\r\t"
|
|
35 |
function loco_parse_wp_comment( $block ){ $header = array(); if( '*' === $block[1] ){ $junk = "\r\t/ *"; foreach( explode("\n", $block) as $line ){ if( false !== ( $i = strpos($line,':') ) ){ $key = substr($line,0,$i); $val = substr($line,++$i); $header[ trim($key,$junk) ] = trim($val,$junk); } } } return $header; }
|
36 |
function loco_sniff_printf( $s, $p, $limit = 0, $offset = 0 ){ $n = 0; while( is_string($s) && '' !== $s && false !== ( $i = strpos($s,'%',$offset) ) ){ if( 0 !== $i ){ $s = substr( $s, $i ); } if( preg_match( $p, $s, $r ) ){ $match = $r[0]; if( 0 < $n && isset($r[1]) && '' === $r[1] && '%' !== substr($match,-1) ){ return 0; } if( ++$n === $limit ){ break; } $offset = strlen($match); } else { return 0; } } return $n; }
|
37 |
function loco_sniff_php_printf( $s, $limit = 0 ){ return loco_sniff_printf( $s, '/^%(?:[1-9]\\d*\\$)?(?:\'.|[-+0 ])*\\d*(?:\\.\\d+)?[suxXbcdeEfFgGo%]/', $limit ); }
|
38 |
-
class LocoPHPExtractor extends LocoExtractor { private $defs = array(); public function tokenize( $src ){ return new LocoPHPTokens( token_get_all($src) ); } public function decapse( $raw ){ return loco_decapse_php_string( $raw ); } public function fsniff( $str ){ return loco_sniff_php_printf($str) ? 'php' : ''; } protected function comment( $comment ){ $comment = loco_parse_php_comment($comment); $comment = preg_replace('/^translators:\\s+/mi', '', $comment ); return $comment; } public function define( $name, $value ){ if( is_string($value) ){ $this->defs[$name] = $value; } return $this; } public function extract( LocoExtracted $strings, LocoTokensInterface $tokens, $fileref = '' ){ $tokens->ignore( array(T_WHITESPACE) ); $n = 0; $depth = 0; $comment = ''; $narg = 0; $args = array(); $ref = ''; $rule = ''; $wp = $this->getHeaders(); $tokens->rewind(); while( $tok = $tokens->advance() ){ if( is_string($tok) ){ $s = $tok; $t = null; } else { $t = $tok[0]; $s = $tok[1]; } if( $depth ){ if( ')' === $s || ']' === $s ){ if( 0 === --$depth ){ if( $this->push( $strings, $rule, $args, $comment, $ref ) ){ $n++; } $comment = ''; } } else if( '(' === $s || '[' === $s ){ $depth++; $args[$narg] = null; } else if( 1 === $depth ){ if( ',' === $s ){ $narg++; } else if( T_CONSTANT_ENCAPSED_STRING === $t ){ $args[$narg] = $this->decapse($s); } else if( T_STRING === $t && array_key_exists($s,$this->defs) ){ $args[$narg] = $this->defs[$s]; } else { $args[$narg] = null; } } } else if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $was_header = false; if( 0 === $n ){ if( false !== strpos($s,'* @package') ){ $was_header = true; } if( $wp && ( $header = loco_parse_wp_comment($s) ) ){ foreach( $wp as $domain => $tags ){ foreach( array_intersect_key($header,$tags) as $tag => $source ){ $strings->pushMeta( $source, $tags[$tag], $domain ); $was_header = true; } } } } if( ! $was_header ) { $comment = $s; } } else if( T_STRING === $t && '(' === $tokens->advance() && ( $rule = $this->rule($s) ) ){ $ref = $fileref ? $fileref.':'.$tok[2]: ''; $depth = 1; $args = array(); $narg = 0; } else if( $comment ){ if( false === stripos($comment, 'translators:') && false === strpos($comment, 'xgettext:') ){ $comment = ''; } } } return $this; } }
|
39 |
function loco_sniff_js_printf( $s, $limit = 0 ){ return loco_sniff_printf( $s, '/^%(?:[1-9]\\d*\\$)?\\+?(?:0|\'[^$])?-?\\d*(?:\\.\\d+)?[b-gijostTuvxX%]/', $limit ); }
|
40 |
class LocoJsExtractor extends LocoPHPExtractor { public function tokenize( $src ){ return new LocoJsTokens($src); } public function fsniff( $str ){ return loco_sniff_js_printf($str) ? 'javascript' : ''; } public function decapse( $encapsed ){ return LocoJsTokens::decapse($encapsed); } }
|
41 |
class LocoTwigExtractor extends LocoPHPExtractor { public function tokenize( $src ){ $src = '<?php '.preg_replace('/{#([^#]+)#}/su','/*\\1*/',$src); return parent::tokenize($src); } }
|
@@ -43,4 +44,5 @@ function loco_wp_extractor( $type = 'php' ){ static $rules = array( '__' => 'sd'
|
|
43 |
function loco_print_percent( $n, $t ){ $s = loco_string_percent( (int) $n, (int) $t ); echo $s,'%'; return ''; }
|
44 |
function loco_print_progress( $translated, $untranslated, $flagged ){ $total = $translated + $untranslated; $complete = loco_string_percent( $translated - $flagged, $total ); $class = 'progress'; if( ! $translated && ! $flagged ){ $class .= ' empty'; } else if( '100' === $complete ){ $class .= ' done'; } echo '<div class="',$class,'"><div class="t">'; if( $flagged ){ $s = loco_string_percent( $flagged, $total ); echo '<div class="bar f" style="width:',$s,'%"> </div>'; } if( '0' === $complete ){ echo ' '; } else { $class = 'bar p'; $p = (int) $complete; $class .= sprintf(' p-%u', 10*floor($p/10) ); $style = 'width:'.$complete.'%'; if( $flagged ){ $remain = 100.0 - (float) $s; $style .= '; max-width: '.sprintf('%s',$remain).'%'; } echo '<div class="',$class,'" style="'.$style.'"> </div>'; } echo '</div><div class="l">',$complete,'%</div></div>'; return ''; }
|
45 |
function loco_string_percent( $n, $t ){ if( ! $t || ! $n ){ $s = '0'; } else if( $t === $n ){ $s = '100'; } else { $dp = 0; $n = 100 * $n / $t; if( $n > 99 ){ $s = number_format( min( $n, 99.9 ), ++$dp ); } else if( $n < 0.5 ){ $n = max( $n, 0.0001 ); do { $s = number_format( $n, ++$dp ); } while( preg_match('/^0\\.0+$/',$s) && $dp < 4 ); $s = substr($s,1); } else { $s = number_format( $n, $dp ); } } return $s; }
|
46 |
-
|
|
5 |
interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable { public function getArrayCopy(); }
|
6 |
class LocoHeaders extends ArrayIterator implements LocoArrayInterface { private $map = array(); public function __construct(array $raw = array() ){ if( $raw ){ $keys = array_keys( $raw ); $this->map = array_combine( array_map( 'strtolower', $keys ), $keys ); parent::__construct($raw); } } public function normalize( $key ){ $k = strtolower($key); return isset($this->map[$k]) ? $this->map[$k] : null; } public function add($key, $val ){ $this->offsetSet( $key, $val ); return $this; } public function __toString(){ $pairs = array(); foreach( $this as $key => $val ){ $pairs[] = $key.': '.$val; } return implode("\n", $pairs ); } public function trimmed($prop ){ return trim( $this->__get($prop) ); } public function has($key ){ $k = strtolower($key); return isset($this->map[$k]); } public function __get($key ){ return $this->offsetGet( $key ); } public function __set($key, $val ){ $this->offsetSet( $key, $val ); } public function offsetExists($k ){ return ! is_null( $this->normalize($k) ); } public function offsetGet($k ){ $k = $this->normalize($k); if( is_null($k) ){ return ''; } return parent::offsetGet($k); } public function offsetSet($key, $v ){ $k = strtolower($key); if( isset($this->map[$k]) && $key !== $this->map[$k] ){ parent::offsetUnset( $this->map[$k] ); } $this->map[$k] = $key; parent::offsetSet( $key, $v ); } public function offsetUnset($key ){ $k = strtolower($key); if( isset($this->map[$k]) ){ parent::offsetUnset( $this->map[$k] ); unset( $this->map[$k] ); } } public function jsonSerialize(){ return $this->getArrayCopy(); } public function keys(){ trigger_error('Is this required?', E_USER_NOTICE); return array_values( $this->map ); } }
|
7 |
function loco_normalize_charset( $cs ){ if( preg_match('/^UTF-?8$/i',$cs) ){ return 'UTF-8'; } $aliases = @mb_encoding_aliases($cs); if( false === $aliases ){ throw new InvalidArgumentException('Unsupported character encoding: '.$cs ); } if( $r = preg_grep('/^ISO[-_]\\d+[-_]\\d+$/i',$aliases) ){ $cs = current($aliases); $cs = strtr( strtoupper($cs), '_', '-' ); } else if( in_array('US-ASCII',$aliases,true) ){ $cs = 'US-ASCII'; } return $cs; }
|
8 |
+
class LocoPoHeaders extends LocoHeaders { private $cs = null; public function getCharset(){ $cs = $this->cs; if( is_null($cs) ){ $cs = ''; $raw = $this->offsetGet('content-type'); if( $raw && preg_match('!\\bcharset[= ]+([-\\w]+)!',$raw,$r) ){ try { $cs = loco_normalize_charset($r[1]); } catch( InvalidArgumentException $e ){ $cs = null; } catch( Throwable $e ){ trigger_error( $e->getMessage(), E_USER_NOTICE ); $cs = null; } } $this->cs = $cs; } return $cs; } public function setCharset( $to ){ $to = loco_normalize_charset($to); $from = $this->getCharset(); $this->cs = $to; $this['Content-Type'] = 'text/plain; charset='.$to; if( $from && $from !== $to ){ foreach( $this as $key => $val ){ $this[$key] = mb_convert_encoding($val,$to,$from); } } return $to; } public static function fromMsgstr( $str ){ $headers = new LocoPoHeaders; $key = ''; foreach( preg_split('/[\\r\\n]+/',$str) as $line ){ $i = strpos($line,':'); if( is_int($i) ){ $key = trim( substr($line,0,$i), " \t" ); $headers->offsetSet( $key, ltrim( substr($line,++$i)," \t" ) ); } else if( '' !== $key ){ $headers->offsetSet( $key, $headers->offsetGet($key)."\n".$line ); } } $cs = $headers->getCharset(); if( $cs && 'UTF-8' !== $cs && 'UTF-8' !== mb_detect_encoding($str,array('UTF-8',$cs),true) ){ foreach( $headers as $key => $val ){ $headers[$key] = mb_convert_encoding($val,'UTF-8',array($cs)); } } return $headers; } public static function fromSource( $raw ){ $po = new LocoPoParser($raw); $po->parse(0); return $po->getHeader(); } }
|
9 |
+
function loco_convert_utf8( $str, $enc, $strict ){ if( '' === $enc || 'UTF-8' === $enc || 'US-ASCII' === $enc ){ if( false === preg_match('//u',$str) ){ if( $strict ){ $e = new Loco_error_ParseException( $enc ? 'Invalid '.$enc.' encoding' : 'Unknown character encoding' ); if( preg_match('/^(?:[\\x00-\\x7F]|[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xFF][\\x80-\\xBF]{3})*/',$str,$r) && $str !== $r[0] ){ $e->setOffsetContext( strlen($r[0]), $str ); } throw $e; } $str = loco_fix_utf8($str); } } else if( 'ISO-8859-1' === $enc ) { $str = mb_convert_encoding( $str, 'UTF-8', 'cp1252' ); } else { $str = mb_convert_encoding( $str, 'UTF-8', $enc ); } return $str; }
|
10 |
+
function loco_fix_utf8( $str ){ $fix = ''; while( is_string($str) && '' !== $str ){ if( preg_match('/^(?:[\\x00-\\x7F]|[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xFF][\\x80-\\xBF]{3})+/',$str,$r) ){ $fix .= $r[0]; $str = substr($str, strlen($r[0]) ); } else { $fix.= mb_convert_encoding( $str[0], 'UTF-8', 'cp1252' ); $str = substr($str,1); } } return loco_convert_utf8($fix,'',true); }
|
11 |
+
abstract class LocoGettextParser { private $head = null; private $cs = ''; abstract public function parse( $limit = -1 ); protected function setHeader( LocoPoHeaders $head ){ $this->head = $head; $cs = $head->getCharset(); if( is_string($cs) && '' !== $cs ){ if( '' === $this->cs ){ $this->setCharset($cs); } } return $head; } public function getHeader(){ return $this->head; } protected function setCharset( $cs ){ $this->cs = $cs; } protected function getCharset(){ return $this->cs; } protected function str( $str ){ if( '' !== $str ){ $str = loco_convert_utf8($str,$this->cs,false); } return $str; } }
|
12 |
function loco_remove_bom( $s, &$c ){ $bom = substr($s,0,2); if( "\xFF\xFE" === $bom ){ $c = 'UTF-16LE'; return substr($s,2); } if( "\xFE\xFF" === $bom ){ $c = 'UTF-16BE'; return substr($s,2); } if( "\xEF\xBB" === $bom && "\xBF" === $s[2] ){ $c = 'UTF-8'; return substr($s,3); } $c = ''; return $s; }
|
13 |
function loco_parse_reference_id( $refs, &$_id ){ if( false === ( $n = strpos($refs,'loco:') ) ){ $_id = ''; return $refs; } $_id = substr($refs, $n+5, 24 ); $refs = substr_replace( $refs, '', $n, 29 ); return trim( $refs ); }
|
14 |
+
class LocoPoParser extends LocoGettextParser implements Iterator { private $lines = array(); private $i; private $k; private $m; public function __construct( $src ){ if( '' !== $src ){ $src = loco_remove_bom($src,$cs); if( $cs && 'UTF-8' !== $cs ){ $src = mb_convert_encoding( $src, 'UTF-8', $cs ); $cs = 'UTF-8'; } if( 'UTF-8' === $cs ){ $this->setCharset('UTF-8'); } $this->lines = preg_split('/(\\r\\n?|\\n)/', $src ); } } public function rewind(){ $this->i = -1; $this->k = -1; $this->next(); } public function valid(){ return is_int($this->i); } public function key(){ return $this->k; } public function current(){ return $this->m; } public function next(){ $valid = false; $entry = array( '#' => array(), 'id' => array(null), 'str' => array(null) ); $i = $this->i; while( array_key_exists(++$i,$this->lines) ){ $line = $this->lines[$i]; try { if( '' === $line ){ if( $valid ){ break; } continue; } $c = $line[0]; if( '#' === $c ){ if( $valid ){ $i--; break; } if( '#' === $line ){ continue; } $f = $line[1]; $entry['#'][$f][] = trim( substr( $line, 1+strlen($f) ), "/ \n\r\t" ); } else if( preg_match('/^msg(id(?:_plural)?|ctxt|str(?:\\[(\\d+)])?)[ \\t]*/', $line, $r ) ){ if( isset($r[2]) ){ $key = 'str'; $idx = (int) $r[2]; } else { $key = $r[1]; $idx = 0; } if( $valid && 'str' !== $key && null !== $entry['str'][0] ){ $i--; break; } $snip = strlen($r[0]); if( '"' !== substr($line,$snip,1) ){ throw new Exception('Expected " to follow msg'.$key); } $val = ''; $line = substr($line,$snip); while( true ){ if( '"' === $line || '"' !== substr($line,-1) ){ throw new Exception('Unterminated msg'.$key ); } $val .= substr( $line, 1, -1 ); $j = $i + 1; if( array_key_exists($j,$this->lines) && ( $line = $this->lines[$j] ) && '"' === $line[0] ){ $i = $j; } else { break; } } if( ! $valid ){ $valid = true; } if( 'id_plural' === $key ){ $key = 'id'; $idx = 1; } $entry[$key][$idx] = stripcslashes($val); } else if( preg_match('/^[ \\t]+$/',$line) ){ if( $valid ) { break; } } else if( '"' === $c ){ throw new Exception('String encountered without keyword'); } else { throw new Exception('Junk'); } } catch( Exception $e ){ } } if( $valid ){ ++$this->k; $this->i = $i; $this->m = $entry; } else { $this->i = null; $this->k = null; $this->m = null; } } public function parse( $limit = -1 ){ $this->rewind(); if( ! $this->valid() ){ throw new Loco_error_ParseException('Invalid PO file'); } $i = -1; $assets = array(); $entry = $this->current(); if( '' !== $entry['id'][0] || isset($entry['ctxt']) || is_null($entry['str'][0]) ){ $head = $this->setHeader( new LocoPoHeaders ); } else { $head = $this->setHeader( LocoPoHeaders::fromMsgstr($entry['str'][0]) ); } $lk = $head['X-Loco-Lookup']; while( $this->valid() ){ $entry = $this->current(); $this->next(); $msgid = $entry['id'][0]; if( is_null($msgid) ){ continue; } if( ++$i === $limit ){ return $assets; } $asset = array( 'source' => $this->str( $msgid ), 'target' => $this->str( (string) $entry['str'][0] ), 'context' => null, ); $prev_entry = null; if( isset($entry['ctxt']) ){ $asset['context'] = $this->str( $entry['ctxt'][0] ); } $cmt = $entry['#']; if( isset($cmt[' ']) ){ $asset['comment'] = $this->str( implode("\n", $cmt[' '] ) ); } if( isset($cmt['.']) ){ $asset['notes'] = $this->str( implode("\n", $cmt['.'] ) ); } if( isset($cmt[':']) ){ if( $refs = implode( ' ', $cmt[':'] ) ) { $refs = $this->str($refs); if( $refs = loco_parse_reference_id( $refs, $_id ) ){ $asset['refs'] = $refs; } if( $_id ){ $asset['_id'] = $_id; } } } if( isset($cmt[',']) ){ foreach( $cmt[','] as $flags ){ foreach( explode(',',$flags) as $flag ){ if( $flag = trim($flag," \t") ){ if( preg_match('/^((?:no-)?\w+)-format/', $flag, $r ) ){ $asset['format'] = $r[1]; } else if( 'fuzzy' === $flag ){ $asset['flag'] = 4; } } } } } if( isset($cmt['|']) ){ $p = new LocoPoParser(''); $p->lines = $cmt['|']; $p->setCharset( $this->getCharset() ); try { $prev_entry = $p->parse(); } catch( Loco_error_ParseException $e ){ } if( $prev_entry ){ $msgid = $prev_entry[0]['source']; if( $lk && 'text' !== $lk ){ $asset[$lk] = $asset['source']; $asset['source'] = $msgid; } else if( 'loco:' === substr($msgid,0,5) ){ $asset['_id'] = substr($msgid,5); } else { $asset['prev'] = $prev_entry; $prev_entry = null; } } } $assets[] = $asset; if( isset($entry['id'][1]) ){ $idx = 0; $pidx = count($assets) - 1; $num = max( 2, count($entry['str']) ); while( ++$idx < $num ){ $plural = array( 'source' => '', 'target' => isset($entry['str'][$idx]) ? $this->str($entry['str'][$idx]) : '', 'plural' => $idx, 'parent' => $pidx, ); if( 1 === $idx ){ $plural['source'] = $this->str($entry['id'][1]); if( is_array($prev_entry) && isset($prev_entry[1]) ){ if( $lk && 'text' !== $lk ){ $plural[$lk] = $plural['source']; $plural['source'] = $prev_entry[1]['source']; } } } if( isset($asset['flag']) ){ $plural['flag'] = $asset['flag']; } $assets[] = $plural; } } } if( -1 === $i ){ throw new Loco_error_ParseException('Invalid PO file'); } else if( 0 === $i && '' === $assets[0]['source'] && '' === $assets[0]['target'] ){ throw new Loco_error_ParseException('Invalid PO file' ); } return $assets; } }
|
15 |
class LocoMoParser extends LocoGettextParser { private $bin; private $be; private $n; private $o; private $t; private $v; public function __construct( $bin ){ $this->bin = $bin; } public function getAt( $idx ){ $offset = $this->targetOffset(); $offset += ( $idx * 8 ); $len = $this->integerAt( $offset ); $idx = $this->integerAt( $offset + 4 ); $txt = $this->bytes( $idx, $len ); if( false === strpos( $txt, "\0") ){ return $txt; } return explode( "\0", $txt ); } public function parse( $limit = -1 ){ $i = -1; $r = array(); $sourceOffset = $this->sourceOffset(); $targetOffset = $this->targetOffset(); $soffset = $sourceOffset; $toffset = $targetOffset; while( $soffset < $targetOffset ){ $len = $this->integerAt( $soffset ); $idx = $this->integerAt( $soffset + 4 ); $src = $this->bytes( $idx, $len ); $eot = strpos( $src, "\x04" ); if( false === $eot ){ $context = null; } else { $context = $this->str( substr($src, 0, $eot ) ); $src = substr( $src, $eot+1 ); } $sources = explode( "\0", $src, 2 ); $len = $this->integerAt( $toffset ); $idx = $this->integerAt( $toffset + 4 ); $targets = explode( "\0", $this->bytes( $idx, $len ) ); if( -1 === $i && '' === $sources[0] && is_null($context) ){ $this->setHeader( LocoPoHeaders::fromMsgstr($targets[0]) ); } if( ++$i === $limit ){ break; } $r[$i] = array( 'source' => $this->str( $sources[0] ), 'target' => $this->str( $targets[0] ), 'context' => $context, ); if( isset($sources[1]) ){ $p = count($r) - 1; $nforms = max( 2, count($targets) ); for( $i = 1; $i < $nforms; $i++ ){ $r[] = array( 'source' => isset($sources[$i]) ? $this->str( $sources[$i] ) : sprintf('%s (plural %u)',$r[$p]['source'],$i), 'target' => isset($targets[$i]) ? $this->str( $targets[$i] ) : '', 'parent' => $p, 'plural' => $i, ); } } $soffset += 8; $toffset += 8; } return $r; } public function isBigendian(){ if( is_null($this->be) ){ $str = $this->words( 0, 1 ); if( "\xDE\x12\x04\x95" === $str ){ $this->be = false; } else if( "\x95\x04\x12\xDE" === $str ){ $this->be = true; } else { throw new Loco_error_ParseException('Invalid MO format'); } } return $this->be; } public function version(){ if( is_null($this->v) ){ $this->v = $this->integerWord(1); } return $this->v; } public function count(){ if( is_null($this->n) ){ $this->n = $this->integerWord(2); } return $this->n; } public function sourceOffset(){ if( is_null($this->o) ){ $this->o = $this->integerWord(3); } return $this->o; } public function targetOffset(){ if( is_null($this->t) ){ $this->t = $this->integerWord(4); } return $this->t; } public function getHashTable(){ $s = $this->integerWord(5); $h = $this->integerWord(6); return $this->bytes( $h, $s * 4 ); } private function bytes( $offset, $length ){ $s = substr( $this->bin, $offset, $length ); if( strlen($s) !== $length ){ throw new Loco_error_ParseException('Failed to read '.$length.' bytes at ['.$offset.']' ); } return $s; } private function words( $offset, $length ){ return $this->bytes( $offset * 4, $length * 4 ); } private function integerWord( $offset ){ return $this->integerAt( $offset * 4 ); } private function integerAt( $offset ){ $str = $this->bytes( $offset, 4 ); $fmt = $this->isBigendian() ? 'N' : 'V'; $arr = unpack( $fmt, $str ); if( ! isset($arr[1]) || ! is_int($arr[1]) ){ throw new Loco_error_ParseException('Failed to read integer at byte '.$offset); } return $arr[1]; } }
|
16 |
+
abstract class LocoPo { public static function pair( $key, $text, $width = 79, $eol = "\n", $esc = '\\n' ){ if( '' === $text ){ return $key.' ""'; } $text = addcslashes( $text, "\t\x0B\x0C\x07\x08\\\"" ); if( $esc ) { $text = preg_replace('/(?:\\r\\n?|\\n)/', $esc.$eol, $text, -1, $nbr ); } else { $eol = "\n"; $text = preg_replace_callback('/(?:\\r\\n?|\\n)/',array(__CLASS__,'replace_br'), $text, -1, $nbr ); } if( $nbr ){ } else if( $width && $width < mb_strlen($text,'UTF-8') + strlen($key) + 3 ){ } else { return $key.' "'.$text.'"'; } $lines = array( $key.' "' ); if( $width ){ $width -= 2; $a = '/^.{0,'.($width-1).'}[-– \\.,:;\\?!\\)\\]\\}\\>]/u'; $b = '/^[^-– \\.,:;\\?!\\)\\]\\}\\>]+/u'; foreach( explode($eol,$text) as $unwrapped ){ $length = mb_strlen( $unwrapped, 'UTF-8' ); while( $length > $width ){ if( preg_match( $a, $unwrapped, $r ) ){ $line = $r[0]; } else if( preg_match( $b, $unwrapped, $r ) ){ $line = $r[0]; } else { throw new Exception('Wrapping error'); } $lines[] = $line; $trunc = mb_strlen($line,'UTF-8'); $length -= $trunc; $unwrapped = (string) substr( $unwrapped, strlen($line) ); if( ( '' === $unwrapped && 0 !== $length ) || ( 0 === $length && '' !== $unwrapped ) ){ throw new Exception('Truncation error'); } } if( 0 !== $length ){ $lines[] = $unwrapped; } } } else { foreach( explode($eol,$text) as $unwrapped ){ $lines[] = $unwrapped; } } return implode('"'.$eol.'"',$lines).'"'; } private static function replace_br( array $r ){ return addcslashes($r[0],"\r\n")."\n"; } public static function refs( $text, $width = 76, $eol = "\n" ){ $text = preg_replace('/\\s+/u', ' ', $text ); if( $width ){ $text = wordwrap( $text, $width, $eol.'#: ', false ); } return '#: '.$text; } public static function prefix( $text, $prefix, $eol = "\n" ){ return $prefix . implode($eol.$prefix, self::split($text) ); } public static function split( $text ){ $lines = preg_split('/\\R/u', $text ); if( false === $lines ){ if( false === preg_match('//u',$text) ){ $text = mb_convert_encoding( $text, 'UTF-8', 'cp1252' ); } $lines = preg_split('/\\r?\\n+/', $text ); } return $lines; } public static function trim( $text ){ $lines = array(); $deferred = null; foreach( explode("\n",$text) as $line ){ if( '' === $line ){ continue; } if( preg_match('/^msg[a-z]+(?:\\[\\d+])? ""/',$line) ){ $deferred = $line; continue; } if( $deferred && '"' === $line[0] ){ $lines[] = $deferred; $deferred = null; } $lines[] = $line; } return implode("\n",$lines); } }
|
17 |
class LocoPoIndex extends ArrayIterator { public function compare( LocoPoMessage $a, LocoPoMessage $b ){ $h = $a->getHash(); if( ! isset($this[$h]) ){ return 1; } $j = $b->getHash(); if( ! isset($this[$j]) ){ return -1; } return $this[$h] > $this[$j] ? 1 : -1; } }
|
18 |
+
class LocoPoMessage extends ArrayObject { public function __construct( array $r ){ $r['key'] = $r['source']; parent::__construct($r); } public function __get( $prop ){ return $this->offsetExists($prop) ? $this->offsetGet($prop) : null; } private function _getFlags(){ $flags = array(); $plurals = $this->__get('plurals'); if( 4 === $this->__get('flag') ){ $flags[] = 'fuzzy'; } else if( $plurals ){ foreach( $plurals as $child ){ if( 4 === $child->__get('flag') ){ $flags[] = 'fuzzy'; break; } } } if( $f = $this->__get('format') ){ $flags[] = $f.'-format'; } else if( isset($plurals[0]) && ( $f = $plurals[0]->format ) ){ $flags[] = $f.'-format'; } return $flags; } public function getHash(){ $hash = $this->getKey(); if( $this->offsetExists('plurals') ){ foreach( $this['plurals'] as $p ){ $hash .= "\0".$p->getHash(); break; } } return $hash; } public function getKey(){ $msgid = (string) $this['source']; $msgctxt = (string) $this->__get('context'); if( '' !== $msgctxt ){ if( '' === $msgid ){ $msgid = '('.$msgctxt.')'; } $msgid = $msgctxt."\4".$msgid; } return $msgid; } public function __toString(){ return $this->render( 79, 76 ); } public function render( $width, $ref_width ){ $s = array(); try { if( $text = $this->__get('comment') ) { $s[] = LocoPo::prefix( $text, '# '); } if( $text = $this->__get('notes') ) { $s[] = LocoPo::prefix( $text, '#. '); } if( $text = $this->__get('refs') ){ $s[] = LocoPo::refs( $text, $ref_width ); } if( $texts = $this->_getFlags() ){ $s[] = '#, '.implode(', ',$texts); } $prev = $this->__get('prev'); if( is_array($prev) && $prev ){ foreach( new LocoPoIterator($prev) as $p ){ $text = $p->render( max(0,$width-3), 0 ); $s[] = LocoPo::prefix( LocoPo::trim($text),'#| '); break; } } $text = $this->__get('context'); if( is_string($text) && '' !== $text ){ $s[] = LocoPo::pair('msgctxt', $text, $width ); } $s[] = LocoPo::pair( 'msgid', $this['source'], $width ); $target = $this['target']; $plurals = $this->__get('plurals'); if( is_array($plurals) ){ if( $plurals ){ foreach( $plurals as $i => $p ){ if( 0 === $i ){ $s[] = LocoPo::pair('msgid_plural', $p['source'], $width ); $s[] = LocoPo::pair('msgstr[0]', $target, $width ); } $s[] = LocoPo::pair('msgstr['.(++$i).']', $p['target'], $width ); } } else if( isset($this['plural_key']) ){ $s[] = LocoPo::pair('msgid_plural', $this['plural_key'], $width ); $s[] = LocoPo::pair('msgstr[0]', $target, $width ); } else { trigger_error('Missing plural_key in zero plural export'); $s[] = LocoPo::pair('msgstr', $target, $width ); } } else { $s[] = LocoPo::pair('msgstr', $target, $width ); } } catch( Exception $e ){ trigger_error( $e->getMessage(), E_USER_WARNING ); } return implode("\n",$s)."\n"; } public function merge( LocoPoMessage $def, $translate = false ){ if( $def->getHash() !== $this->getHash() ){ $prev = array( 'source' => '', 'target' => '' ); $prev = $this->diff('source',$def,$prev); $prev = $this->diff('context',$def,$prev); $this['flag'] = 4; $this['prev'] = array( $prev ); $defPlural = $def->getPlural(0); $ourPlural = $this->getPlural(0); if( $defPlural && $ourPlural ) { $ourPlural->merge($defPlural); if( $ourPlural->offsetExists('prev') ) { $this['prev'][] = $ourPlural->prev[0]+array('parent'=>0,'plural'=>1); $ourPlural->offsetUnset('prev'); } } else if( $defPlural ){ $this['plurals'] = array( clone $defPlural ); } else if( $ourPlural ){ $this['prev'][] = $ourPlural->exportBasic() + array('parent'=>0,'plural'=>1); $this->offsetUnset('plurals'); } } foreach( array('notes','refs') as $f ){ if( $def->offsetExists($f) ){ $this->offsetSet($f,$def->offsetGet($f)); } else if( $this->offsetExists($f) ){ $this->offsetUnset($f); } } if( $translate && '' === $this['target'] && '' !== $def['target'] ){ $this['target'] = $def['target']; if( $def->offsetExists('comment') ) { $this['comment'] = $def['comment']; } if( $this->offsetExists('plurals') ){ foreach( $this['plurals'] as $i => $ourPlural ){ if( '' === $ourPlural['target'] ){ $defPlural = $def->getPlural($i); if( $defPlural ){ $ourPlural['target'] = $defPlural['target']; } } } } } } private function diff( $key, LocoPoMessage $def, array $prev ){ $old = $this->__get($key); $new = $def->__get($key); if( $new !== $old ){ $this->offsetSet($key,$new); if( is_string($old) && '' !== $old ){ $prev[$key] = $old; } } return $prev; } private function getPlural( $i ){ if( $this->offsetExists('plurals') ){ $plurals = $this->offsetGet('plurals'); if( is_array($plurals) && array_key_exists($i,$plurals) ){ return $plurals[$i]; } } return null; } private function exportBasic(){ return array( 'source' => $this['source'], 'context' => $this->context, 'target' => '', ); } public function export(){ $a = $this->getArrayCopy(); unset($a['key']); return $a; } public function countForms(){ $len = 1; if( $this->offsetExists('plurals') ){ $plurals = $this->offsetGet('plurals'); $len += count($plurals); } return $len; } public function strip(){ $this['target'] = ''; $plurals = $this->plurals; if( is_array($plurals) ){ foreach( $plurals as $p ){ $p->strip(); } } return $this; } }
|
19 |
+
class LocoPoIterator implements Iterator, Countable { private $po; private $headers = null; private $i; private $t; private $j; private $z = 0; private $w = 79; public function __construct( $po ){ if( is_array($po) ){ $this->po = $po; } else if( $po instanceof Traversable ){ $this->po = iterator_to_array($po,false); } else { throw new InvalidArgumentException('PO data must be array or iterator'); } $this->t = count($po); if( 0 === $this->t ){ throw new InvalidArgumentException('Empty PO data'); } $h = $po[0]; if( '' !== $h['source'] || ( isset($h['context']) && '' !== $h['context'] ) || ( isset($po[1]['parent']) && 0 === $po[1]['parent'] ) ){ $this->z = -1; } } public function push( LocoPoMessage $p ){ $raw = $p->export(); $plurals = $p->plurals; unset($raw['plurals']); $i = count($this->po); $this->po[$i] = $raw; $this->t++; if( is_array($plurals) ) { $j = 0; foreach( $plurals as $p ) { $raw = $p->export(); $raw['parent'] = $i; $raw['plural'] = ++$j; $this->po[] = $raw; $this->t++; } } } public function __clone(){ if( $this->headers ){ $this->headers = new LocoPoHeaders( $this->headers->getArrayCopy() ); } } public function count(){ return $this->t - ( $this->z + 1 ); } public function wrap( $width ){ $width = (int) $width; if( $width > 0 ){ $this->w = max( 15, $width ); } else { $this->w = 0; } return $this; } public function rewind(){ $this->i = $this->z; $this->j = -1; $this->next(); } public function key(){ return $this->j; } public function valid(){ return is_int($this->i); } public function next(){ $i = $this->i; while( ++$i < $this->t ){ if( array_key_exists('parent',$this->po[$i]) ){ continue; } $this->j++; $this->i = $i; return; } $this->i = null; $this->j = null; } public function current(){ $i = $this->i; $po = $this->po; $parent = new LocoPoMessage( $po[$i] ); $plurals = array(); $nonseq = $parent->offsetExists('child'); $j = $nonseq ? $parent['child'] : $i+1; while( isset($po[$j]['parent']) && $i === $po[$j]['parent'] ){ $plurals[] = new LocoPoMessage($po[$j++]); } if( $plurals ){ $parent['plurals'] = $plurals; } return $parent; } public function getArrayCopy(){ $po = $this->po; if( 0 === $this->z ){ $po[0]['target'] = (string) $this->getHeaders(); } return $po; } public function clear(){ if( 0 === $this->z ){ $this->po = array( $this->po[0] ); $this->t = 1; } else { $this->po = array(); $this->t = 0; } } public function getHeaders(){ if( is_null($this->headers) ){ $header = $this->po[0]; if( 0 === $this->z ){ $this->headers = LocoPoHeaders::fromMsgstr( $header['target'] ); } else { $this->headers = new LocoPoHeaders; } } return $this->headers; } public function initPo(){ if( 0 === $this->z ){ unset( $this->po[0]['flag'] ); } return $this; } public function initPot(){ if( 0 === $this->z ){ $this->po[0]['flag'] = 4; } return $this; } public function strip(){ $po = $this->po; $i = count($po); $z = $this->z; while( --$i > $z ){ $po[$i]['target'] = ''; } $this->po = $po; return $this; } public function __toString(){ try { return $this->render(); } catch( Exception $e ){ trigger_error( $e->getMessage(), E_USER_WARNING ); return ''; } } public function render( $sorter = null ){ $width = $this->w; $ref_width = max( 0, $width - 3 ); if( 0 === $this->z ){ $h = $this->po[0]; } else { $h = array( 'source' => '' ); } $h['target'] = (string) $this->getHeaders(); $msg = new LocoPoMessage( $h ); $s = $msg->render( $width, $ref_width ); if( $sorter ){ if( ! is_callable($sorter) ){ throw new InvalidArgumentException('Bad callback'); } $msgs = array(); foreach( $this as $msg ){ $msgs[] = $msg; } usort( $msgs, $sorter ); } else { $msgs = $this; } foreach( $msgs as $msg ){ $s .= "\n".$msg->render( $width, $ref_width ); } return $s; } public function exportRefs( $grep = '' ){ $a = array(); if( '' === $grep ) { $grep = '/(\\S+):\\d+/'; } else { $grep = '/(\\S*'.$grep.'):\\d+/'; } foreach( $this as $message ){ if( preg_match_all( $grep, (string) $message->refs, $r ) ){ foreach( $r[1] as $ref ) { $a[$ref][] = $message; } } } return $a; } public function splitRefs( array $map = null ){ $a = array(); foreach( $this as $message ){ $refs = ltrim( (string) $message->refs ); if( '' !== $refs ){ if( preg_match_all('/\\S+\\.([a-z]+):\\d+/', $refs, $r, PREG_SET_ORDER ) ){ $tmp = array(); foreach( $r as $rr ) { list( $ref, $ext ) = $rr; $tmp[$ext][$ref] = true; } foreach( $tmp as $ext => $refs ){ if( is_array($map) ){ if( isset($map[$ext]) ){ $ext = $map[$ext]; } else { continue; } } $message = clone $message; $message['refs'] = implode(' ',array_keys($refs) ); $a[$ext][] = $message; } } } } return $a; } public function getHashes(){ $a = array(); foreach( $this as $msg ){ $a[] = $msg->getHash(); } sort( $a, SORT_STRING ); return $a; } public function equalSource( LocoPoIterator $that ){ $a = $this->getHashes(); $b = $that->getHashes(); if( count($a) !== count($b) ){ return false; } foreach( $a as $i => $hash ){ if( $hash !== $b[$i] ){ return false; } } return true; } public function equal( LocoPoIterator $that ){ if( $this->t !== $that->t ){ return false; } $i = $this->z; $fields = array( 'source', 'context', 'notes', 'refs', 'target', 'comment', 'flag', 'parent', 'plural' ); while( ++$i < $this->t ){ $a = $this->po[$i]; $b = $that->po[$i]; foreach( $fields as $f ){ $af = isset($a[$f]) ? $a[$f] : ''; $bf = isset($b[$f]) ? $b[$f] : ''; if( $af !== $bf ){ return false; } } } return true; } public function sort( $func = null ){ $order = array(); foreach( $this as $msg ){ $order[] = $msg; } if( is_null($func) ){ $func = array( __CLASS__, 'compare' ); } else if( ! is_callable($func) ){ throw new InvalidArgumentException('Bad callback'); } usort( $order, $func ); $this->clear(); foreach( $order as $p ){ $this->push($p); } return $this; } public static function compare( LocoPoMessage $a, LocoPoMessage $b ){ $h = $a->getHash(); $j = $b->getHash(); $n = strcasecmp( $h, $j ); if( 0 === $n ){ $n = strcmp( $h, $j ); if( 0 === $n ){ return 0; } } return $n > 0 ? 1 : -1; } public function createSorter(){ $index = array(); foreach( $this as $i => $msg ){ $index[ $msg->getHash() ] = $i; } $obj = new LocoPoIndex( $index ); return array( $obj, 'compare' ); } }
|
20 |
class LocoMoTable { private $size = 0; private $bin = ''; private $map; public function __construct( $data = null ){ if( is_array($data) ){ $this->compile( $data ); } else if( $data ){ $this->parse( $data ); } } public function count(){ if( ! isset($this->size) ){ if( $this->bin ){ $this->size = (int) ( strlen( $this->bin ) / 4 ); } else if( is_array($this->map) ){ $this->size = count($this->map); } else { return 0; } if( ! self::is_prime($this->size) || $this->size < 3 ){ throw new Exception('Size expected to be prime number above 2, got '.$this->size); } } return $this->size; } public function bytes(){ return $this->count() * 4; } public function __toString(){ return $this->bin; } public function export(){ if( ! is_array($this->map) ){ $this->parse( $this->bin ); } return $this->map; } private function reset( $length ){ $this->size = max( 3, self::next_prime ( $length * 4 / 3 ) ); $this->bin = null; $this->map = array(); return $this->size; } public function compile( array $msgids ){ $hash_tab_size = $this->reset( count($msgids) ); $packed = array_fill( 0, $hash_tab_size, "\0\0\0\0" ); $j = 0; foreach( $msgids as $msgid ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $hash_tab_size; if( array_key_exists($idx, $this->map) ){ $incr = 1 + ( $hash_val % ( $hash_tab_size - 2 ) ); do { $idx += $incr; if( $hash_val === $idx ){ throw new Exception('Unable to find empty slot in hash table'); } $idx %= $hash_tab_size; } while( array_key_exists($idx, $this->map ) ); } $this->map[$idx] = $j; $packed[$idx] = pack('V', ++$j ); } return $this->bin = implode('',$packed); } public function lookup( $msgid, array $msgids ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $this->size; $incr = 1 + ( $hash_val % ( $this->size - 2 ) ); while( true ){ if( ! array_key_exists($idx, $this->map) ){ break; } $j = $this->map[$idx]; if( isset($msgids[$j]) && $msgid === $msgids[$j] ){ return $j; } $idx += $incr; if( $idx === $hash_val ){ break; } $idx %= $this->size; } return -1; } public function parse( $bin ){ $this->bin = (string) $bin; $this->size = null; $hash_tab_size = $this->count(); $this->map = array(); $idx = -1; $byte = 0; while( ++$idx < $hash_tab_size ){ $word = substr( $this->bin, $byte, 4 ); if( "\0\0\0\0" !== $word ){ list(,$j) = unpack('V', $word ); $this->map[$idx] = $j - 1; } $byte += 4; } return $this->map; } public static function hashpjw( $str ){ $i = -1; $hval = 0; $len = strlen($str); while( ++$i < $len ){ $ord = ord( substr($str,$i,1) ); $hval = ( $hval << 4 ) + $ord; $g = $hval & 0xf0000000; if( $g !== 0 ){ $hval ^= $g >> 24; $hval ^= $g; } } return $hval; } private static function next_prime( $seed ){ $seed |= 1; while ( ! self::is_prime($seed) ){ $seed += 2; } return $seed; } private static function is_prime( $num ) { if ($num === 1 ){ return false; } if( $num === 2 ){ return true; } if( $num % 2 == 0 ) { return false; } for( $i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if($num % $i == 0 ){ return false; } } return true; } }
|
21 |
class LocoMo { private $bin; private $msgs; private $head; private $hash; private $use_fuzzy = false; private $cs; public function __construct( Iterator $export, LocoPoHeaders $head = null ){ if( $head ){ $this->head = $head; } else { $this->head = new LocoPoHeaders; $this->setHeader('Project-Id-Version','Loco'); } $this->msgs = $export; $this->bin = ''; } public function setCharset( $cs ){ $cs = $this->head->setCharset($cs); $this->cs = 'UTF-8' === $cs ? null : $cs; } public function enableHash(){ return $this->hash = new LocoMoTable; } public function useFuzzy(){ $this->use_fuzzy = true; } public function setHeader( $key, $val ){ $this->head->add($key, $val); return $this; } private function str( $s ){ $s = (string) $s; if( $cs = $this->cs ){ $s = mb_convert_encoding($s,$cs,array('UTF-8')); } return $s; } public function compile(){ $table = array(''); $sources = array(''); $targets = array( (string) $this->head ); $fuzzy_flag = 4; $skip_fuzzy = ! $this->use_fuzzy; foreach( $this->msgs as $r ){ if( $skip_fuzzy && isset($r['flag']) && $fuzzy_flag === $r['flag'] ){ continue; } $msgid = $this->str( $r['key'] ); if( isset($r['context']) ){ $msgctxt = $this->str( $r['context'] ); if( '' !== $msgctxt ){ if( '' === $msgid ){ $msgid = '('.$msgctxt.')'; } $msgid = $msgctxt."\x04".$msgid; } } if( '' === $msgid ){ continue; } $msgstr = $this->str( $r['target'] ); if( '' === $msgstr ){ continue; } $table[] = $msgid; if( isset($r['plurals']) ){ foreach( $r['plurals'] as $i => $p ){ if( $i === 0 ){ $msgid .= "\0".$p['key']; } $msgstr .= "\0".$p['target']; } } $sources[] = $msgid; $targets[] = $msgstr; } asort( $sources, SORT_STRING ); $this->bin = "\xDE\x12\x04\x95\x00\x00\x00\x00"; $n = count($sources); $this->writeInteger( $n ); $offset = 28; $this->writeInteger( $offset ); $offset += $n * 8; $this->writeInteger( $offset ); if( $this->hash ){ sort( $table, SORT_STRING ); $this->hash->compile( $table ); $s = $this->hash->count(); } else { $s = 0; } $this->writeInteger( $s ); $offset += $n * 8; $this->writeInteger( $offset ); if( $s ){ $offset += $s * 4; } $source = ''; foreach( $sources as $i => $str ){ $source .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } $target = ''; foreach( array_keys($sources) as $i ){ $str = $targets[$i]; $target .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } if( $this->hash ){ $this->bin .= $this->hash->__toString(); } $this->bin .= $source; $this->bin .= $target; return $this->bin; } private function writeInteger( $num ){ $this->bin .= pack( 'V', $num ); return $this; } }
|
22 |
interface LocoTokensInterface extends Iterator { public function advance(); public function ignore( array $a ); }
|
24 |
function loco_utf8_chr( $u ){ if( $u < 0x80 ){ if( $u < 0 ){ throw new RangeException( sprintf('%d is out of Unicode range', $u ) ); } return chr($u); } if( $u < 0x800 ) { return chr( ($u>>6) & 0x1F | 0xC0 ).chr( $u & 0x3F | 0x80 ); } if( $u < 0x10000 ) { return chr( $u>>12 & 15 | 0xE0 ).chr( $u>>6 & 0x3F | 0x80 ).chr( $u & 0x3F | 0x80 ); } if( $u < 0x110000 ) { return chr( $u>>18 & 7 | 0xF0 ).chr( $u>>12 & 0x3F | 0x80 ).chr( $u>>6 & 0x3F | 0x80 ).chr( $u & 0x3F | 0x80 ); } throw new RangeException( sprintf('\\x%X is out of Unicode range', $u ) ); }
|
25 |
function loco_resolve_surrogates( $s ){ return preg_replace_callback('/\\xED([\\xA0-\\xAF])([\\x80-\\xBF])\\xED([\\xB0-\\xBF])([\\x80-\\xBF])/', '_loco_resolve_surrogates', $s ); }
|
26 |
function _loco_resolve_surrogates( array $r ){ return loco_utf8_chr ( ( ( ( ( 832 | ( ord($r[1]) & 0x3F ) ) << 6 ) | ( ord($r[2]) & 0x3F ) ) - 0xD800 ) * 0x400 + ( ( ( ( 832 | ( ord($r[3]) & 0x3F ) ) << 6 ) | ( ord($r[4]) & 0x3F ) ) - 0xDC00 ) + 0x10000 ); }
|
27 |
+
class LocoEscapeParser { private $map; private $grep; public function __construct( array $map = array() ){ $this->map = $map; $rules = array('\\\\'); if( $map ){ $rules[] = '['.implode(array_keys($map)).']'; } if( ! isset($map['U']) ) { $rules[] = 'U[0-9A-Fa-f]{5,8}'; } if( ! isset($map['u']) ) { $rules[] = 'u(?:\\{[0-9A-Fa-f]+\\}|[0-9A-Fa-f]{1,4})(?:\\\\u(?:\\{[0-9A-Fa-f]+\\}|[0-9A-Fa-f]{1,4}))*'; } $this->grep = '/\\\\('.implode('|',$rules).')/'; } public function unescape( $s ){ if( '' !== $s ) { return $this->stripSlashes( preg_replace_callback($this->grep, array($this, 'unescapeMatch'), $s) ); } return ''; } public function unescapeMatch( array $r ){ $s = $r[0]; $c = $s[1]; if( isset($this->map[$c]) ){ return $this->map[$c]; } if( 'u' === $c ){ $str = ''; $surrogates = false; foreach( explode('\\u',$s) as $i => $h ){ if( '' !== $h ){ $h = ltrim( trim($h,'{}'),'0'); $u = intval($h,16); $str.= loco_utf8_chr($u); if( ! $surrogates ){ $surrogates = $u >= 0xD800 && $u <= 0xDBFF; } } } if( $surrogates ){ $str = loco_resolve_surrogates($str); } return $str; } if( 'U' === $c ){ return loco_utf8_chr( intval(substr($s,2),16) ); } if( 'x' === $c ){ return chr( intval(substr($s,2),16) ); } if( ctype_digit($c) ){ return chr( intval(substr($s,1),8) ); } return $s; } protected function stripSlashes( $s ){ return stripcslashes($s); } }
|
28 |
class LocoJsTokens extends LocoTokenizer { const T_KWORD = 1; const T_REGEX = 2; private static $lex; protected static $words = array( 'true' => 1, 'false' => 1, 'null' => 1, 'break' => T_BREAK, 'else' => T_ELSE, 'new' => T_NEW, 'var' => 1, 'case' => T_CASE, 'finally' => T_FINALLY, 'return' => T_RETURN, 'void' => 1, 'catch' => T_CATCH, 'for' => T_FOR, 'switch' => T_SWITCH, 'while' => T_WHILE, 'continue' => T_CONTINUE, 'function' => T_FUNCTION, 'this' => T_STRING, 'with' => 1, 'default' => T_DEFAULT, 'if' => T_IF, 'throw' => T_THROW, 'delete' => 1, 'in' => 1, 'try' => T_TRY, 'do' => T_DO, 'instanceof' => 1, 'typeof' => 1, ); public static function decapse( $encapsed ){ $s = substr($encapsed,1,-1); $l = self::$lex; if( is_null($l) ){ $l = new LocoEscapeParser( array( 'U' => 'U', 'a' => 'a', ) ); self::$lex = $l; } return $l->unescape($s); } public function __construct( $src = '' ){ $this->define('/^(?:\\\\u[0-9A-F]{4,4}|[$_\\pL\\p{Nl}])(?:\\\\u[0-9A-F]{4}|[$_\\pL\\pN\\p{Mn}\\p{Mc}\\p{Pc}])*/ui', array($this,'matchWord') ); $this->define('/^\\s+/u', T_WHITESPACE ); $this->define('!^//.*!', T_COMMENT ); $this->define('!^/\\*.*\\*/!Us', array($this,'matchComment') ); $this->define('/^"(?:\\\\.|[^\\r\\n\\p{Zl}\\p{Zp}"\\\\])*"/u', T_CONSTANT_ENCAPSED_STRING ); $this->define('/^\'(?:\\\\.|[^\\r\\n\\p{Zl}\\p{Zp}\'\\\\])*\'/u', T_CONSTANT_ENCAPSED_STRING ); $this->define('/^[-+;,<>.=:|&^!?*%~(){}[\\]]/'); parent::__construct($src); } public function matchWord( $s ){ if( array_key_exists($s,self::$words) ){ return self::$words[$s]; } return T_STRING; } public function matchComment( $s ){ if( '/**' === substr($s,0,3) ){ return T_DOC_COMMENT; } return T_COMMENT; } }
|
29 |
+
class LocoExtracted implements Countable { private $exp = array(); private $reg = array(); private $dom = array(); private $dflt = ''; public function extractSource( LocoExtractor $ext, $src, $fileref = '' ){ $ext->extract( $this, $ext->tokenize($src), $fileref ); return $this; } public function export(){ return $this->exp; } public function count(){ return count( $this->exp ); } public function getDomainCounts(){ return $this->dom; } public function setDomain( $default ){ $this->dflt = (string) $default; return $this; } public function getDomain(){ return $this->dflt; } public function pushMeta( $source, $notes, $domain = null ){ if( ! $domain || '*' === $domain ){ $domain = $this->dflt; } $entry = array( 'id' => '', 'source' => $source, 'target' => '', 'notes' => $notes, ); if( $domain ){ $entry['domain'] = $domain; $key = $source."\1".$domain; } else { $key = $source; } return $this->pushMsgid( $key, $entry, $domain ); } public function pushMsgid( $key, array $entry, $domain ){ if( isset($this->reg[$key]) ){ $index = $this->reg[$key]; $clash = $this->exp[$index]; if( $value = $this->mergeField( $clash, $entry, 'refs', ' ') ){ $this->exp[$index]['refs'] = $value; } if( $value = $this->mergeField( $clash, $entry, 'notes', "\n") ){ $this->exp[$index]['notes'] = $value; } } else { $index = count($this->exp); $this->reg[$key] = $index; $this->exp[$index] = $entry; if( isset($this->dom[$domain]) ){ $this->dom[$domain]++; } else { $this->dom[$domain] = 1; } } return $index; } public function pushMsgidPlural( $skey, array $entry ){ $sindex = $entry['parent']; $pkey = $skey."\2"; if( ! array_key_exists($pkey,$this->reg) ){ $pindex = count($this->exp); $this->reg[$pkey] = $pindex; $this->exp[$pindex] = $entry; if( isset($entry['format']) && ! isset( $this->exp[$sindex]['format']) ) { $this->exp[$sindex]['format'] = $entry['format']; } if( $pindex !== $sindex + $entry['plural']) { $this->exp[$sindex]['child'] = $pindex; } } } public function mergeField( array $old, array $new, $field, $glue ){ $prev = isset($old[$field]) ? $old[$field] : ''; if( isset($new[$field]) ){ $text = $new[$field]; if( '' !== $prev && $prev !== $text ){ if( 'notes' === $field && preg_match( '/^'.preg_quote( rtrim($text,'. '),'/').'[. ]*$/mu', $prev ) ) { $text = $prev; } else { $text = $prev.$glue.$text; } } return $text; } return $prev; } public function filter( $domain ){ $map = array(); $newOffset = 1; $matchAll = '*' === $domain; $raw = array( array( 'id' => '', 'source' => '', 'target' => '', 'domain' => $matchAll ? '' : $domain, ) ); foreach( $this->exp as $oldOffset => $r ){ if( isset($r['parent']) ){ if( isset($map[$r['parent']]) ){ $r['parent'] = $map[ $r['parent'] ]; $raw[ $newOffset++ ] = $r; } } else { if( $matchAll ){ $match = true; } else if( isset($r['domain']) ){ $match = $domain === $r['domain']; } else { $match = $domain === ''; } if( $match ){ $map[ $oldOffset ] = $newOffset; $raw[ $newOffset++ ] = $r; } } } return $raw; } }
|
30 |
+
abstract class LocoExtractor { private $rules; private $wp = array(); private $domain = ''; abstract public function tokenize( $src ); abstract public function extract( LocoExtracted $strings, LocoTokensInterface $tokens, $fileref = '' ); abstract protected function fsniff( $str ); abstract protected function decapse( $raw ); abstract protected function comment( $comment ); public function __construct( array $rules ){ $this->rules = $rules; } public function setDomain( $default ){ $this->domain = $default; return $this; } public function headerize( array $tags, $domain = '' ){ if( isset($this->wp[$domain]) ){ $this->wp[$domain] += $tags; } else { $this->wp[$domain] = $tags; } return $this; } protected function getHeaders(){ return $this->wp; } final public function extractSource( $src, $fileref ){ $strings = new LocoExtracted; $this->extract( $strings, $this->tokenize($src), $fileref ); return $strings; } public function rule( $s ){ return isset($this->rules[$s]) ? $this->rules[$s] : ''; } protected function push( LocoExtracted $strings, $rule, array $args, $comment = '', $ref = '' ){ $s = strpos( $rule, 's'); $p = strpos( $rule, 'p'); $c = strpos( $rule, 'c'); $d = strpos( $rule, 'd'); if( false === $s || ! isset($args[$s]) ){ return null; } $key = $args[$s]; if( ! is_string($key) ){ return null; } $msgid = $key; $entry = array( 'id' => '', 'source' => $msgid, 'target' => '', ); if( is_int($c) && isset($args[$c]) ){ $entry['context'] = $context = $args[$c]; $key .= "\0". $context; } else if( '' === $msgid ){ return null; } else { $context = null; } if( $ref ){ $entry['refs'] = $ref; } if( is_int($d) && array_key_exists($d,$args) ){ $domain = $args[$d]; if( is_null($domain) ){ $domain = ''; } } else if( '' === $this->domain ) { $domain = $strings->getDomain(); } else { $domain = $this->domain; } if( is_string($domain) && '' !== $domain ){ $entry['domain'] = $domain; $key .= "\1".$domain; } $parse_printf = true; if( $comment = $this->comment($comment) ){ if( preg_match('/^xgettext:\\s*([-a-z]+)-format\\s*/mi', $comment, $r, PREG_OFFSET_CAPTURE ) ){ $entry['format'] = $r[1][0]; $comment = trim( substr_replace( $comment,'', $r[0][1], strlen($r[0][0]) ) ); $parse_printf = ( 'no-' === substr($entry['format'],0,3) ) ? false : null; } if( preg_match('/^references?:( *.+:\\d+)*\\s*/mi', $comment, $r, PREG_OFFSET_CAPTURE ) ){ $entry['refs'] = trim($r[1][0],' '); $comment = trim( substr_replace( $comment, '', $r[0][1], strlen($r[0][0]) ) ); } $entry['notes'] = $comment; } if( $parse_printf && ( $format = $this->fsniff($msgid) ) ){ $entry['format'] = $format; } $index = $strings->pushMsgid( $key, $entry, $domain ); if( is_int($p) && isset($args[$p]) ){ $msgid_plural = $args[$p]; $entry = array( 'id' => '', 'source' => $msgid_plural, 'target' => '', 'plural' => 1, 'parent' => $index, ); if( false !== $parse_printf && ( $format = $this->fsniff($msgid_plural) ) ){ $entry['format'] = $format; } $strings->pushMsgidPlural( $key, $entry ); } return $index; } protected function utf8( $str ){ if( false === preg_match('//u',$str) ){ $str = mb_convert_encoding( $str, 'UTF-8', 'cp1252' ); } return $str; } }
|
31 |
class LocoPHPTokens implements LocoTokensInterface, Countable { private $i; private $tokens; private $skip_tokens = array(); private $literal_tokens = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function literal( array $a ){ foreach( $a as $t ){ $this->literal_tokens[ $t ] = 1; } return $this; } public function ignore( array $a ){ foreach( $a as $t ){ $this->skip_tokens[$t] = true; } return $this; } public function export(){ $arr = array(); $this->rewind(); while( $tok = $this->advance() ){ $arr[] = $tok; } return $arr; } public function advance(){ $tok = $this->current(); $this->next(); return $tok; } public function rewind(){ $this->i = ( false === reset($this->tokens) ? null : key($this->tokens) ); } public function valid(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( array_key_exists( is_array($tok) ? $tok[0] : $tok, $this->skip_tokens ) ){ $this->next(); } else { return true; } } return false; } public function key(){ return $this->i; } public function next(){ $this->i = ( false === next($this->tokens) ? null : key($this->tokens) ); } public function current(){ if( ! $this->valid() ){ return false; } $tok = $this->tokens[$this->i]; if( is_array($tok) && isset($this->literal_tokens[$tok[0]]) ){ return $tok[1]; } return $tok; } public function __toString(){ $s = array(); foreach( $this as $token ){ $s[] = is_array($token) ? $token[1] : $token; } return implode('',$s); } public function count(){ return count($this->tokens); } }
|
32 |
class LocoPHPEscapeParser extends LocoEscapeParser { public function __construct(){ parent::__construct( array( 'n' => "\n", 'r' => "\r", 't' => "\t", 'v' => "\x0B", 'f' => "\x0C", 'e' => "\x1B", '$' => '$', '\\' => '\\', '"' => '"', ) ); } protected function stripSlashes( $s ){ return preg_replace_callback('/\\\\(x[0-9A-Fa-f]{1,2}|[0-3]?[0-7]{1,2})/', array($this,'unescapeMatch'), $s, -1, $n ); } }
|
33 |
function loco_unescape_php_string( $s ){ static $l; if( is_null($l) ) { $l = new LocoPHPEscapeParser; } return $l->unescape($s); }
|
36 |
function loco_parse_wp_comment( $block ){ $header = array(); if( '*' === $block[1] ){ $junk = "\r\t/ *"; foreach( explode("\n", $block) as $line ){ if( false !== ( $i = strpos($line,':') ) ){ $key = substr($line,0,$i); $val = substr($line,++$i); $header[ trim($key,$junk) ] = trim($val,$junk); } } } return $header; }
|
37 |
function loco_sniff_printf( $s, $p, $limit = 0, $offset = 0 ){ $n = 0; while( is_string($s) && '' !== $s && false !== ( $i = strpos($s,'%',$offset) ) ){ if( 0 !== $i ){ $s = substr( $s, $i ); } if( preg_match( $p, $s, $r ) ){ $match = $r[0]; if( 0 < $n && isset($r[1]) && '' === $r[1] && '%' !== substr($match,-1) ){ return 0; } if( ++$n === $limit ){ break; } $offset = strlen($match); } else { return 0; } } return $n; }
|
38 |
function loco_sniff_php_printf( $s, $limit = 0 ){ return loco_sniff_printf( $s, '/^%(?:[1-9]\\d*\\$)?(?:\'.|[-+0 ])*\\d*(?:\\.\\d+)?[suxXbcdeEfFgGo%]/', $limit ); }
|
39 |
+
class LocoPHPExtractor extends LocoExtractor { private $defs = array(); public function tokenize( $src ){ return new LocoPHPTokens( token_get_all($src) ); } public function decapse( $raw ){ return loco_decapse_php_string( $raw ); } public function fsniff( $str ){ return loco_sniff_php_printf($str) ? 'php' : ''; } protected function comment( $comment ){ $comment = loco_parse_php_comment($comment); $comment = preg_replace('/^translators:\\s+/mi', '', $comment ); return $comment; } public function define( $name, $value ){ if( is_string($value) ){ $this->defs[$name] = $value; } return $this; } public function extract( LocoExtracted $strings, LocoTokensInterface $tokens, $fileref = '' ){ $tokens->ignore( array(T_WHITESPACE) ); $n = 0; $depth = 0; $comment = ''; $narg = 0; $args = array(); $ref = ''; $rule = ''; $wp = $this->getHeaders(); $tokens->rewind(); while( $tok = $tokens->advance() ){ if( is_string($tok) ){ $s = $tok; $t = null; } else { $t = $tok[0]; $s = $tok[1]; } if( $depth ){ if( ')' === $s || ']' === $s ){ if( 0 === --$depth ){ if( $this->push( $strings, $rule, $args, $comment, $ref ) ){ $n++; } $comment = ''; } } else if( '(' === $s || '[' === $s ){ $depth++; $args[$narg] = null; } else if( 1 === $depth ){ if( ',' === $s ){ $narg++; } else if( T_CONSTANT_ENCAPSED_STRING === $t ){ $s = self::utf8($s); $args[$narg] = $this->decapse($s); } else if( T_STRING === $t && array_key_exists($s,$this->defs) ){ $args[$narg] = $this->defs[$s]; } else { $args[$narg] = null; } } } else if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $was_header = false; $s = self::utf8($s); if( 0 === $n ){ if( false !== strpos($s,'* @package') ){ $was_header = true; } if( $wp && ( $header = loco_parse_wp_comment($s) ) ){ foreach( $wp as $domain => $tags ){ foreach( array_intersect_key($header,$tags) as $tag => $source ){ $strings->pushMeta( $source, $tags[$tag], $domain ); $was_header = true; } } } } if( ! $was_header ) { $comment = $s; } } else if( T_STRING === $t && '(' === $tokens->advance() && ( $rule = $this->rule($s) ) ){ $ref = $fileref ? $fileref.':'.$tok[2]: ''; $depth = 1; $args = array(); $narg = 0; } else if( $comment ){ if( false === stripos($comment, 'translators:') && false === strpos($comment, 'xgettext:') ){ $comment = ''; } } } return $this; } }
|
40 |
function loco_sniff_js_printf( $s, $limit = 0 ){ return loco_sniff_printf( $s, '/^%(?:[1-9]\\d*\\$)?\\+?(?:0|\'[^$])?-?\\d*(?:\\.\\d+)?[b-gijostTuvxX%]/', $limit ); }
|
41 |
class LocoJsExtractor extends LocoPHPExtractor { public function tokenize( $src ){ return new LocoJsTokens($src); } public function fsniff( $str ){ return loco_sniff_js_printf($str) ? 'javascript' : ''; } public function decapse( $encapsed ){ return LocoJsTokens::decapse($encapsed); } }
|
42 |
class LocoTwigExtractor extends LocoPHPExtractor { public function tokenize( $src ){ $src = '<?php '.preg_replace('/{#([^#]+)#}/su','/*\\1*/',$src); return parent::tokenize($src); } }
|
44 |
function loco_print_percent( $n, $t ){ $s = loco_string_percent( (int) $n, (int) $t ); echo $s,'%'; return ''; }
|
45 |
function loco_print_progress( $translated, $untranslated, $flagged ){ $total = $translated + $untranslated; $complete = loco_string_percent( $translated - $flagged, $total ); $class = 'progress'; if( ! $translated && ! $flagged ){ $class .= ' empty'; } else if( '100' === $complete ){ $class .= ' done'; } echo '<div class="',$class,'"><div class="t">'; if( $flagged ){ $s = loco_string_percent( $flagged, $total ); echo '<div class="bar f" style="width:',$s,'%"> </div>'; } if( '0' === $complete ){ echo ' '; } else { $class = 'bar p'; $p = (int) $complete; $class .= sprintf(' p-%u', 10*floor($p/10) ); $style = 'width:'.$complete.'%'; if( $flagged ){ $remain = 100.0 - (float) $s; $style .= '; max-width: '.sprintf('%s',$remain).'%'; } echo '<div class="',$class,'" style="'.$style.'"> </div>'; } echo '</div><div class="l">',$complete,'%</div></div>'; return ''; }
|
46 |
function loco_string_percent( $n, $t ){ if( ! $t || ! $n ){ $s = '0'; } else if( $t === $n ){ $s = '100'; } else { $dp = 0; $n = 100 * $n / $t; if( $n > 99 ){ $s = number_format( min( $n, 99.9 ), ++$dp ); } else if( $n < 0.5 ){ $n = max( $n, 0.0001 ); do { $s = number_format( $n, ++$dp ); } while( preg_match('/^0\\.0+$/',$s) && $dp < 4 ); $s = substr($s,1); } else { $s = number_format( $n, $dp ); } } return $s; }
|
47 |
+
class LocoFuzzyMatcher implements Countable { private $pot = array(); private $po = array(); private $diff = array(); private $dmax = .20; public function count(){ return count($this->pot); } public function unmatched(){ return array_values($this->pot); } public function redundant(){ return array_values($this->po); } public function setFuzziness( $s ){ if( $this->po ){ throw new LogicException('Cannot setFuzziness() after calling match()'); } $this->dmax = (float) max( 0, min( (int) $s, 100 ) ) / 100; } public function add( $a ){ $source = isset($a['source']) ? (string) $a['source'] : ''; $context = isset($a['context']) ? (string) $a['context'] : ''; $this->pot[$source."\4".$context] = $a; } public function match( $a ) { $source = isset($a['source']) ? (string) $a['source'] : ''; $context = isset($a['context']) ? (string) $a['context'] : ''; $old = $source."\4".$context; if( isset($this->pot[$old]) ){ $new = $this->pot[$old]; unset($this->pot[$old]); return $new; } $this->po[$old] = $a; $target = isset($a['target']) ? (string) $a['target'] : ''; $comment = isset($a['comment']) ? (string) $a['comment'] : ''; if( '' === $target && '' === $comment ){ return null; } if( 0 < $this->dmax ){ foreach( $this->pot as $new => $_ ){ $dist = $this->distance($old,$new); if( -1 !== $dist ){ $this->diff[] = array( $old, $new, $dist ); } } } return null; } private function distance( $a, $b ){ $a = strtolower($a); $b = strtolower($b); if( $a === $b ){ return 0; } $lenA = strlen($a); $lenB = strlen($b); $lenDiff = abs($lenA-$lenB); $max = min($lenA,$lenB) + $lenDiff; $max = (int) ceil( $this->dmax * $max ); if( $max < $lenDiff ) { return -1; } $len = max($lenA,$lenB); if( $len < 256 ){ $d = levenshtein($a,$b); return $d > $max ? -1 : $d; } $d = 0; for( $i = 0; $i < $len; $i+=$max ){ $aa = substr($a,$i,$max); $bb = substr($b,$i,$max); $d += levenshtein($aa,$bb); if( $d > $max ){ return -1; } } return $d; } public function getFuzzyMatches(){ $pairs = array(); usort( $this->diff, array(__CLASS__,'compareDistance') ); foreach( $this->diff as $pair ){ list($old,$new) = $pair; if( ! array_key_exists($new,$this->pot) || ! array_key_exists($old,$this->po) ){ continue; } $pairs[] = array( $this->po[$old], $this->pot[$new], ); unset($this->po[$old]); unset($this->pot[$new]); if( ! $this->po || ! $this->pot ){ break; } } $this->diff = array(); return $pairs; } private static function compareDistance( array $a, array $b ){ return $a[2] - $b[2]; } }
|
48 |
+
defined('T_FINALLY') || define('T_FINALLY',500); loco_check_extension('mbstring');
|
lib/data/locales.php
CHANGED
@@ -2,4 +2,4 @@
|
|
2 |
/**
|
3 |
* Compiled data. Do not edit.
|
4 |
*/
|
5 |
-
return array('af'=>array(0=>'Afrikaans',1=>'Afrikaans'),'ar'=>array(0=>'Arabic',1=>'العربية'),'ary'=>array(0=>'Moroccan Arabic',1=>'العربية المغربية'),'as'=>array(0=>'Assamese',1=>'অসমীয়া'),'az'=>array(0=>'Azerbaijani',1=>'Azərbaycan dili'),'azb'=>array(0=>'South Azerbaijani',1=>'گؤنئی آذربایجان'),'bel'=>array(0=>'Belarusian',1=>'Беларуская мова'),'bg_BG'=>array(0=>'Bulgarian',1=>'Български'),'bn_BD'=>array(0=>'Bengali (Bangladesh)',1=>'বাংলা'),'bo'=>array(0=>'Tibetan',1=>'བོད་ཡིག'),'bs_BA'=>array(0=>'Bosnian',1=>'Bosanski'),'ca'=>array(0=>'Catalan',1=>'Català'),'ceb'=>array(0=>'Cebuano',1=>'Cebuano'),'cs_CZ'=>array(0=>'Czech',1=>'Čeština'),'cy'=>array(0=>'Welsh',1=>'Cymraeg'),'da_DK'=>array(0=>'Danish',1=>'Dansk'),'de_DE_formal'=>array(0=>'German (Formal)',1=>'Deutsch (Sie)'),'de_CH_informal'=>array(0=>'German (Switzerland, Informal)',1=>'Deutsch (Schweiz, Du)'),'
|
2 |
/**
|
3 |
* Compiled data. Do not edit.
|
4 |
*/
|
5 |
+
return array('af'=>array(0=>'Afrikaans',1=>'Afrikaans'),'ar'=>array(0=>'Arabic',1=>'العربية'),'ary'=>array(0=>'Moroccan Arabic',1=>'العربية المغربية'),'as'=>array(0=>'Assamese',1=>'অসমীয়া'),'az'=>array(0=>'Azerbaijani',1=>'Azərbaycan dili'),'azb'=>array(0=>'South Azerbaijani',1=>'گؤنئی آذربایجان'),'bel'=>array(0=>'Belarusian',1=>'Беларуская мова'),'bg_BG'=>array(0=>'Bulgarian',1=>'Български'),'bn_BD'=>array(0=>'Bengali (Bangladesh)',1=>'বাংলা'),'bo'=>array(0=>'Tibetan',1=>'བོད་ཡིག'),'bs_BA'=>array(0=>'Bosnian',1=>'Bosanski'),'ca'=>array(0=>'Catalan',1=>'Català'),'ceb'=>array(0=>'Cebuano',1=>'Cebuano'),'cs_CZ'=>array(0=>'Czech',1=>'Čeština'),'cy'=>array(0=>'Welsh',1=>'Cymraeg'),'da_DK'=>array(0=>'Danish',1=>'Dansk'),'de_DE'=>array(0=>'German',1=>'Deutsch'),'de_DE_formal'=>array(0=>'German (Formal)',1=>'Deutsch (Sie)'),'de_CH_informal'=>array(0=>'German (Switzerland, Informal)',1=>'Deutsch (Schweiz, Du)'),'de_CH'=>array(0=>'German (Switzerland)',1=>'Deutsch (Schweiz)'),'dzo'=>array(0=>'Dzongkha',1=>'རྫོང་ཁ'),'el'=>array(0=>'Greek',1=>'Ελληνικά'),'en_NZ'=>array(0=>'English (New Zealand)',1=>'English (New Zealand)'),'en_ZA'=>array(0=>'English (South Africa)',1=>'English (South Africa)'),'en_GB'=>array(0=>'English (UK)',1=>'English (UK)'),'en_CA'=>array(0=>'English (Canada)',1=>'English (Canada)'),'en_AU'=>array(0=>'English (Australia)',1=>'English (Australia)'),'eo'=>array(0=>'Esperanto',1=>'Esperanto'),'es_CO'=>array(0=>'Spanish (Colombia)',1=>'Español de Colombia'),'es_AR'=>array(0=>'Spanish (Argentina)',1=>'Español de Argentina'),'es_VE'=>array(0=>'Spanish (Venezuela)',1=>'Español de Venezuela'),'es_MX'=>array(0=>'Spanish (Mexico)',1=>'Español de México'),'es_ES'=>array(0=>'Spanish (Spain)',1=>'Español'),'es_CL'=>array(0=>'Spanish (Chile)',1=>'Español de Chile'),'es_CR'=>array(0=>'Spanish (Costa Rica)',1=>'Español de Costa Rica'),'es_PE'=>array(0=>'Spanish (Peru)',1=>'Español de Perú'),'es_GT'=>array(0=>'Spanish (Guatemala)',1=>'Español de Guatemala'),'et'=>array(0=>'Estonian',1=>'Eesti'),'eu'=>array(0=>'Basque',1=>'Euskara'),'fa_IR'=>array(0=>'Persian',1=>'فارسی'),'fi'=>array(0=>'Finnish',1=>'Suomi'),'fr_FR'=>array(0=>'French (France)',1=>'Français'),'fr_CA'=>array(0=>'French (Canada)',1=>'Français du Canada'),'fr_BE'=>array(0=>'French (Belgium)',1=>'Français de Belgique'),'fur'=>array(0=>'Friulian',1=>'Friulian'),'gd'=>array(0=>'Scottish Gaelic',1=>'Gàidhlig'),'gl_ES'=>array(0=>'Galician',1=>'Galego'),'gu'=>array(0=>'Gujarati',1=>'ગુજરાતી'),'haz'=>array(0=>'Hazaragi',1=>'هزاره گی'),'he_IL'=>array(0=>'Hebrew',1=>'עִבְרִית'),'hi_IN'=>array(0=>'Hindi',1=>'हिन्दी'),'hr'=>array(0=>'Croatian',1=>'Hrvatski'),'hu_HU'=>array(0=>'Hungarian',1=>'Magyar'),'hy'=>array(0=>'Armenian',1=>'Հայերեն'),'id_ID'=>array(0=>'Indonesian',1=>'Bahasa Indonesia'),'is_IS'=>array(0=>'Icelandic',1=>'Íslenska'),'it_IT'=>array(0=>'Italian',1=>'Italiano'),'ja'=>array(0=>'Japanese',1=>'日本語'),'jv_ID'=>array(0=>'Javanese',1=>'Basa Jawa'),'ka_GE'=>array(0=>'Georgian',1=>'ქართული'),'kab'=>array(0=>'Kabyle',1=>'Taqbaylit'),'kk'=>array(0=>'Kazakh',1=>'Қазақ тілі'),'km'=>array(0=>'Khmer',1=>'ភាសាខ្មែរ'),'ko_KR'=>array(0=>'Korean',1=>'한국어'),'ckb'=>array(0=>'Kurdish (Sorani)',1=>'كوردی'),'lo'=>array(0=>'Lao',1=>'ພາສາລາວ'),'lt_LT'=>array(0=>'Lithuanian',1=>'Lietuvių kalba'),'lv'=>array(0=>'Latvian',1=>'Latviešu valoda'),'mk_MK'=>array(0=>'Macedonian',1=>'Македонски јазик'),'ml_IN'=>array(0=>'Malayalam',1=>'മലയാളം'),'mn'=>array(0=>'Mongolian',1=>'Монгол'),'mr'=>array(0=>'Marathi',1=>'मराठी'),'ms_MY'=>array(0=>'Malay',1=>'Bahasa Melayu'),'my_MM'=>array(0=>'Myanmar (Burmese)',1=>'ဗမာစာ'),'nb_NO'=>array(0=>'Norwegian (Bokmål)',1=>'Norsk bokmål'),'ne_NP'=>array(0=>'Nepali',1=>'नेपाली'),'nl_BE'=>array(0=>'Dutch (Belgium)',1=>'Nederlands (België)'),'nl_NL_formal'=>array(0=>'Dutch (Formal)',1=>'Nederlands (Formeel)'),'nl_NL'=>array(0=>'Dutch',1=>'Nederlands'),'nn_NO'=>array(0=>'Norwegian (Nynorsk)',1=>'Norsk nynorsk'),'oci'=>array(0=>'Occitan',1=>'Occitan'),'pa_IN'=>array(0=>'Punjabi',1=>'ਪੰਜਾਬੀ'),'pl_PL'=>array(0=>'Polish',1=>'Polski'),'ps'=>array(0=>'Pashto',1=>'پښتو'),'pt_BR'=>array(0=>'Portuguese (Brazil)',1=>'Português do Brasil'),'pt_PT'=>array(0=>'Portuguese (Portugal)',1=>'Português'),'pt_PT_ao90'=>array(0=>'Portuguese (Portugal, AO90)',1=>'Português (AO90)'),'rhg'=>array(0=>'Rohingya',1=>'Ruáinga'),'ro_RO'=>array(0=>'Romanian',1=>'Română'),'ru_RU'=>array(0=>'Russian',1=>'Русский'),'sah'=>array(0=>'Sakha',1=>'Сахалыы'),'si_LK'=>array(0=>'Sinhala',1=>'සිංහල'),'sk_SK'=>array(0=>'Slovak',1=>'Slovenčina'),'sl_SI'=>array(0=>'Slovenian',1=>'Slovenščina'),'sq'=>array(0=>'Albanian',1=>'Shqip'),'sr_RS'=>array(0=>'Serbian',1=>'Српски језик'),'sv_SE'=>array(0=>'Swedish',1=>'Svenska'),'szl'=>array(0=>'Silesian',1=>'Ślōnskŏ gŏdka'),'ta_IN'=>array(0=>'Tamil',1=>'தமிழ்'),'te'=>array(0=>'Telugu',1=>'తెలుగు'),'th'=>array(0=>'Thai',1=>'ไทย'),'tl'=>array(0=>'Tagalog',1=>'Tagalog'),'tr_TR'=>array(0=>'Turkish',1=>'Türkçe'),'tt_RU'=>array(0=>'Tatar',1=>'Татар теле'),'tah'=>array(0=>'Tahitian',1=>'Reo Tahiti'),'ug_CN'=>array(0=>'Uighur',1=>'ئۇيغۇرچە'),'uk'=>array(0=>'Ukrainian',1=>'Українська'),'ur'=>array(0=>'Urdu',1=>'اردو'),'uz_UZ'=>array(0=>'Uzbek',1=>'O‘zbekcha'),'vi'=>array(0=>'Vietnamese',1=>'Tiếng Việt'),'zh_CN'=>array(0=>'Chinese (China)',1=>'简体中文'),'zh_TW'=>array(0=>'Chinese (Taiwan)',1=>'繁體中文'),'zh_HK'=>array(0=>'Chinese (Hong Kong)',1=>'香港中文版 '));
|
loco.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
|
|
4 |
Plugin URI: https://wordpress.org/plugins/loco-translate/
|
5 |
Description: Translate themes and plugins directly in WordPress
|
6 |
Author: Tim Whitlock
|
7 |
-
Version: 2.4.
|
8 |
Author URI: https://localise.biz/wordpress/plugin
|
9 |
Text Domain: loco-translate
|
10 |
Domain Path: /languages/
|
@@ -30,7 +30,7 @@ function loco_plugin_file(){
|
|
30 |
* @return string
|
31 |
*/
|
32 |
function loco_plugin_version(){
|
33 |
-
return '2.4.
|
34 |
}
|
35 |
|
36 |
|
@@ -132,17 +132,17 @@ function loco_require_lib( $path ){
|
|
132 |
*/
|
133 |
function loco_check_extension( $name ) {
|
134 |
static $cache = array();
|
135 |
-
if
|
136 |
-
if
|
137 |
-
$cache[
|
138 |
}
|
139 |
else {
|
140 |
-
Loco_error_AdminNotices::warn( sprintf( __('Loco requires the "%s" PHP extension. Ask your hosting provider to install it','loco-translate'), $name ) );
|
141 |
$class = 'Loco_compat_'.ucfirst($name).'Extension.php';
|
142 |
$cache[$name] = class_exists($class);
|
143 |
}
|
144 |
}
|
145 |
-
return $cache[
|
146 |
}
|
147 |
|
148 |
|
@@ -201,6 +201,12 @@ try {
|
|
201 |
if ( is_admin() ) {
|
202 |
new Loco_hooks_AdminHooks;
|
203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
catch( Exception $e ){ // PHP5+
|
206 |
trigger_error(sprintf('[Loco.fatal] %s in %s:%u',$e->getMessage(), $e->getFile(), $e->getLine() ),E_USER_NOTICE);
|
4 |
Plugin URI: https://wordpress.org/plugins/loco-translate/
|
5 |
Description: Translate themes and plugins directly in WordPress
|
6 |
Author: Tim Whitlock
|
7 |
+
Version: 2.4.5
|
8 |
Author URI: https://localise.biz/wordpress/plugin
|
9 |
Text Domain: loco-translate
|
10 |
Domain Path: /languages/
|
30 |
* @return string
|
31 |
*/
|
32 |
function loco_plugin_version(){
|
33 |
+
return '2.4.5';
|
34 |
}
|
35 |
|
36 |
|
132 |
*/
|
133 |
function loco_check_extension( $name ) {
|
134 |
static $cache = array();
|
135 |
+
if( ! array_key_exists($name,$cache) ) {
|
136 |
+
if( extension_loaded($name) ){
|
137 |
+
$cache[$name] = true;
|
138 |
}
|
139 |
else {
|
140 |
+
Loco_error_AdminNotices::warn( sprintf( __('Loco Translate requires the "%s" PHP extension. Ask your hosting provider to install it','loco-translate'), $name ) );
|
141 |
$class = 'Loco_compat_'.ucfirst($name).'Extension.php';
|
142 |
$cache[$name] = class_exists($class);
|
143 |
}
|
144 |
}
|
145 |
+
return $cache[$name];
|
146 |
}
|
147 |
|
148 |
|
201 |
if ( is_admin() ) {
|
202 |
new Loco_hooks_AdminHooks;
|
203 |
}
|
204 |
+
|
205 |
+
// enable wp cli commands
|
206 |
+
if( class_exists('WP_CLI',false) ) {
|
207 |
+
WP_CLI::add_command('loco','Loco_cli_Commands');
|
208 |
+
}
|
209 |
+
|
210 |
}
|
211 |
catch( Exception $e ){ // PHP5+
|
212 |
trigger_error(sprintf('[Loco.fatal] %s in %s:%u',$e->getMessage(), $e->getFile(), $e->getLine() ),E_USER_NOTICE);
|
pub/css/admin.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.4) 0 0 no-repeat;min-height:75px}._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.4);background-size:16px}._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.4);background-size:16px}}._green_glow_inner{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}.loco-font,#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after,#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:"loco";src:url("../font/loco.eot?v=2.4.4");src:url("../font/loco.eot?v=2.4.4?#iefix") format("embedded-opentype"),url("../font/loco.woff?v=2.4.4") format("woff"),url("../font/loco.ttf?v=2.4.4") format("truetype"),url("../font/loco.svg?v=2.4.4#loco") format("svg");font-weight:normal;font-style:normal}.tipsy{font-size:11px;position:absolute;padding:5px;z-index:500001;opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.tipsy.in{opacity:1}.tipsy-inner{background-color:#000;color:#fff;white-space:nowrap;padding:6px 8px;line-height:1.3em;text-align:center;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-font-smoothing:subpixel-antialiased}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.tipsy-n .tipsy-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}#loco-admin.wrap .selector li,#loco-admin.wrap .selector .handle,#loco-admin.wrap .selectoradd a,#loco-admin.wrap .selectorsep:before,#loco-admin.wrap .selectorsep span{padding:.3em .75em}#loco-admin.wrap .selector{text-align:left;display:inline-block;white-space:nowrap}#loco-admin.wrap .selectoradd a,#loco-admin.wrap .selector .handle{cursor:default;display:block;position:relative;border-top:solid 1px #fff;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-left:solid 1px #fff;color:#666;height:1.3em;overflow:hidden;white-space:normal}#loco-admin.wrap .selectorsep{display:inline-block;border:solid 1px transparent}#loco-admin.wrap .selectorsep:before{display:block;position:relative;color:#999;height:1.3em;overflow:hidden}#loco-admin.wrap .selectorsep>*{display:block;line-height:1em;color:#666;height:1.3em;overflow:hidden}#loco-admin.wrap .selector .handle{outline:none;white-space:nowrap;padding-right:2.3em;max-width:250px;text-overflow:ellipsis}#loco-admin.wrap .selector .handle .prefix{padding-right:.6ex}#loco-admin.wrap .selector .handle:after{font-family:loco;font-size:1.3em;color:#ccc;display:block;position:absolute;top:.25em;right:.6em;content:"▼"}#loco-admin.wrap .selector .handle:focus:after,#loco-admin.wrap .selector .handle:hover:after{color:#666}#loco-admin.wrap .selector.no-caret .handle{padding-right:.75em}#loco-admin.wrap .selector.no-caret .handle:after{display:none}#loco-admin.wrap .selector.no-title .handle{padding-left:.5em;padding-right:.5em}#loco-admin.wrap .selector.no-title .handle .label{display:none}#loco-admin.wrap .selector.no-title .handle .icon{margin-right:0px}#loco-admin.wrap .selector.dummy .handle{border-color:transparent}#loco-admin.wrap .selector.dummy .handle:after{display:none}#loco-admin.wrap .selectoradd{position:relative}#loco-admin.wrap .selectoradd>*{display:block;float:left;clear:none}#loco-admin.wrap .selectoradd>a.has-icon{width:1.3em}#loco-admin.wrap .selectoradd>a.has-icon:before{color:#999;display:inline;padding-left:0;padding-right:0;line-height:1.4em}#loco-admin.wrap .selectoradd>a.has-icon:hover:after{color:#2e892e}#loco-admin.wrap .selectorsep{display:inline-block}#loco-admin.wrap .selectorsep span{color:#666;height:1.3em}#loco-admin.wrap .selector ul{padding:0}#loco-admin.wrap .selector ul,#loco-admin.wrap .selector li{display:block;position:relative;cursor:default;margin:0}#loco-admin.wrap .selector ul{z-index:5;position:absolute;left:0;top:0;background:#f5f5f5;box-shadow:0 10px 5px rgba(0,0,0,.2);border:solid 1px #ccc;overflow:auto}#loco-admin.wrap .selector.up ul{margin-top:0}#loco-admin.wrap .selector.multi li input{display:none}#loco-admin.wrap .selector.multi li.checked{background:#e5e5e5}#loco-admin.wrap .selector li.active{background:#e5e5e5 !important}#loco-admin.wrap .selector li.over{background:#ccc !important;color:#fff;text-shadow:1px 1px #aaa}#loco-admin.wrap .selector li.over .label{color:#fff}#loco-admin.wrap .selector .label{font:inherit;color:inherit}#loco-admin.wrap .selector .icon{display:inline-block;min-width:1.2em;text-align:center;font-size:14px}#loco-admin.wrap .selector .icon.no-icon{display:none}#loco-admin.wrap .selector .icon:before{color:#666}#loco-admin.wrap .selector .avtr{width:18px;height:18px;background-size:18px;background-repeat:no-repeat}#loco-admin.wrap .selector .label{line-height:1}#loco-admin.wrap .selector .icon,#loco-admin.wrap .selector .icon-16{vertical-align:bottom}#loco-admin.wrap .selector .icon,#loco-admin.wrap .selector .lang,#loco-admin.wrap .selector .icon-16{margin-right:5px}#loco-admin.wrap .selector .region,#loco-admin.wrap .selector .variant-wales,#loco-admin.wrap .selector .region-gb.lang-cy,#loco-admin.wrap .selector .variant-scotland,#loco-admin.wrap .selector .region-gb.lang-gd,#loco-admin.wrap .selector .variant-valencia,#loco-admin.wrap .selector .region-es.variant-valencia,#loco-admin.wrap .selector .lang-ca,#loco-admin.wrap .selector .region-es.lang-ca,#loco-admin.wrap .selector .lang-eo,#loco-admin.wrap .selector .lang-eu{margin-left:2px;margin-right:7px}#loco-admin.wrap .selector.ticked .icon.no-icon{font-size:12px;display:inline-block}#loco-admin.wrap .selector.ticked .active .icon.no-icon:before{content:"✓"}#loco-admin.wrap .selectoradd a:hover,#loco-admin.wrap .selector a.handle:focus,#loco-admin.wrap .selector a.handle:hover{color:#000;border-color:#999}#loco-admin.wrap .selector.active .handle{border-color:#999;background-color:#eee;color:#999}#loco-admin.wrap .selector.active .handle:after{color:#999;content:"▲"}#loco-admin.wrap .selector.disabled{cursor:default;cursor:no-drop;cursor:not-allowed}#loco-admin.wrap .selector.disabled .handle{pointer-events:none;border-top:solid 1px #fff;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-left:solid 1px #fff;color:#999;padding-right:1em}#loco-admin.wrap .selector.disabled .handle:after{display:none}#loco-admin.wrap .selector.disabled .handle span.icon{color:#999 !important}#loco-admin.wrap .selector li.disabled,#loco-admin.wrap .selector li.disabled.over{color:#aaa;text-shadow:1px 1px #fff;pointer-events:none}#loco-admin.wrap .selector li.disabled *{cursor:text}#loco-admin.wrap .selector li.disabled .icon:before{color:#aaa}#loco-admin.wrap .selector li.disabled .flag,#loco-admin.wrap .selector li.disabled .icon-16{opacity:.4}#loco-admin.wrap .selector.lefty ul{left:auto;right:0}#loco-admin.wrap .selector.lefty ul .icon,#loco-admin.wrap .selector.lefty ul .icon-32{display:block;float:right;clear:none}#loco-admin.wrap .selector.lefty ul .label{padding-right:32px;padding-left:0}#loco-admin.wrap .selector ul>form{margin:0;display:block}#loco-admin.wrap .selector ul>form input{margin:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#loco-admin.wrap .selector ul>form input:focus{-webkit-box-shadow:inset 0 0 5px 0 #3db63d;-moz-box-shadow:inset 0 0 5px 0 #3db63d;box-shadow:inset 0 0 5px 0 #3db63d}#loco-admin.wrap .selector ul>form input.error{border-color:#c00;-webkit-box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5);-moz-box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5);box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5)}#loco-admin.wrap .selector ul>form a.clear{margin:0;border:none}#loco-admin.wrap .selector ul>form ::placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form ::-webkit-input-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form :-moz-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block;opacity:1}#loco-admin.wrap .selector ul>form ::-moz-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block;opacity:1}#loco-admin.wrap .selector ul>form :-ms-input-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form .ielt10 .placeheld{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap div.auto-comp-wrap{width:100%}#loco-admin.wrap div.auto-comp-wrap input{display:inline-block}#loco-admin.wrap div.auto-comp-wrap.loading input{background:transparent url(../img/ajax-loader.gif?v=2.4.4) right 2px no-repeat}#loco-admin.wrap div.auto-comp-drop{color:#333;background:#fff;border-top:none;position:absolute;width:auto;top:0;left:0;z-index:99;-webkit-box-shadow:0 5px 5px rgba(0,0,0,.4);-moz-box-shadow:0 5px 5px rgba(0,0,0,.4);box-shadow:0 5px 5px rgba(0,0,0,.4)}#loco-admin.wrap div.auto-comp-result{padding:5px 10px;cursor:pointer;background:#f0f0f0;border-top:solid 1px #fff;border-bottom:solid 1px #ddd;white-space:nowrap}#loco-admin.wrap div.auto-comp-result:first-child{border-top:solid 1px #ddd}#loco-admin.wrap div.auto-comp-result>*{display:inline-block;vertical-align:middle;line-height:normal}#loco-admin.wrap div.auto-comp-result .icon:before{padding-right:5px}#loco-admin.wrap div.auto-comp-result:hover{background:#a8a8a8;color:#fff;border-top-color:#a8a8a8;border-bottom-color:#999}#loco-admin.wrap div.auto-comp-result.selected{background:#666 !important;color:#fff;border-top-color:#666;border-bottom-color:#666}#loco-admin.wrap div.auto-comp-result .lang,#loco-admin.wrap div.auto-comp-result .region,#loco-admin.wrap div.auto-comp-result .variant-wales,#loco-admin.wrap div.auto-comp-result .region-gb.lang-cy,#loco-admin.wrap div.auto-comp-result .variant-scotland,#loco-admin.wrap div.auto-comp-result .region-gb.lang-gd,#loco-admin.wrap div.auto-comp-result .variant-valencia,#loco-admin.wrap div.auto-comp-result .region-es.variant-valencia,#loco-admin.wrap div.auto-comp-result .lang-ca,#loco-admin.wrap div.auto-comp-result .region-es.lang-ca,#loco-admin.wrap div.auto-comp-result .lang-eo,#loco-admin.wrap div.auto-comp-result .lang-eu,#loco-admin.wrap div.auto-comp-result .avtr{margin-right:5px}#loco-admin.wrap div.auto-comp-wrap.error a.icon.clear:before{color:#c00;opacity:1}#loco-admin.wrap div.auto-comp-wrap.error input[type=text]{border-color:#c00;color:#c00}#loco-admin.wrap div.auto-comp-wrap.error input[type=text]:focus{-webkit-box-shadow:0 0 .5em 0 rgba(153,0,0,.5);-moz-box-shadow:0 0 .5em 0 rgba(153,0,0,.5);box-shadow:0 0 .5em 0 rgba(153,0,0,.5)}#loco-admin.wrap ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}#loco-admin.wrap ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.4) 0 0 no-repeat;min-height:75px}#loco-admin.wrap ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-admin.wrap ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.4);background-size:16px}#loco-admin.wrap ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.4);background-size:16px}}#loco-admin.wrap ._green_glow_inner{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-admin.wrap ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-admin.wrap .loco-font,#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after,#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-admin.wrap .has-icon:before{display:inline-block;padding-right:.3em}#loco-admin.wrap a.icon-help{cursor:help}#loco-admin.wrap a.icon-help span{display:none}#loco-admin.wrap .icon-notag:before{content:""}#loco-admin.wrap .icon-python:before{content:"🐍"}#loco-admin.wrap .icon-unicode:before{content:"u"}#loco-admin.wrap .icon-json:before{content:"{"}#loco-admin.wrap .icon-bullist:before{content:""}#loco-admin.wrap .icon-numlist:before{content:""}#loco-admin.wrap .icon-indent:before{content:""}#loco-admin.wrap .icon-outdent:before{content:""}#loco-admin.wrap .icon-link:before{content:""}#loco-admin.wrap .icon-unlink:before{content:""}#loco-admin.wrap .icon-bold:before{content:"B"}#loco-admin.wrap .icon-italic:before{content:"I"}#loco-admin.wrap .icon-translate:before{content:""}#loco-admin.wrap .icon-proj:before{content:""}#loco-admin.wrap .icon-plural:before{content:"᛬"}#loco-admin.wrap .icon-max:before,#loco-admin.wrap .icon-full-screen:before{content:""}#loco-admin.wrap .icon-min:before{content:""}#loco-admin.wrap .icon-sort:before{content:""}#loco-admin.wrap .icon-ok:before,#loco-admin.wrap .notice-success>.has-icon:before,#loco-admin.wrap .notice-success p>strong.has-icon:before{content:"✓"}#loco-admin.wrap .icon-ok-empty:before{content:"🗌"}#loco-admin.wrap .icon-checkbox-checked:before,#loco-admin.wrap .selector.multi li.checked .icon-checkbox:before{content:"☑"}#loco-admin.wrap .icon-checkbox-unchecked:before{content:"☐"}#loco-admin.wrap .icon-checkbox-partial:before{content:"☉"}#loco-admin.wrap .icon-radio-checked:before{content:"⚫"}#loco-admin.wrap .icon-radio-unchecked:before{content:"⚪"}#loco-admin.wrap .icon-ext:before{content:"⬈"}#loco-admin.wrap .icon-share:before{content:""}#loco-admin.wrap .icon-star:before{content:""}#loco-admin.wrap .icon-user:before{content:""}#loco-admin.wrap .icon-remove:before,#loco-admin.wrap a.icon.close:before{content:"×"}#loco-admin.wrap .icon-cog:before{content:""}#loco-admin.wrap .icon-trash:before{content:""}#loco-admin.wrap .icon-time:before,#loco-admin.wrap .icon-history:before{content:""}#loco-admin.wrap .icon-download:before{content:""}#loco-admin.wrap .icon-revert:before{content:""}#loco-admin.wrap .icon-sync:before{content:""}#loco-admin.wrap .icon-lock:before,#loco-admin.wrap .notice-locked>.has-icon:before,#loco-admin.wrap .notice-locked p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-flag:before{content:""}#loco-admin.wrap .icon-tag:before{content:""}#loco-admin.wrap .icon-tags:before{content:""}#loco-admin.wrap .icon-print:before{content:""}#loco-admin.wrap .icon-camera:before{content:""}#loco-admin.wrap .icon-pencil:before{content:""}#loco-admin.wrap .icon-add:before{content:""}#loco-admin.wrap .icon-del:before{content:""}#loco-admin.wrap .icon-clear:before,#loco-admin.wrap a.icon.clear:before{content:""}#loco-admin.wrap .icon-ok-sign:before{content:"✔"}#loco-admin.wrap .icon-help:before{content:"?"}#loco-admin.wrap .icon-info:before,#loco-admin.wrap .notice-info>.has-icon:before,#loco-admin.wrap .notice-info p>strong.has-icon:before{content:"ℹ"}#loco-admin.wrap .icon-cancel:before{content:""}#loco-admin.wrap .icon-warn:before,#loco-admin.wrap .notice-error>.has-icon:before,#loco-admin.wrap .notice-error p>strong.has-icon:before,#loco-admin.wrap .notice-warning>.has-icon:before,#loco-admin.wrap .notice-warning p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-comment:before{content:""}#loco-admin.wrap .icon-bar-chart:before{content:""}#loco-admin.wrap .icon-key:before{content:""}#loco-admin.wrap .icon-cogs:before{content:""}#loco-admin.wrap .icon-comments:before{content:""}#loco-admin.wrap .icon-signout:before{content:""}#loco-admin.wrap .icon-signin:before{content:""}#loco-admin.wrap .icon-upload:before{content:""}#loco-admin.wrap .icon-twitter:before{content:"🐦"}#loco-admin.wrap .icon-facebook:before{content:""}#loco-admin.wrap .icon-github:before{content:""}#loco-admin.wrap .icon-feed:before{content:""}#loco-admin.wrap .icon-globe:before{content:""}#loco-admin.wrap .icon-wrench:before,#loco-admin.wrap .notice-debug>.has-icon:before,#loco-admin.wrap .notice-debug p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-group:before{content:""}#loco-admin.wrap .icon-cloud:before{content:""}#loco-admin.wrap .icon-copy:before{content:""}#loco-admin.wrap .icon-save:before{content:""}#loco-admin.wrap .icon-menu:before{content:""}#loco-admin.wrap .icon-table:before{content:""}#loco-admin.wrap .icon-caret-down:before{content:"▼"}#loco-admin.wrap .icon-caret-up:before{content:"▲"}#loco-admin.wrap .icon-caret-right:before{content:"▶"}#loco-admin.wrap .icon-mail:before{content:""}#loco-admin.wrap .icon-cloud-upload:before{content:""}#loco-admin.wrap .icon-file:before{content:""}#loco-admin.wrap .icon-circle-white:before{content:"⚬"}#loco-admin.wrap .icon-circle-black:before{content:"●"}#loco-admin.wrap .icon-eraser:before{content:""}#loco-admin.wrap .icon-unlock:before{content:""}#loco-admin.wrap .icon-apple:before{content:""}#loco-admin.wrap .icon-android:before{content:""}#loco-admin.wrap .icon-robot:before{content:"🤖"}#loco-admin.wrap .icon-back:before{content:"⬅"}#loco-admin.wrap .icon-next:before{content:"➔"}#loco-admin.wrap .icon-arrow-up:before{content:""}#loco-admin.wrap .icon-ccard:before{content:""}#loco-admin.wrap .icon-caret-left:before{content:"◀"}#loco-admin.wrap .icon-pro:before{content:"⚡"}#loco-admin.wrap .icon-bell:before{content:""}#loco-admin.wrap .icon-code:before{content:""}#loco-admin.wrap .icon-privacy:before{content:"🛡"}#loco-admin.wrap .icon-hellip:before{content:"…"}#loco-admin.wrap .icon-vellip:before{content:"⁞"}#loco-admin.wrap .icon-collapse:before{content:""}#loco-admin.wrap .icon-expand:before{content:""}#loco-admin.wrap .icon-wordpress:before{content:""}#loco-admin.wrap .icon-database:before{content:""}#loco-admin.wrap .icon-restore:before{content:""}#loco-admin.wrap .icon-pilcrow:before{content:"¶"}#loco-admin.wrap .icon-status.is-translated:before,#loco-admin.wrap .is-translated>header>.icon-status:before{color:#2e892e;content:"✓";text-align:center}#loco-admin.wrap .icon-status.is-untranslated:before,#loco-admin.wrap .is-untranslated>header>.icon-status:before{color:#aaa;content:"×";text-align:center;font-size:1.1em}#loco-admin.wrap .icon-status.is-flagged:before,#loco-admin.wrap .is-flagged>header>.icon-status:before{color:#bd2c00;content:"";text-align:center}#loco-admin.wrap .icon-status.is-translated.is-blank:before,#loco-admin.wrap .icon-status.is-translated.is-inherit:before,#loco-admin.wrap .is-translated.is-blank>header>.icon-status:before,#loco-admin.wrap .is-translated.is-inherit>header>.icon-status:before{content:"🗌"}#loco-admin.wrap .icon-status.is-fuzzy:before,#loco-admin.wrap .is-fuzzy>header>.icon-status:before{color:#666;content:""}#loco-admin.wrap .lang,#loco-admin.wrap .region,#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy,#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd,#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia,#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca,#loco-admin.wrap .lang-eo,#loco-admin.wrap .lang-eu{color:#fff;background:#2e892e;display:inline-block;text-transform:uppercase;overflow:hidden;font-family:Verdana,Arial,sans-serif;font-size:9px;font-weight:normal;font-style:normal;line-height:12px;text-align:center;white-space:normal;text-shadow:none}#loco-admin.wrap .lang{width:20px;height:12px;line-height:12px;vertical-align:middle}#loco-admin.wrap .lang:before{content:attr(lang);vertical-align:baseline}#loco-admin.wrap .no-lang{width:18px;height:10px;border:solid 1px #2e892e;background:transparent}#loco-admin.wrap .lang-el{background-color:#1d48a3}#loco-admin.wrap .lang-el:before{content:"Ελ"}#loco-admin.wrap .region,#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy,#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd,#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia,#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca,#loco-admin.wrap .lang-eo,#loco-admin.wrap .lang-eu{width:16px;height:12px;margin:0 2px;background-image:url(../img/flags.png?v=2.4.4);background-repeat:no-repeat;background-color:transparent}#loco-admin.wrap .region:before,#loco-admin.wrap .variant-wales:before,#loco-admin.wrap .region-gb.lang-cy:before,#loco-admin.wrap .variant-scotland:before,#loco-admin.wrap .region-gb.lang-gd:before,#loco-admin.wrap .variant-valencia:before,#loco-admin.wrap .region-es.variant-valencia:before,#loco-admin.wrap .lang-ca:before,#loco-admin.wrap .region-es.lang-ca:before,#loco-admin.wrap .lang-eo:before,#loco-admin.wrap .lang-eu:before{visibility:hidden}#loco-admin.wrap .lang-zh{background-color:#b90000}#loco-admin.wrap .lang-zh.script-hans:before{content:"中国"}#loco-admin.wrap .lang-zh.script-hant:before{content:"中國"}#loco-admin.wrap .__{background-position:0 0}#loco-admin.wrap .lang-eo{background-position:0 -12px}#loco-admin.wrap .lang-eu{background-position:0 -24px}#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca{background-position:0 -36px}#loco-admin.wrap .region-tg{background-position:0 -48px}#loco-admin.wrap .region-me{background-position:0 -60px}#loco-admin.wrap .region-la{background-position:0 -73px}#loco-admin.wrap .region-mr{background-position:0 -85px}#loco-admin.wrap .region-ni{background-position:0 -97px}#loco-admin.wrap .region-lv{background-position:0 -109px}#loco-admin.wrap .region-om{background-position:0 -121px}#loco-admin.wrap .region-af{background-position:0 -133px}#loco-admin.wrap .region-cy{background-position:0 -145px}#loco-admin.wrap .region-bj{background-position:0 -157px}#loco-admin.wrap .region-aq{background-position:0 -169px}#loco-admin.wrap .region-cn{background-position:0 -186px}#loco-admin.wrap .region-co{background-position:0 -198px}#loco-admin.wrap .region-cx{background-position:0 -210px}#loco-admin.wrap .region-ag{background-position:0 -222px}#loco-admin.wrap .region-ms{background-position:0 -234px}#loco-admin.wrap .region-md{background-position:0 -246px}#loco-admin.wrap .region-zm{background-position:0 -258px}#loco-admin.wrap .region-vn{background-position:0 -270px}#loco-admin.wrap .region-tf{background-position:0 -282px}#loco-admin.wrap .region-td{background-position:0 -294px}#loco-admin.wrap .region-yt{background-position:0 -306px}#loco-admin.wrap .region-lb{background-position:0 -318px}#loco-admin.wrap .region-mf{background-position:0 -330px}#loco-admin.wrap .region-lu{background-position:0 -347px}#loco-admin.wrap .region-mq{background-position:0 -359px}#loco-admin.wrap .region-cz{background-position:0 -371px}#loco-admin.wrap .region-ae{background-position:0 -383px}#loco-admin.wrap .region-cm{background-position:0 -395px}#loco-admin.wrap .region-bi{background-position:0 -407px}#loco-admin.wrap .region-ar{background-position:0 -419px}#loco-admin.wrap .region-as{background-position:0 -431px}#loco-admin.wrap .region-bh{background-position:0 -443px}#loco-admin.wrap .region-cl{background-position:0 -455px}#loco-admin.wrap .region-ad{background-position:0 -467px}#loco-admin.wrap .region-mp{background-position:0 -479px}#loco-admin.wrap .region-lt{background-position:0 -491px}#loco-admin.wrap .region-mg{background-position:0 -503px}#loco-admin.wrap .region-lc{background-position:0 -515px}#loco-admin.wrap .region-tr{background-position:0 -527px}#loco-admin.wrap .region-ua{background-position:0 -539px}#loco-admin.wrap .region-tv{background-position:0 -551px}#loco-admin.wrap .region-vi{background-position:0 -563px}#loco-admin.wrap .region-mt{background-position:0 -575px}#loco-admin.wrap .region-no{background-position:0 -587px}#loco-admin.wrap .region-mc{background-position:0 -599px}#loco-admin.wrap .region-ch{background-position:0 -611px}#loco-admin.wrap .region-bl{background-position:0 -623px}#loco-admin.wrap .region-aw{background-position:0 -640px}#loco-admin.wrap .region-bz{background-position:0 -652px}#loco-admin.wrap .region-bm{background-position:0 -664px}#loco-admin.wrap .region-ci{background-position:0 -676px}#loco-admin.wrap .region-mu{background-position:0 -688px}#loco-admin.wrap .region-us{background-position:0 -700px}#loco-admin.wrap .region-tw{background-position:0 -712px}#loco-admin.wrap .region-ye{background-position:0 -724px}#loco-admin.wrap .region-mw{background-position:0 -736px}#loco-admin.wrap .region-nl{background-position:0 -748px}#loco-admin.wrap .region-ls{background-position:0 -760px}#loco-admin.wrap .region-bo{background-position:0 -772px}#loco-admin.wrap .region-at{background-position:0 -784px}#loco-admin.wrap .region-ck{background-position:0 -796px}#loco-admin.wrap .region-by{background-position:0 -808px}#loco-admin.wrap .region-au{background-position:0 -820px}#loco-admin.wrap .region-bn{background-position:0 -832px}#loco-admin.wrap .region-ma{background-position:0 -844px}#loco-admin.wrap .region-nz{background-position:0 -856px}#loco-admin.wrap .region-lr{background-position:0 -868px}#loco-admin.wrap .region-mv{background-position:0 -880px}#loco-admin.wrap .region-tc{background-position:0 -892px}#loco-admin.wrap .region-ug{background-position:0 -904px}#loco-admin.wrap .region-tt{background-position:0 -916px}#loco-admin.wrap .region-pl{background-position:0 -928px}#loco-admin.wrap .region-rs{background-position:0 -940px}#loco-admin.wrap .region-in{background-position:0 -952px}#loco-admin.wrap .region-ge{background-position:0 -964px}#loco-admin.wrap .region-gr{background-position:0 -976px}#loco-admin.wrap .region-gs{background-position:0 -988px}#loco-admin.wrap .region-gd{background-position:0 -1000px}#loco-admin.wrap .region-io{background-position:0 -1012px}#loco-admin.wrap .region-hk{background-position:0 -1024px}#loco-admin.wrap .region-kp{background-position:0 -1036px}#loco-admin.wrap .region-kg{background-position:0 -1048px}#loco-admin.wrap .region-pm{background-position:0 -1060px}#loco-admin.wrap .region-sv{background-position:0 -1072px}#loco-admin.wrap .region-re{background-position:0 -1084px}#loco-admin.wrap .region-sa{background-position:0 -1096px}#loco-admin.wrap .region-sc{background-position:0 -1108px}#loco-admin.wrap .region-st{background-position:0 -1120px}#loco-admin.wrap .region-ke{background-position:0 -1132px}#loco-admin.wrap .region-im{background-position:0 -1144px}#loco-admin.wrap .region-kr{background-position:0 -1161px}#loco-admin.wrap .region-gf{background-position:0 -1173px}#loco-admin.wrap .region-dj{background-position:0 -1185px}#loco-admin.wrap .region-gq{background-position:0 -1197px}#loco-admin.wrap .region-gp{background-position:0 -1209px}#loco-admin.wrap .region-dk{background-position:0 -1221px}#loco-admin.wrap .region-gg{background-position:0 -1233px}#loco-admin.wrap .region-il{background-position:0 -1250px}#loco-admin.wrap .region-pn{background-position:0 -1262px}#loco-admin.wrap .region-sb{background-position:0 -1274px}#loco-admin.wrap .region-py{background-position:0 -1286px}#loco-admin.wrap .region-ru{background-position:0 -1298px}#loco-admin.wrap .region-kw{background-position:0 -1310px}#loco-admin.wrap .region-do{background-position:0 -1322px}#loco-admin.wrap .region-gt{background-position:0 -1334px}#loco-admin.wrap .region-gb{background-position:0 -1346px}#loco-admin.wrap .region-gu{background-position:0 -1358px}#loco-admin.wrap .region-je{background-position:0 -1370px}#loco-admin.wrap .region-hm{background-position:0 -1387px}#loco-admin.wrap .region-sg{background-position:0 -1399px}#loco-admin.wrap .region-pk{background-position:0 -1411px}#loco-admin.wrap .region-sr{background-position:0 -1423px}#loco-admin.wrap .region-se{background-position:0 -1435px}#loco-admin.wrap .region-jp{background-position:0 -1447px}#loco-admin.wrap .region-gw{background-position:0 -1459px}#loco-admin.wrap .region-eh{background-position:0 -1471px}#loco-admin.wrap .region-dz{background-position:0 -1483px}#loco-admin.wrap .region-ga{background-position:0 -1495px}#loco-admin.wrap .region-fr{background-position:0 -1507px}#loco-admin.wrap .region-dm{background-position:0 -1519px}#loco-admin.wrap .region-hn{background-position:0 -1531px}#loco-admin.wrap .region-sd{background-position:0 -1543px}#loco-admin.wrap .region-rw{background-position:0 -1555px}#loco-admin.wrap .region-ph{background-position:0 -1567px}#loco-admin.wrap .region-ss{background-position:0 -1579px}#loco-admin.wrap .region-qa{background-position:0 -1596px}#loco-admin.wrap .region-pe{background-position:0 -1608px}#loco-admin.wrap .region-pr{background-position:0 -1620px}#loco-admin.wrap .region-si{background-position:0 -1632px}#loco-admin.wrap .region-ht{background-position:0 -1644px}#loco-admin.wrap .region-es{background-position:0 -1656px}#loco-admin.wrap .region-gl{background-position:0 -1668px}#loco-admin.wrap .region-gm{background-position:0 -1680px}#loco-admin.wrap .region-er{background-position:0 -1692px}#loco-admin.wrap .region-fi{background-position:0 -1704px}#loco-admin.wrap .region-ee{background-position:0 -1716px}#loco-admin.wrap .region-kn{background-position:0 -1728px}#loco-admin.wrap .region-hu{background-position:0 -1740px}#loco-admin.wrap .region-iq{background-position:0 -1752px}#loco-admin.wrap .region-ky{background-position:0 -1764px}#loco-admin.wrap .region-sh{background-position:0 -1776px}#loco-admin.wrap .region-ps{background-position:0 -1788px}#loco-admin.wrap .region-pf{background-position:0 -1800px}#loco-admin.wrap .region-sj{background-position:0 -1812px}#loco-admin.wrap .region-id{background-position:0 -1824px}#loco-admin.wrap .region-is{background-position:0 -1836px}#loco-admin.wrap .region-eg{background-position:0 -1848px}#loco-admin.wrap .region-fk{background-position:0 -1860px}#loco-admin.wrap .region-fj{background-position:0 -1872px}#loco-admin.wrap .region-gn{background-position:0 -1884px}#loco-admin.wrap .region-gy{background-position:0 -1896px}#loco-admin.wrap .region-ir{background-position:0 -1908px}#loco-admin.wrap .region-km{background-position:0 -1920px}#loco-admin.wrap .region-ie{background-position:0 -1932px}#loco-admin.wrap .region-kz{background-position:0 -1944px}#loco-admin.wrap .region-ro{background-position:0 -1956px}#loco-admin.wrap .region-sk{background-position:0 -1968px}#loco-admin.wrap .region-pg{background-position:0 -1980px}#loco-admin.wrap .region-pt{background-position:0 -1992px}#loco-admin.wrap .region-so{background-position:0 -2004px}#loco-admin.wrap .region-sx{background-position:0 -2016px}#loco-admin.wrap .region-hr{background-position:0 -2033px}#loco-admin.wrap .region-ki{background-position:0 -2045px}#loco-admin.wrap .region-jm{background-position:0 -2057px}#loco-admin.wrap .region-ec{background-position:0 -2069px}#loco-admin.wrap .region-et{background-position:0 -2081px}#loco-admin.wrap .region-fo{background-position:0 -2093px}#loco-admin.wrap .region-kh{background-position:0 -2105px}#loco-admin.wrap .region-sy{background-position:0 -2117px}#loco-admin.wrap .region-sn{background-position:0 -2129px}#loco-admin.wrap .region-pw{background-position:0 -2141px}#loco-admin.wrap .region-sl{background-position:0 -2153px}#loco-admin.wrap .region-fm{background-position:0 -2165px}#loco-admin.wrap .region-gi{background-position:0 -2177px}#loco-admin.wrap .region-de{background-position:0 -2189px}#loco-admin.wrap .region-gh{background-position:0 -2201px}#loco-admin.wrap .region-jo{background-position:0 -2213px}#loco-admin.wrap .region-it{background-position:0 -2225px}#loco-admin.wrap .region-pa{background-position:0 -2237px}#loco-admin.wrap .region-sz{background-position:0 -2249px}#loco-admin.wrap .region-sm{background-position:0 -2261px}#loco-admin.wrap .region-tn{background-position:0 -2273px}#loco-admin.wrap .region-ml{background-position:0 -2285px}#loco-admin.wrap .region-cg{background-position:0 -2297px}#loco-admin.wrap .region-ax{background-position:0 -2309px}#loco-admin.wrap .region-ao{background-position:0 -2321px}#loco-admin.wrap .region-bt{background-position:0 -2333px}#loco-admin.wrap .region-an{background-position:0 -2345px}#loco-admin.wrap .region-bb{background-position:0 -2357px}#loco-admin.wrap .region-cf{background-position:0 -2369px}#loco-admin.wrap .region-mm{background-position:0 -2381px}#loco-admin.wrap .region-li{background-position:0 -2393px}#loco-admin.wrap .region-na{background-position:0 -2405px}#loco-admin.wrap .region-mz{background-position:0 -2417px}#loco-admin.wrap .region-to{background-position:0 -2429px}#loco-admin.wrap .region-vg{background-position:0 -2441px}#loco-admin.wrap .region-ve{background-position:0 -2453px}#loco-admin.wrap .region-tz{background-position:0 -2465px}#loco-admin.wrap .region-tm{background-position:0 -2477px}#loco-admin.wrap .region-mx{background-position:0 -2489px}#loco-admin.wrap .region-nc{background-position:0 -2501px}#loco-admin.wrap .region-mo{background-position:0 -2513px}#loco-admin.wrap .region-lk{background-position:0 -2525px}#loco-admin.wrap .region-cd{background-position:0 -2537px}#loco-admin.wrap .region-al{background-position:0 -2549px}#loco-admin.wrap .region-bw{background-position:0 -2561px}#loco-admin.wrap .region-cs{background-position:0 -2573px}#loco-admin.wrap .region-cr{background-position:0 -2585px}#loco-admin.wrap .region-bv{background-position:0 -2597px}#loco-admin.wrap .region-am{background-position:0 -2609px}#loco-admin.wrap .region-az{background-position:0 -2621px}#loco-admin.wrap .region-ba{background-position:0 -2633px}#loco-admin.wrap .region-mn{background-position:0 -2645px}#loco-admin.wrap .region-nu{background-position:0 -2657px}#loco-admin.wrap .region-my{background-position:0 -2669px}#loco-admin.wrap .region-tl{background-position:0 -2681px}#loco-admin.wrap .region-ws{background-position:0 -2693px}#loco-admin.wrap .region-th{background-position:0 -2705px}#loco-admin.wrap .region-nf{background-position:0 -2717px}#loco-admin.wrap .region-ly{background-position:0 -2729px}#loco-admin.wrap .region-ai{background-position:0 -2741px}#loco-admin.wrap .region-br{background-position:0 -2753px}#loco-admin.wrap .region-cv{background-position:0 -2765px}#loco-admin.wrap .region-be{background-position:0 -2777px}#loco-admin.wrap .region-ca{background-position:0 -2789px}#loco-admin.wrap .region-bd{background-position:0 -2801px}#loco-admin.wrap .region-cw{background-position:0 -2813px}#loco-admin.wrap .region-bs{background-position:0 -2830px}#loco-admin.wrap .region-ng{background-position:0 -2842px}#loco-admin.wrap .region-mk{background-position:0 -2854px}#loco-admin.wrap .region-np{background-position:0 -2866px}#loco-admin.wrap .region-va{background-position:0 -2878px}#loco-admin.wrap .region-uz{background-position:0 -2890px}#loco-admin.wrap .region-um{background-position:0 -2902px}#loco-admin.wrap .region-tk{background-position:0 -2914px}#loco-admin.wrap .region-vc{background-position:0 -2926px}#loco-admin.wrap .region-zw{background-position:0 -2938px}#loco-admin.wrap .region-nr{background-position:0 -2950px}#loco-admin.wrap .region-ne{background-position:0 -2962px}#loco-admin.wrap .region-cu{background-position:0 -2974px}#loco-admin.wrap .region-bq{background-position:0 -2986px}#loco-admin.wrap .region-bf{background-position:0 -2998px}#loco-admin.wrap .region-bg{background-position:0 -3010px}#loco-admin.wrap .region-cc{background-position:0 -3022px}#loco-admin.wrap .region-mh{background-position:0 -3034px}#loco-admin.wrap .region-za{background-position:0 -3046px}#loco-admin.wrap .region-uy{background-position:0 -3058px}#loco-admin.wrap .region-wf{background-position:0 -3070px}#loco-admin.wrap .region-vu{background-position:0 -3082px}#loco-admin.wrap .region-tj{background-position:0 -3094px}#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd{background-position:0 -3106px}#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia{background-position:0 -3118px}#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy{background-position:0 -3130px}#loco-admin.wrap .x-eu{background-position:0 -3142px}#loco-admin.wrap span.lang code{display:none}#loco-admin.wrap .icon-notag:before{content:""}#loco-admin.wrap .icon-python:before{content:"🐍"}#loco-admin.wrap .icon-unicode:before{content:"u"}#loco-admin.wrap .icon-json:before{content:"{"}#loco-admin.wrap .icon-bullist:before{content:""}#loco-admin.wrap .icon-numlist:before{content:""}#loco-admin.wrap .icon-indent:before{content:""}#loco-admin.wrap .icon-outdent:before{content:""}#loco-admin.wrap .icon-link:before{content:""}#loco-admin.wrap .icon-unlink:before{content:""}#loco-admin.wrap .icon-bold:before{content:"B"}#loco-admin.wrap .icon-italic:before{content:"I"}#loco-admin.wrap .icon-translate:before{content:""}#loco-admin.wrap .icon-proj:before{content:""}#loco-admin.wrap .icon-plural:before{content:"᛬"}#loco-admin.wrap .icon-max:before,#loco-admin.wrap .icon-full-screen:before{content:""}#loco-admin.wrap .icon-min:before{content:""}#loco-admin.wrap .icon-sort:before{content:""}#loco-admin.wrap .icon-ok:before,#loco-admin.wrap .notice-success>.has-icon:before,#loco-admin.wrap .notice-success p>strong.has-icon:before{content:"✓"}#loco-admin.wrap .icon-ok-empty:before{content:"🗌"}#loco-admin.wrap .icon-checkbox-checked:before,#loco-admin.wrap .selector.multi li.checked .icon-checkbox:before{content:"☑"}#loco-admin.wrap .icon-checkbox-unchecked:before{content:"☐"}#loco-admin.wrap .icon-checkbox-partial:before{content:"☉"}#loco-admin.wrap .icon-radio-checked:before{content:"⚫"}#loco-admin.wrap .icon-radio-unchecked:before{content:"⚪"}#loco-admin.wrap .icon-ext:before{content:"⬈"}#loco-admin.wrap .icon-share:before{content:""}#loco-admin.wrap .icon-star:before{content:""}#loco-admin.wrap .icon-user:before{content:""}#loco-admin.wrap .icon-remove:before,#loco-admin.wrap a.icon.close:before{content:"×"}#loco-admin.wrap .icon-cog:before{content:""}#loco-admin.wrap .icon-trash:before{content:""}#loco-admin.wrap .icon-time:before,#loco-admin.wrap .icon-history:before{content:""}#loco-admin.wrap .icon-download:before{content:""}#loco-admin.wrap .icon-revert:before{content:""}#loco-admin.wrap .icon-sync:before{content:""}#loco-admin.wrap .icon-lock:before,#loco-admin.wrap .notice-locked>.has-icon:before,#loco-admin.wrap .notice-locked p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-flag:before{content:""}#loco-admin.wrap .icon-tag:before{content:""}#loco-admin.wrap .icon-tags:before{content:""}#loco-admin.wrap .icon-print:before{content:""}#loco-admin.wrap .icon-camera:before{content:""}#loco-admin.wrap .icon-pencil:before{content:""}#loco-admin.wrap .icon-add:before{content:""}#loco-admin.wrap .icon-del:before{content:""}#loco-admin.wrap .icon-clear:before,#loco-admin.wrap a.icon.clear:before{content:""}#loco-admin.wrap .icon-ok-sign:before{content:"✔"}#loco-admin.wrap .icon-help:before{content:"?"}#loco-admin.wrap .icon-info:before,#loco-admin.wrap .notice-info>.has-icon:before,#loco-admin.wrap .notice-info p>strong.has-icon:before{content:"ℹ"}#loco-admin.wrap .icon-cancel:before{content:""}#loco-admin.wrap .icon-warn:before,#loco-admin.wrap .notice-error>.has-icon:before,#loco-admin.wrap .notice-error p>strong.has-icon:before,#loco-admin.wrap .notice-warning>.has-icon:before,#loco-admin.wrap .notice-warning p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-comment:before{content:""}#loco-admin.wrap .icon-bar-chart:before{content:""}#loco-admin.wrap .icon-key:before{content:""}#loco-admin.wrap .icon-cogs:before{content:""}#loco-admin.wrap .icon-comments:before{content:""}#loco-admin.wrap .icon-signout:before{content:""}#loco-admin.wrap .icon-signin:before{content:""}#loco-admin.wrap .icon-upload:before{content:""}#loco-admin.wrap .icon-twitter:before{content:"🐦"}#loco-admin.wrap .icon-facebook:before{content:""}#loco-admin.wrap .icon-github:before{content:""}#loco-admin.wrap .icon-feed:before{content:""}#loco-admin.wrap .icon-globe:before{content:""}#loco-admin.wrap .icon-wrench:before,#loco-admin.wrap .notice-debug>.has-icon:before,#loco-admin.wrap .notice-debug p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-group:before{content:""}#loco-admin.wrap .icon-cloud:before{content:""}#loco-admin.wrap .icon-copy:before{content:""}#loco-admin.wrap .icon-save:before{content:""}#loco-admin.wrap .icon-menu:before{content:""}#loco-admin.wrap .icon-table:before{content:""}#loco-admin.wrap .icon-caret-down:before{content:"▼"}#loco-admin.wrap .icon-caret-up:before{content:"▲"}#loco-admin.wrap .icon-caret-right:before{content:"▶"}#loco-admin.wrap .icon-mail:before{content:""}#loco-admin.wrap .icon-cloud-upload:before{content:""}#loco-admin.wrap .icon-file:before{content:""}#loco-admin.wrap .icon-circle-white:before{content:"⚬"}#loco-admin.wrap .icon-circle-black:before{content:"●"}#loco-admin.wrap .icon-eraser:before{content:""}#loco-admin.wrap .icon-unlock:before{content:""}#loco-admin.wrap .icon-apple:before{content:""}#loco-admin.wrap .icon-android:before{content:""}#loco-admin.wrap .icon-robot:before{content:"🤖"}#loco-admin.wrap .icon-back:before{content:"⬅"}#loco-admin.wrap .icon-next:before{content:"➔"}#loco-admin.wrap .icon-arrow-up:before{content:""}#loco-admin.wrap .icon-ccard:before{content:""}#loco-admin.wrap .icon-caret-left:before{content:"◀"}#loco-admin.wrap .icon-pro:before{content:"⚡"}#loco-admin.wrap .icon-bell:before{content:""}#loco-admin.wrap .icon-code:before{content:""}#loco-admin.wrap .icon-privacy:before{content:"🛡"}#loco-admin.wrap .icon-hellip:before{content:"…"}#loco-admin.wrap .icon-vellip:before{content:"⁞"}#loco-admin.wrap .icon-collapse:before{content:""}#loco-admin.wrap .icon-expand:before{content:""}#loco-admin.wrap .icon-wordpress:before{content:""}#loco-admin.wrap .icon-database:before{content:""}#loco-admin.wrap .icon-restore:before{content:""}#loco-admin.wrap .icon-pilcrow:before{content:"¶"}#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before,#loco-admin.wrap .has-dashicon:before{speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco"}#loco-admin.wrap .has-dashicon:before{font-family:"dashicons";font-size:1.4em}#loco-admin.wrap .has-icon:before,#loco-admin.wrap .has-dashicon:before,#loco-admin.wrap .has-icon>span{display:inline-block;vertical-align:middle}#loco-admin.wrap .only-icon{text-align:center}#loco-admin.wrap .only-icon:before{text-align:center;padding:0}#loco-admin.wrap .only-icon span{display:none}#loco-admin.wrap a,#loco-admin.wrap .wp-core-ui .button-link{text-decoration:none}#loco-admin.wrap h3:hover>a.loco-anchor{color:#ccc}#loco-admin.wrap h3:hover>a.loco-anchor:before{content:"¶"}#loco-admin.wrap .has-lang>span{display:inline-block;vertical-align:middle}#loco-admin.wrap a.has-lang:hover>span:last-child{text-decoration:underline}#loco-admin.wrap h1 ul,#loco-admin.wrap h1 li{margin:0;padding:0}#loco-admin.wrap h1 li{display:inline-block}#loco-admin.wrap h1 li:after{content:"/";color:#999;text-shadow:none;display:inline-block}#loco-admin.wrap h1 li:last-child:after{content:""}#loco-admin.wrap h1 li:last-child a{color:inherit;pointer-events:none;cursor:auto}#loco-admin.wrap h2 span{color:#999;font-weight:normal}#loco-admin.wrap h2 .loco-meta,#loco-admin.wrap h3 .loco-meta{color:inherit;font-size:14px;font-weight:normal;vertical-align:middle}#loco-admin.wrap .wp-list-table td:first-child .icon{width:16px;display:inline-block;text-align:center}#loco-admin.wrap .wp-list-table td{white-space:nowrap}#loco-admin.wrap .wp-list-table td>a,#loco-admin.wrap .wp-list-table td>time{display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis}#loco-admin.wrap .wp-list-table th.loco-sort{cursor:pointer}#loco-admin.wrap .wp-list-table th.loco-sort:hover{color:#000}#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after{padding:0 0 0 4px;color:#999}#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after{content:"▼"}#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after{content:"▲"}#loco-admin.wrap .wp-list-table td.has-row-actions{overflow:visible}#loco-admin.wrap form.loco-filter{display:block;margin-bottom:5px}#loco-admin.wrap form.loco-filter .icon-filter{color:#999}#loco-admin.wrap nav.above-list-table{margin-bottom:1em}#loco-admin.wrap nav.above-list-table a{display:inline-block;margin-right:1em}#loco-admin.wrap .wp-core-ui button.inverted,#loco-admin.wrap .wp-core-ui button.inverted:hover,#loco-admin.wrap .po-fuzzy button.icon-cloud{background:-moz-linear-gradient(top, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);background:-webkit-linear-gradient(top, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);background:linear-gradient(to bottom, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);-webkit-box-shadow:0 1px 0 #fff;-moz-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;border-color:gray}#loco-admin.wrap .wp-core-ui button:active,#loco-admin.wrap .wp-core-ui button.inverted:active{border-color:#5b9dd9}#loco-admin.wrap .loco-clearable{display:inline-block;vertical-align:middle;position:relative}#loco-admin.wrap .loco-clearable a.clear,#loco-admin.wrap .auto-comp-wrap a.clear{top:0;right:0;outline:none;margin:0;border:solid 1px transparent;padding:5px 5px;position:absolute;font-size:1em;line-height:normal}#loco-admin.wrap .loco-clearable a.clear:before,#loco-admin.wrap .auto-comp-wrap a.clear:before{vertical-align:middle;padding:0;color:#999}#loco-admin.wrap .loco-clearable a.clear:hover:before,#loco-admin.wrap .auto-comp-wrap a.clear:hover:before{color:#333}#loco-admin.wrap .loco-clearable a.clear span,#loco-admin.wrap .auto-comp-wrap a.clear span{display:none}#loco-admin.wrap .loco-clearable ::-ms-clear,#loco-admin.wrap .auto-comp-wrap ::-ms-clear{display:none}#loco-admin.wrap div.progress{color:#000;background:transparent !important}#loco-admin.wrap div.progress *{height:100%;overflow:hidden;white-space:nowrap}#loco-admin.wrap div.progress .t{background-color:#ddd;border:1px solid #ccc}#loco-admin.wrap div.progress .t .bar{float:left;clear:none;background-color:#3db63d}#loco-admin.wrap div.progress .t .bar.f{background-color:#bd2c00}#loco-admin.wrap div.progress .l{display:block}#loco-admin.wrap td div.progress .t{border:none}#loco-admin.wrap td div.progress .l{display:none}#loco-admin.wrap code.path{color:#333;margin:0;padding:0;display:inline;background:transparent}#loco-admin.wrap .loco-danger{color:#d54e21}#loco-admin.wrap .notice,#loco-admin.wrap .panel{background:#fff;position:relative;margin:1em 0;padding:1px 12px}#loco-admin.wrap .notice-generic{border-color:#ddd}#loco-admin.wrap .notice-success>.has-icon,#loco-admin.wrap .notice-success p>strong.has-icon{color:#000}#loco-admin.wrap .notice-warning{border-color:orange}#loco-admin.wrap .notice-error{border-color:#dc3232}#loco-admin.wrap .notice-debug{border-color:#00a0d2}#loco-admin.wrap .notice-danger{border-color:#dc3232}#loco-admin.wrap .notice-locked{border-color:orange}#loco-admin.wrap .notice>.has-icon:before,#loco-admin.wrap .notice p>strong.has-icon:before{padding-right:6px}#loco-admin.wrap .notice>p>a.button.has-icon:before{width:1.2em}#loco-admin.wrap .notice>p>em{color:#d54e21;font-style:normal}#loco-admin.wrap .notice>p>em a{color:inherit}#loco-admin.wrap .notice>p a:hover,#loco-admin.wrap .notice>nav a:hover{text-decoration:underline}#loco-admin.wrap .notice>p a.button,#loco-admin.wrap .notice>nav a.button{text-decoration:inherit}#loco-admin.wrap .notice.has-nav{display:flex;flex-direction:row}#loco-admin.wrap .notice.has-nav p,#loco-admin.wrap .notice.has-nav nav{line-height:22px;flex-grow:1}#loco-admin.wrap .notice.has-nav nav{text-align:right;padding:2px;margin:.5em 0}#loco-admin.wrap .notice.has-nav.is-dismissible{padding-right:38px}#loco-admin.wrap .notice.has-nav a{white-space:nowrap}#loco-admin.wrap .notice.has-nav nav>span{color:#666}#loco-admin.wrap .notice>h3>span{display:inline-block;vertical-align:middle}#loco-admin.wrap ul.problems li{font-style:italic}#loco-admin.wrap label{position:relative}#loco-admin.wrap label.for-disabled,#loco-admin.wrap label.for-disabled>input{cursor:default !important}#loco-admin.wrap input.regular-text,#loco-admin.wrap textarea.regular-text{width:25em}#loco-admin.wrap .button-link{padding:0 10px 1px}#loco-admin.wrap .button-danger{background:#ba0000;border-color:#900 #600 #600;-webkit-box-shadow:0 1px 0 #600;-moz-box-shadow:0 1px 0 #600;box-shadow:0 1px 0 #600;color:#fff;text-shadow:0 -1px 1px #600,1px 0 1px #600,0 1px 1px #600,-1px 0 1px #600}#loco-admin.wrap .button-success{background:#00b500;border-color:#090 #2e892e #2e892e;-webkit-box-shadow:0 1px 0 #2e892e;-moz-box-shadow:0 1px 0 #2e892e;box-shadow:0 1px 0 #2e892e;color:#fff;text-shadow:0 -1px 1px #2e892e,1px 0 1px #2e892e,0 1px 1px #2e892e,-1px 0 1px #2e892e}#loco-admin.wrap .button-success:hover{background:#3db63d}#loco-admin.wrap .button-danger[disabled],#loco-admin.wrap .button-success[disabled]{text-shadow:none !important}#loco-admin.wrap form button.loco-loading.button-large{padding-left:0}#loco-admin.wrap form button.loco-loading.button-large:before{width:16px;height:16px;margin:0 4px;content:" ";font-size:16px;line-height:1;display:inline-block;vertical-align:sub}#loco-admin.wrap ::placeholder{color:#ccc}#loco-admin.wrap ::-webkit-input-placeholder{color:#ccc}#loco-admin.wrap :-moz-placeholder{color:#ccc;opacity:1}#loco-admin.wrap ::-moz-placeholder{color:#ccc;opacity:1}#loco-admin.wrap :-ms-input-placeholder{color:#ccc}#loco-admin.wrap .ielt10 .placeheld{color:#ccc}#loco-admin.wrap a.has-raquo:after{content:" »"}#loco-admin.wrap a.has-laquo:before{content:"« "}#loco-admin.wrap span.inline-spinner{display:inline-block;min-width:16px;min-height:16px;background:transparent url(../img/spin-modal.gif?v=2.4.4) 0 0 no-repeat}.js #wpbody-content>.notice{display:none}.js #wpbody-content>.notice.inline{display:block}.js #loco-admin.wrap .jshide,.no-js #loco-admin.wrap .jsonly{display:none !important}#loco-admin.wrap .invis{visibility:hidden}.form-table tr{vertical-align:top}.form-table tr.compact td{padding-top:0}.loco-modal{min-width:50%;min-height:100px}.loco-modal-wide{min-width:90% !important}.loco-modal-no-close .ui-dialog-titlebar-close{display:none}.loco-modal.request-filesystem-credentials-dialog{top:15% !important;max-height:85% !important}.loco-modal.request-filesystem-credentials-dialog>.ui-dialog-content{background:inherit}.loco-modal.request-filesystem-credentials-dialog .ftp-password>label>em:last-child{display:none}.ui-dialog-content>div.loco-loading{height:100%;background:transparent url(../img/spin-modal.gif?v=2.4.4) center 20px no-repeat}#loco-po-ref ol li{color:#aaa;margin:0;white-space:pre;padding:0 0 0 1em;font:normal 12px/17px Consolas,Monaco,monospace;background:transparent;border-left:1px solid #eee}#loco-po-ref ol li code{margin:0;padding:0;display:inline;background:inherit}#loco-po-ref ol li.highlighted{color:#666;background-color:#f8eec7}#loco-po-ref ol li.highlighted code.T_CONSTANT_ENCAPSED_STRING{color:#c931c7}#loco-credit>*{vertical-align:middle}#loco-credit>a{display:inline-block;position:relative;overflow:hidden;background:transparent url(../img/logo-foot.gif?v=2.4.4) 0 0 no-repeat;height:30px;width:100px;text-indent:200px;-webkit-transition-duration:0s;transition-duration:0s}#loco-credit>a:hover{background-position:0 -35px}#loco-content{position:relative}#footer-upgrade span:before{color:#ccc;content:" | ";display:inline;padding-left:.5em;padding-right:.5em}#footer-upgrade span:first-child:before{content:"";display:none}.loco-clearfix:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}dl.debug dt{font-weight:bold}dl.debug dt,dl.debug dd{white-space:pre}.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(0,115,170,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#0073aa;foo:#0073aa}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#66c6e4 !important;background:#008ec2 !important;border-color:#008ec2 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../img/skins/fresh/spin-primary-button.gif?v=2.4.4) 0 0 no-repeat !important}
|
1 |
+
._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.5) 0 0 no-repeat;min-height:75px}._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.5);background-size:16px}._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.5);background-size:16px}}._green_glow_inner{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}.loco-font,#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after,#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:"loco";src:url("../font/loco.eot?v=2.4.5");src:url("../font/loco.eot?v=2.4.5?#iefix") format("embedded-opentype"),url("../font/loco.woff?v=2.4.5") format("woff"),url("../font/loco.ttf?v=2.4.5") format("truetype"),url("../font/loco.svg?v=2.4.5#loco") format("svg");font-weight:normal;font-style:normal}.tipsy{font-size:11px;position:absolute;padding:5px;z-index:500001;opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.tipsy.in{opacity:1}.tipsy-inner{background-color:#000;color:#fff;white-space:nowrap;padding:6px 8px;line-height:1.3em;text-align:center;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-font-smoothing:subpixel-antialiased}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.tipsy-n .tipsy-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}#loco-admin.wrap .selector li,#loco-admin.wrap .selector .handle,#loco-admin.wrap .selectoradd a,#loco-admin.wrap .selectorsep:before,#loco-admin.wrap .selectorsep span{padding:.3em .75em}#loco-admin.wrap .selector{text-align:left;display:inline-block;white-space:nowrap}#loco-admin.wrap .selectoradd a,#loco-admin.wrap .selector .handle{cursor:default;display:block;position:relative;border-top:solid 1px #fff;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-left:solid 1px #fff;color:#666;height:1.3em;overflow:hidden;white-space:normal}#loco-admin.wrap .selectorsep{display:inline-block;border:solid 1px transparent}#loco-admin.wrap .selectorsep:before{display:block;position:relative;color:#999;height:1.3em;overflow:hidden}#loco-admin.wrap .selectorsep>*{display:block;line-height:1em;color:#666;height:1.3em;overflow:hidden}#loco-admin.wrap .selector .handle{outline:none;white-space:nowrap;padding-right:2.3em;max-width:250px;text-overflow:ellipsis}#loco-admin.wrap .selector .handle .prefix{padding-right:.6ex}#loco-admin.wrap .selector .handle:after{font-family:loco;font-size:1.3em;color:#ccc;display:block;position:absolute;top:.25em;right:.6em;content:"▼"}#loco-admin.wrap .selector .handle:focus:after,#loco-admin.wrap .selector .handle:hover:after{color:#666}#loco-admin.wrap .selector.no-caret .handle{padding-right:.75em}#loco-admin.wrap .selector.no-caret .handle:after{display:none}#loco-admin.wrap .selector.no-title .handle{padding-left:.5em;padding-right:.5em}#loco-admin.wrap .selector.no-title .handle .label{display:none}#loco-admin.wrap .selector.no-title .handle .icon{margin-right:0px}#loco-admin.wrap .selector.dummy .handle{border-color:transparent}#loco-admin.wrap .selector.dummy .handle:after{display:none}#loco-admin.wrap .selectoradd{position:relative}#loco-admin.wrap .selectoradd>*{display:block;float:left;clear:none}#loco-admin.wrap .selectoradd>a.has-icon{width:1.3em}#loco-admin.wrap .selectoradd>a.has-icon:before{color:#999;display:inline;padding-left:0;padding-right:0;line-height:1.4em}#loco-admin.wrap .selectoradd>a.has-icon:hover:after{color:#2e892e}#loco-admin.wrap .selectorsep{display:inline-block}#loco-admin.wrap .selectorsep span{color:#666;height:1.3em}#loco-admin.wrap .selector ul{padding:0}#loco-admin.wrap .selector ul,#loco-admin.wrap .selector li{display:block;position:relative;cursor:default;margin:0}#loco-admin.wrap .selector ul{z-index:5;position:absolute;left:0;top:0;background:#f5f5f5;box-shadow:0 10px 5px rgba(0,0,0,.2);border:solid 1px #ccc;overflow:auto}#loco-admin.wrap .selector.up ul{margin-top:0}#loco-admin.wrap .selector.multi li input{display:none}#loco-admin.wrap .selector.multi li.checked{background:#e5e5e5}#loco-admin.wrap .selector li.active{background:#e5e5e5 !important}#loco-admin.wrap .selector li.over{background:#ccc !important;color:#fff;text-shadow:1px 1px #aaa}#loco-admin.wrap .selector li.over .label{color:#fff}#loco-admin.wrap .selector .label{font:inherit;color:inherit}#loco-admin.wrap .selector .icon{display:inline-block;min-width:1.2em;text-align:center;font-size:14px}#loco-admin.wrap .selector .icon.no-icon{display:none}#loco-admin.wrap .selector .icon:before{color:#666}#loco-admin.wrap .selector .avtr{width:18px;height:18px;background-size:18px;background-repeat:no-repeat}#loco-admin.wrap .selector .label{line-height:1}#loco-admin.wrap .selector .icon,#loco-admin.wrap .selector .icon-16{vertical-align:bottom}#loco-admin.wrap .selector .icon,#loco-admin.wrap .selector .lang,#loco-admin.wrap .selector .icon-16{margin-right:5px}#loco-admin.wrap .selector .region,#loco-admin.wrap .selector .variant-wales,#loco-admin.wrap .selector .region-gb.lang-cy,#loco-admin.wrap .selector .variant-scotland,#loco-admin.wrap .selector .region-gb.lang-gd,#loco-admin.wrap .selector .variant-valencia,#loco-admin.wrap .selector .region-es.variant-valencia,#loco-admin.wrap .selector .lang-ca,#loco-admin.wrap .selector .region-es.lang-ca,#loco-admin.wrap .selector .lang-eo,#loco-admin.wrap .selector .lang-eu{margin-left:2px;margin-right:7px}#loco-admin.wrap .selector.ticked .icon.no-icon{font-size:12px;display:inline-block}#loco-admin.wrap .selector.ticked .active .icon.no-icon:before{content:"✓"}#loco-admin.wrap .selectoradd a:hover,#loco-admin.wrap .selector a.handle:focus,#loco-admin.wrap .selector a.handle:hover{color:#000;border-color:#999}#loco-admin.wrap .selector.active .handle{border-color:#999;background-color:#eee;color:#999}#loco-admin.wrap .selector.active .handle:after{color:#999;content:"▲"}#loco-admin.wrap .selector.disabled{cursor:default;cursor:no-drop;cursor:not-allowed}#loco-admin.wrap .selector.disabled .handle{pointer-events:none;border-top:solid 1px #fff;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-left:solid 1px #fff;color:#999;padding-right:1em}#loco-admin.wrap .selector.disabled .handle:after{display:none}#loco-admin.wrap .selector.disabled .handle span.icon{color:#999 !important}#loco-admin.wrap .selector li.disabled,#loco-admin.wrap .selector li.disabled.over{color:#aaa;text-shadow:1px 1px #fff;pointer-events:none}#loco-admin.wrap .selector li.disabled *{cursor:text}#loco-admin.wrap .selector li.disabled .icon:before{color:#aaa}#loco-admin.wrap .selector li.disabled .flag,#loco-admin.wrap .selector li.disabled .icon-16{opacity:.4}#loco-admin.wrap .selector.lefty ul{left:auto;right:0}#loco-admin.wrap .selector.lefty ul .icon,#loco-admin.wrap .selector.lefty ul .icon-32{display:block;float:right;clear:none}#loco-admin.wrap .selector.lefty ul .label{padding-right:32px;padding-left:0}#loco-admin.wrap .selector ul>form{margin:0;display:block}#loco-admin.wrap .selector ul>form input{margin:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#loco-admin.wrap .selector ul>form input:focus{-webkit-box-shadow:inset 0 0 5px 0 #3db63d;-moz-box-shadow:inset 0 0 5px 0 #3db63d;box-shadow:inset 0 0 5px 0 #3db63d}#loco-admin.wrap .selector ul>form input.error{border-color:#c00;-webkit-box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5);-moz-box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5);box-shadow:inset 0 0 5px 0 rgba(153,0,0,.5)}#loco-admin.wrap .selector ul>form a.clear{margin:0;border:none}#loco-admin.wrap .selector ul>form ::placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form ::-webkit-input-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form :-moz-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block;opacity:1}#loco-admin.wrap .selector ul>form ::-moz-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block;opacity:1}#loco-admin.wrap .selector ul>form :-ms-input-placeholder{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap .selector ul>form .ielt10 .placeheld{color:gray;font-size:16px;font-family:"loco";text-align:right;display:block}#loco-admin.wrap div.auto-comp-wrap{width:100%}#loco-admin.wrap div.auto-comp-wrap input{display:inline-block}#loco-admin.wrap div.auto-comp-wrap.loading input{background:transparent url(../img/ajax-loader.gif?v=2.4.5) right 2px no-repeat}#loco-admin.wrap div.auto-comp-drop{color:#333;background:#fff;border-top:none;position:absolute;width:auto;top:0;left:0;z-index:99;-webkit-box-shadow:0 5px 5px rgba(0,0,0,.4);-moz-box-shadow:0 5px 5px rgba(0,0,0,.4);box-shadow:0 5px 5px rgba(0,0,0,.4)}#loco-admin.wrap div.auto-comp-result{padding:5px 10px;cursor:pointer;background:#f0f0f0;border-top:solid 1px #fff;border-bottom:solid 1px #ddd;white-space:nowrap}#loco-admin.wrap div.auto-comp-result:first-child{border-top:solid 1px #ddd}#loco-admin.wrap div.auto-comp-result>*{display:inline-block;vertical-align:middle;line-height:normal}#loco-admin.wrap div.auto-comp-result .icon:before{padding-right:5px}#loco-admin.wrap div.auto-comp-result:hover{background:#a8a8a8;color:#fff;border-top-color:#a8a8a8;border-bottom-color:#999}#loco-admin.wrap div.auto-comp-result.selected{background:#666 !important;color:#fff;border-top-color:#666;border-bottom-color:#666}#loco-admin.wrap div.auto-comp-result .lang,#loco-admin.wrap div.auto-comp-result .region,#loco-admin.wrap div.auto-comp-result .variant-wales,#loco-admin.wrap div.auto-comp-result .region-gb.lang-cy,#loco-admin.wrap div.auto-comp-result .variant-scotland,#loco-admin.wrap div.auto-comp-result .region-gb.lang-gd,#loco-admin.wrap div.auto-comp-result .variant-valencia,#loco-admin.wrap div.auto-comp-result .region-es.variant-valencia,#loco-admin.wrap div.auto-comp-result .lang-ca,#loco-admin.wrap div.auto-comp-result .region-es.lang-ca,#loco-admin.wrap div.auto-comp-result .lang-eo,#loco-admin.wrap div.auto-comp-result .lang-eu,#loco-admin.wrap div.auto-comp-result .avtr{margin-right:5px}#loco-admin.wrap div.auto-comp-wrap.error a.icon.clear:before{color:#c00;opacity:1}#loco-admin.wrap div.auto-comp-wrap.error input[type=text]{border-color:#c00;color:#c00}#loco-admin.wrap div.auto-comp-wrap.error input[type=text]:focus{-webkit-box-shadow:0 0 .5em 0 rgba(153,0,0,.5);-moz-box-shadow:0 0 .5em 0 rgba(153,0,0,.5);box-shadow:0 0 .5em 0 rgba(153,0,0,.5)}#loco-admin.wrap ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}#loco-admin.wrap ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.5) 0 0 no-repeat;min-height:75px}#loco-admin.wrap ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-admin.wrap ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.5);background-size:16px}#loco-admin.wrap ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.5);background-size:16px}}#loco-admin.wrap ._green_glow_inner{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-admin.wrap ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-admin.wrap .loco-font,#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after,#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-admin.wrap .has-icon:before{display:inline-block;padding-right:.3em}#loco-admin.wrap a.icon-help{cursor:help}#loco-admin.wrap a.icon-help span{display:none}#loco-admin.wrap .icon-notag:before{content:""}#loco-admin.wrap .icon-python:before{content:"🐍"}#loco-admin.wrap .icon-unicode:before{content:"u"}#loco-admin.wrap .icon-json:before{content:"{"}#loco-admin.wrap .icon-bullist:before{content:""}#loco-admin.wrap .icon-numlist:before{content:""}#loco-admin.wrap .icon-indent:before{content:""}#loco-admin.wrap .icon-outdent:before{content:""}#loco-admin.wrap .icon-link:before{content:""}#loco-admin.wrap .icon-unlink:before{content:""}#loco-admin.wrap .icon-bold:before{content:"B"}#loco-admin.wrap .icon-italic:before{content:"I"}#loco-admin.wrap .icon-translate:before{content:""}#loco-admin.wrap .icon-proj:before{content:""}#loco-admin.wrap .icon-plural:before{content:"᛬"}#loco-admin.wrap .icon-max:before,#loco-admin.wrap .icon-full-screen:before{content:""}#loco-admin.wrap .icon-min:before{content:""}#loco-admin.wrap .icon-sort:before{content:""}#loco-admin.wrap .icon-ok:before,#loco-admin.wrap .notice-success>.has-icon:before,#loco-admin.wrap .notice-success p>strong.has-icon:before{content:"✓"}#loco-admin.wrap .icon-ok-empty:before{content:"🗌"}#loco-admin.wrap .icon-checkbox-checked:before,#loco-admin.wrap .selector.multi li.checked .icon-checkbox:before{content:"☑"}#loco-admin.wrap .icon-checkbox-unchecked:before{content:"☐"}#loco-admin.wrap .icon-checkbox-partial:before{content:"☉"}#loco-admin.wrap .icon-radio-checked:before{content:"⚫"}#loco-admin.wrap .icon-radio-unchecked:before{content:"⚪"}#loco-admin.wrap .icon-ext:before{content:"⬈"}#loco-admin.wrap .icon-share:before{content:""}#loco-admin.wrap .icon-star:before{content:""}#loco-admin.wrap .icon-user:before{content:""}#loco-admin.wrap .icon-remove:before,#loco-admin.wrap a.icon.close:before{content:"×"}#loco-admin.wrap .icon-cog:before{content:""}#loco-admin.wrap .icon-trash:before{content:""}#loco-admin.wrap .icon-time:before,#loco-admin.wrap .icon-history:before{content:""}#loco-admin.wrap .icon-download:before{content:""}#loco-admin.wrap .icon-revert:before{content:""}#loco-admin.wrap .icon-sync:before{content:""}#loco-admin.wrap .icon-lock:before,#loco-admin.wrap .notice-locked>.has-icon:before,#loco-admin.wrap .notice-locked p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-flag:before{content:""}#loco-admin.wrap .icon-tag:before{content:""}#loco-admin.wrap .icon-tags:before{content:""}#loco-admin.wrap .icon-print:before{content:""}#loco-admin.wrap .icon-camera:before{content:""}#loco-admin.wrap .icon-pencil:before{content:""}#loco-admin.wrap .icon-add:before{content:""}#loco-admin.wrap .icon-del:before{content:""}#loco-admin.wrap .icon-clear:before,#loco-admin.wrap a.icon.clear:before{content:""}#loco-admin.wrap .icon-ok-sign:before{content:"✔"}#loco-admin.wrap .icon-help:before{content:"?"}#loco-admin.wrap .icon-info:before,#loco-admin.wrap .notice-info>.has-icon:before,#loco-admin.wrap .notice-info p>strong.has-icon:before{content:"ℹ"}#loco-admin.wrap .icon-cancel:before{content:""}#loco-admin.wrap .icon-warn:before,#loco-admin.wrap .notice-error>.has-icon:before,#loco-admin.wrap .notice-error p>strong.has-icon:before,#loco-admin.wrap .notice-warning>.has-icon:before,#loco-admin.wrap .notice-warning p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-comment:before{content:""}#loco-admin.wrap .icon-bar-chart:before{content:""}#loco-admin.wrap .icon-key:before{content:""}#loco-admin.wrap .icon-cogs:before{content:""}#loco-admin.wrap .icon-comments:before{content:""}#loco-admin.wrap .icon-signout:before{content:""}#loco-admin.wrap .icon-signin:before{content:""}#loco-admin.wrap .icon-upload:before{content:""}#loco-admin.wrap .icon-twitter:before{content:"🐦"}#loco-admin.wrap .icon-facebook:before{content:""}#loco-admin.wrap .icon-github:before{content:""}#loco-admin.wrap .icon-feed:before{content:""}#loco-admin.wrap .icon-globe:before{content:""}#loco-admin.wrap .icon-wrench:before,#loco-admin.wrap .notice-debug>.has-icon:before,#loco-admin.wrap .notice-debug p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-group:before{content:""}#loco-admin.wrap .icon-cloud:before{content:""}#loco-admin.wrap .icon-copy:before{content:""}#loco-admin.wrap .icon-save:before{content:""}#loco-admin.wrap .icon-menu:before{content:""}#loco-admin.wrap .icon-table:before{content:""}#loco-admin.wrap .icon-caret-down:before{content:"▼"}#loco-admin.wrap .icon-caret-up:before{content:"▲"}#loco-admin.wrap .icon-caret-right:before{content:"▶"}#loco-admin.wrap .icon-mail:before{content:""}#loco-admin.wrap .icon-cloud-upload:before{content:""}#loco-admin.wrap .icon-file:before{content:""}#loco-admin.wrap .icon-circle-white:before{content:"⚬"}#loco-admin.wrap .icon-circle-black:before{content:"●"}#loco-admin.wrap .icon-eraser:before{content:""}#loco-admin.wrap .icon-unlock:before{content:""}#loco-admin.wrap .icon-apple:before{content:""}#loco-admin.wrap .icon-android:before{content:""}#loco-admin.wrap .icon-robot:before{content:"🤖"}#loco-admin.wrap .icon-back:before{content:"⬅"}#loco-admin.wrap .icon-next:before{content:"➔"}#loco-admin.wrap .icon-arrow-up:before{content:""}#loco-admin.wrap .icon-ccard:before{content:""}#loco-admin.wrap .icon-caret-left:before{content:"◀"}#loco-admin.wrap .icon-pro:before{content:"⚡"}#loco-admin.wrap .icon-bell:before{content:""}#loco-admin.wrap .icon-code:before{content:""}#loco-admin.wrap .icon-privacy:before{content:"🛡"}#loco-admin.wrap .icon-hellip:before{content:"…"}#loco-admin.wrap .icon-vellip:before{content:"⁞"}#loco-admin.wrap .icon-collapse:before{content:""}#loco-admin.wrap .icon-expand:before{content:""}#loco-admin.wrap .icon-wordpress:before{content:""}#loco-admin.wrap .icon-database:before{content:""}#loco-admin.wrap .icon-restore:before{content:""}#loco-admin.wrap .icon-pilcrow:before{content:"¶"}#loco-admin.wrap .icon-status.is-translated:before,#loco-admin.wrap .is-translated>header>.icon-status:before{color:#2e892e;content:"✓";text-align:center}#loco-admin.wrap .icon-status.is-untranslated:before,#loco-admin.wrap .is-untranslated>header>.icon-status:before{color:#aaa;content:"×";text-align:center;font-size:1.1em}#loco-admin.wrap .icon-status.is-flagged:before,#loco-admin.wrap .is-flagged>header>.icon-status:before{color:#bd2c00;content:"";text-align:center}#loco-admin.wrap .icon-status.is-translated.is-blank:before,#loco-admin.wrap .icon-status.is-translated.is-inherit:before,#loco-admin.wrap .is-translated.is-blank>header>.icon-status:before,#loco-admin.wrap .is-translated.is-inherit>header>.icon-status:before{content:"🗌"}#loco-admin.wrap .icon-status.is-fuzzy:before,#loco-admin.wrap .is-fuzzy>header>.icon-status:before{color:#666;content:""}#loco-admin.wrap .lang,#loco-admin.wrap .region,#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy,#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd,#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia,#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca,#loco-admin.wrap .lang-eo,#loco-admin.wrap .lang-eu{color:#fff;background:#2e892e;display:inline-block;text-transform:uppercase;overflow:hidden;font-family:Verdana,Arial,sans-serif;font-size:9px;font-weight:normal;font-style:normal;line-height:12px;text-align:center;white-space:normal;text-shadow:none}#loco-admin.wrap .lang{width:20px;height:12px;line-height:12px;vertical-align:middle}#loco-admin.wrap .lang:before{content:attr(lang);vertical-align:baseline}#loco-admin.wrap .no-lang{width:18px;height:10px;border:solid 1px #2e892e;background:transparent}#loco-admin.wrap .lang-el{background-color:#1d48a3}#loco-admin.wrap .lang-el:before{content:"Ελ"}#loco-admin.wrap .region,#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy,#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd,#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia,#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca,#loco-admin.wrap .lang-eo,#loco-admin.wrap .lang-eu{width:16px;height:12px;margin:0 2px;background-image:url(../img/flags.png?v=2.4.5);background-repeat:no-repeat;background-color:transparent}#loco-admin.wrap .region:before,#loco-admin.wrap .variant-wales:before,#loco-admin.wrap .region-gb.lang-cy:before,#loco-admin.wrap .variant-scotland:before,#loco-admin.wrap .region-gb.lang-gd:before,#loco-admin.wrap .variant-valencia:before,#loco-admin.wrap .region-es.variant-valencia:before,#loco-admin.wrap .lang-ca:before,#loco-admin.wrap .region-es.lang-ca:before,#loco-admin.wrap .lang-eo:before,#loco-admin.wrap .lang-eu:before{visibility:hidden}#loco-admin.wrap .lang-zh{background-color:#b90000}#loco-admin.wrap .lang-zh.script-hans:before{content:"中国"}#loco-admin.wrap .lang-zh.script-hant:before{content:"中國"}#loco-admin.wrap .__{background-position:0 0}#loco-admin.wrap .lang-eo{background-position:0 -12px}#loco-admin.wrap .lang-eu{background-position:0 -24px}#loco-admin.wrap .lang-ca,#loco-admin.wrap .region-es.lang-ca{background-position:0 -36px}#loco-admin.wrap .region-tg{background-position:0 -48px}#loco-admin.wrap .region-me{background-position:0 -60px}#loco-admin.wrap .region-la{background-position:0 -73px}#loco-admin.wrap .region-mr{background-position:0 -85px}#loco-admin.wrap .region-ni{background-position:0 -97px}#loco-admin.wrap .region-lv{background-position:0 -109px}#loco-admin.wrap .region-om{background-position:0 -121px}#loco-admin.wrap .region-af{background-position:0 -133px}#loco-admin.wrap .region-cy{background-position:0 -145px}#loco-admin.wrap .region-bj{background-position:0 -157px}#loco-admin.wrap .region-aq{background-position:0 -169px}#loco-admin.wrap .region-cn{background-position:0 -186px}#loco-admin.wrap .region-co{background-position:0 -198px}#loco-admin.wrap .region-cx{background-position:0 -210px}#loco-admin.wrap .region-ag{background-position:0 -222px}#loco-admin.wrap .region-ms{background-position:0 -234px}#loco-admin.wrap .region-md{background-position:0 -246px}#loco-admin.wrap .region-zm{background-position:0 -258px}#loco-admin.wrap .region-vn{background-position:0 -270px}#loco-admin.wrap .region-tf{background-position:0 -282px}#loco-admin.wrap .region-td{background-position:0 -294px}#loco-admin.wrap .region-yt{background-position:0 -306px}#loco-admin.wrap .region-lb{background-position:0 -318px}#loco-admin.wrap .region-mf{background-position:0 -330px}#loco-admin.wrap .region-lu{background-position:0 -347px}#loco-admin.wrap .region-mq{background-position:0 -359px}#loco-admin.wrap .region-cz{background-position:0 -371px}#loco-admin.wrap .region-ae{background-position:0 -383px}#loco-admin.wrap .region-cm{background-position:0 -395px}#loco-admin.wrap .region-bi{background-position:0 -407px}#loco-admin.wrap .region-ar{background-position:0 -419px}#loco-admin.wrap .region-as{background-position:0 -431px}#loco-admin.wrap .region-bh{background-position:0 -443px}#loco-admin.wrap .region-cl{background-position:0 -455px}#loco-admin.wrap .region-ad{background-position:0 -467px}#loco-admin.wrap .region-mp{background-position:0 -479px}#loco-admin.wrap .region-lt{background-position:0 -491px}#loco-admin.wrap .region-mg{background-position:0 -503px}#loco-admin.wrap .region-lc{background-position:0 -515px}#loco-admin.wrap .region-tr{background-position:0 -527px}#loco-admin.wrap .region-ua{background-position:0 -539px}#loco-admin.wrap .region-tv{background-position:0 -551px}#loco-admin.wrap .region-vi{background-position:0 -563px}#loco-admin.wrap .region-mt{background-position:0 -575px}#loco-admin.wrap .region-no{background-position:0 -587px}#loco-admin.wrap .region-mc{background-position:0 -599px}#loco-admin.wrap .region-ch{background-position:0 -611px}#loco-admin.wrap .region-bl{background-position:0 -623px}#loco-admin.wrap .region-aw{background-position:0 -640px}#loco-admin.wrap .region-bz{background-position:0 -652px}#loco-admin.wrap .region-bm{background-position:0 -664px}#loco-admin.wrap .region-ci{background-position:0 -676px}#loco-admin.wrap .region-mu{background-position:0 -688px}#loco-admin.wrap .region-us{background-position:0 -700px}#loco-admin.wrap .region-tw{background-position:0 -712px}#loco-admin.wrap .region-ye{background-position:0 -724px}#loco-admin.wrap .region-mw{background-position:0 -736px}#loco-admin.wrap .region-nl{background-position:0 -748px}#loco-admin.wrap .region-ls{background-position:0 -760px}#loco-admin.wrap .region-bo{background-position:0 -772px}#loco-admin.wrap .region-at{background-position:0 -784px}#loco-admin.wrap .region-ck{background-position:0 -796px}#loco-admin.wrap .region-by{background-position:0 -808px}#loco-admin.wrap .region-au{background-position:0 -820px}#loco-admin.wrap .region-bn{background-position:0 -832px}#loco-admin.wrap .region-ma{background-position:0 -844px}#loco-admin.wrap .region-nz{background-position:0 -856px}#loco-admin.wrap .region-lr{background-position:0 -868px}#loco-admin.wrap .region-mv{background-position:0 -880px}#loco-admin.wrap .region-tc{background-position:0 -892px}#loco-admin.wrap .region-ug{background-position:0 -904px}#loco-admin.wrap .region-tt{background-position:0 -916px}#loco-admin.wrap .region-pl{background-position:0 -928px}#loco-admin.wrap .region-rs{background-position:0 -940px}#loco-admin.wrap .region-in{background-position:0 -952px}#loco-admin.wrap .region-ge{background-position:0 -964px}#loco-admin.wrap .region-gr{background-position:0 -976px}#loco-admin.wrap .region-gs{background-position:0 -988px}#loco-admin.wrap .region-gd{background-position:0 -1000px}#loco-admin.wrap .region-io{background-position:0 -1012px}#loco-admin.wrap .region-hk{background-position:0 -1024px}#loco-admin.wrap .region-kp{background-position:0 -1036px}#loco-admin.wrap .region-kg{background-position:0 -1048px}#loco-admin.wrap .region-pm{background-position:0 -1060px}#loco-admin.wrap .region-sv{background-position:0 -1072px}#loco-admin.wrap .region-re{background-position:0 -1084px}#loco-admin.wrap .region-sa{background-position:0 -1096px}#loco-admin.wrap .region-sc{background-position:0 -1108px}#loco-admin.wrap .region-st{background-position:0 -1120px}#loco-admin.wrap .region-ke{background-position:0 -1132px}#loco-admin.wrap .region-im{background-position:0 -1144px}#loco-admin.wrap .region-kr{background-position:0 -1161px}#loco-admin.wrap .region-gf{background-position:0 -1173px}#loco-admin.wrap .region-dj{background-position:0 -1185px}#loco-admin.wrap .region-gq{background-position:0 -1197px}#loco-admin.wrap .region-gp{background-position:0 -1209px}#loco-admin.wrap .region-dk{background-position:0 -1221px}#loco-admin.wrap .region-gg{background-position:0 -1233px}#loco-admin.wrap .region-il{background-position:0 -1250px}#loco-admin.wrap .region-pn{background-position:0 -1262px}#loco-admin.wrap .region-sb{background-position:0 -1274px}#loco-admin.wrap .region-py{background-position:0 -1286px}#loco-admin.wrap .region-ru{background-position:0 -1298px}#loco-admin.wrap .region-kw{background-position:0 -1310px}#loco-admin.wrap .region-do{background-position:0 -1322px}#loco-admin.wrap .region-gt{background-position:0 -1334px}#loco-admin.wrap .region-gb{background-position:0 -1346px}#loco-admin.wrap .region-gu{background-position:0 -1358px}#loco-admin.wrap .region-je{background-position:0 -1370px}#loco-admin.wrap .region-hm{background-position:0 -1387px}#loco-admin.wrap .region-sg{background-position:0 -1399px}#loco-admin.wrap .region-pk{background-position:0 -1411px}#loco-admin.wrap .region-sr{background-position:0 -1423px}#loco-admin.wrap .region-se{background-position:0 -1435px}#loco-admin.wrap .region-jp{background-position:0 -1447px}#loco-admin.wrap .region-gw{background-position:0 -1459px}#loco-admin.wrap .region-eh{background-position:0 -1471px}#loco-admin.wrap .region-dz{background-position:0 -1483px}#loco-admin.wrap .region-ga{background-position:0 -1495px}#loco-admin.wrap .region-fr{background-position:0 -1507px}#loco-admin.wrap .region-dm{background-position:0 -1519px}#loco-admin.wrap .region-hn{background-position:0 -1531px}#loco-admin.wrap .region-sd{background-position:0 -1543px}#loco-admin.wrap .region-rw{background-position:0 -1555px}#loco-admin.wrap .region-ph{background-position:0 -1567px}#loco-admin.wrap .region-ss{background-position:0 -1579px}#loco-admin.wrap .region-qa{background-position:0 -1596px}#loco-admin.wrap .region-pe{background-position:0 -1608px}#loco-admin.wrap .region-pr{background-position:0 -1620px}#loco-admin.wrap .region-si{background-position:0 -1632px}#loco-admin.wrap .region-ht{background-position:0 -1644px}#loco-admin.wrap .region-es{background-position:0 -1656px}#loco-admin.wrap .region-gl{background-position:0 -1668px}#loco-admin.wrap .region-gm{background-position:0 -1680px}#loco-admin.wrap .region-er{background-position:0 -1692px}#loco-admin.wrap .region-fi{background-position:0 -1704px}#loco-admin.wrap .region-ee{background-position:0 -1716px}#loco-admin.wrap .region-kn{background-position:0 -1728px}#loco-admin.wrap .region-hu{background-position:0 -1740px}#loco-admin.wrap .region-iq{background-position:0 -1752px}#loco-admin.wrap .region-ky{background-position:0 -1764px}#loco-admin.wrap .region-sh{background-position:0 -1776px}#loco-admin.wrap .region-ps{background-position:0 -1788px}#loco-admin.wrap .region-pf{background-position:0 -1800px}#loco-admin.wrap .region-sj{background-position:0 -1812px}#loco-admin.wrap .region-id{background-position:0 -1824px}#loco-admin.wrap .region-is{background-position:0 -1836px}#loco-admin.wrap .region-eg{background-position:0 -1848px}#loco-admin.wrap .region-fk{background-position:0 -1860px}#loco-admin.wrap .region-fj{background-position:0 -1872px}#loco-admin.wrap .region-gn{background-position:0 -1884px}#loco-admin.wrap .region-gy{background-position:0 -1896px}#loco-admin.wrap .region-ir{background-position:0 -1908px}#loco-admin.wrap .region-km{background-position:0 -1920px}#loco-admin.wrap .region-ie{background-position:0 -1932px}#loco-admin.wrap .region-kz{background-position:0 -1944px}#loco-admin.wrap .region-ro{background-position:0 -1956px}#loco-admin.wrap .region-sk{background-position:0 -1968px}#loco-admin.wrap .region-pg{background-position:0 -1980px}#loco-admin.wrap .region-pt{background-position:0 -1992px}#loco-admin.wrap .region-so{background-position:0 -2004px}#loco-admin.wrap .region-sx{background-position:0 -2016px}#loco-admin.wrap .region-hr{background-position:0 -2033px}#loco-admin.wrap .region-ki{background-position:0 -2045px}#loco-admin.wrap .region-jm{background-position:0 -2057px}#loco-admin.wrap .region-ec{background-position:0 -2069px}#loco-admin.wrap .region-et{background-position:0 -2081px}#loco-admin.wrap .region-fo{background-position:0 -2093px}#loco-admin.wrap .region-kh{background-position:0 -2105px}#loco-admin.wrap .region-sy{background-position:0 -2117px}#loco-admin.wrap .region-sn{background-position:0 -2129px}#loco-admin.wrap .region-pw{background-position:0 -2141px}#loco-admin.wrap .region-sl{background-position:0 -2153px}#loco-admin.wrap .region-fm{background-position:0 -2165px}#loco-admin.wrap .region-gi{background-position:0 -2177px}#loco-admin.wrap .region-de{background-position:0 -2189px}#loco-admin.wrap .region-gh{background-position:0 -2201px}#loco-admin.wrap .region-jo{background-position:0 -2213px}#loco-admin.wrap .region-it{background-position:0 -2225px}#loco-admin.wrap .region-pa{background-position:0 -2237px}#loco-admin.wrap .region-sz{background-position:0 -2249px}#loco-admin.wrap .region-sm{background-position:0 -2261px}#loco-admin.wrap .region-tn{background-position:0 -2273px}#loco-admin.wrap .region-ml{background-position:0 -2285px}#loco-admin.wrap .region-cg{background-position:0 -2297px}#loco-admin.wrap .region-ax{background-position:0 -2309px}#loco-admin.wrap .region-ao{background-position:0 -2321px}#loco-admin.wrap .region-bt{background-position:0 -2333px}#loco-admin.wrap .region-an{background-position:0 -2345px}#loco-admin.wrap .region-bb{background-position:0 -2357px}#loco-admin.wrap .region-cf{background-position:0 -2369px}#loco-admin.wrap .region-mm{background-position:0 -2381px}#loco-admin.wrap .region-li{background-position:0 -2393px}#loco-admin.wrap .region-na{background-position:0 -2405px}#loco-admin.wrap .region-mz{background-position:0 -2417px}#loco-admin.wrap .region-to{background-position:0 -2429px}#loco-admin.wrap .region-vg{background-position:0 -2441px}#loco-admin.wrap .region-ve{background-position:0 -2453px}#loco-admin.wrap .region-tz{background-position:0 -2465px}#loco-admin.wrap .region-tm{background-position:0 -2477px}#loco-admin.wrap .region-mx{background-position:0 -2489px}#loco-admin.wrap .region-nc{background-position:0 -2501px}#loco-admin.wrap .region-mo{background-position:0 -2513px}#loco-admin.wrap .region-lk{background-position:0 -2525px}#loco-admin.wrap .region-cd{background-position:0 -2537px}#loco-admin.wrap .region-al{background-position:0 -2549px}#loco-admin.wrap .region-bw{background-position:0 -2561px}#loco-admin.wrap .region-cs{background-position:0 -2573px}#loco-admin.wrap .region-cr{background-position:0 -2585px}#loco-admin.wrap .region-bv{background-position:0 -2597px}#loco-admin.wrap .region-am{background-position:0 -2609px}#loco-admin.wrap .region-az{background-position:0 -2621px}#loco-admin.wrap .region-ba{background-position:0 -2633px}#loco-admin.wrap .region-mn{background-position:0 -2645px}#loco-admin.wrap .region-nu{background-position:0 -2657px}#loco-admin.wrap .region-my{background-position:0 -2669px}#loco-admin.wrap .region-tl{background-position:0 -2681px}#loco-admin.wrap .region-ws{background-position:0 -2693px}#loco-admin.wrap .region-th{background-position:0 -2705px}#loco-admin.wrap .region-nf{background-position:0 -2717px}#loco-admin.wrap .region-ly{background-position:0 -2729px}#loco-admin.wrap .region-ai{background-position:0 -2741px}#loco-admin.wrap .region-br{background-position:0 -2753px}#loco-admin.wrap .region-cv{background-position:0 -2765px}#loco-admin.wrap .region-be{background-position:0 -2777px}#loco-admin.wrap .region-ca{background-position:0 -2789px}#loco-admin.wrap .region-bd{background-position:0 -2801px}#loco-admin.wrap .region-cw{background-position:0 -2813px}#loco-admin.wrap .region-bs{background-position:0 -2830px}#loco-admin.wrap .region-ng{background-position:0 -2842px}#loco-admin.wrap .region-mk{background-position:0 -2854px}#loco-admin.wrap .region-np{background-position:0 -2866px}#loco-admin.wrap .region-va{background-position:0 -2878px}#loco-admin.wrap .region-uz{background-position:0 -2890px}#loco-admin.wrap .region-um{background-position:0 -2902px}#loco-admin.wrap .region-tk{background-position:0 -2914px}#loco-admin.wrap .region-vc{background-position:0 -2926px}#loco-admin.wrap .region-zw{background-position:0 -2938px}#loco-admin.wrap .region-nr{background-position:0 -2950px}#loco-admin.wrap .region-ne{background-position:0 -2962px}#loco-admin.wrap .region-cu{background-position:0 -2974px}#loco-admin.wrap .region-bq{background-position:0 -2986px}#loco-admin.wrap .region-bf{background-position:0 -2998px}#loco-admin.wrap .region-bg{background-position:0 -3010px}#loco-admin.wrap .region-cc{background-position:0 -3022px}#loco-admin.wrap .region-mh{background-position:0 -3034px}#loco-admin.wrap .region-za{background-position:0 -3046px}#loco-admin.wrap .region-uy{background-position:0 -3058px}#loco-admin.wrap .region-wf{background-position:0 -3070px}#loco-admin.wrap .region-vu{background-position:0 -3082px}#loco-admin.wrap .region-tj{background-position:0 -3094px}#loco-admin.wrap .variant-scotland,#loco-admin.wrap .region-gb.lang-gd{background-position:0 -3106px}#loco-admin.wrap .variant-valencia,#loco-admin.wrap .region-es.variant-valencia{background-position:0 -3118px}#loco-admin.wrap .variant-wales,#loco-admin.wrap .region-gb.lang-cy{background-position:0 -3130px}#loco-admin.wrap .x-eu{background-position:0 -3142px}#loco-admin.wrap span.lang code{display:none}#loco-admin.wrap .icon-notag:before{content:""}#loco-admin.wrap .icon-python:before{content:"🐍"}#loco-admin.wrap .icon-unicode:before{content:"u"}#loco-admin.wrap .icon-json:before{content:"{"}#loco-admin.wrap .icon-bullist:before{content:""}#loco-admin.wrap .icon-numlist:before{content:""}#loco-admin.wrap .icon-indent:before{content:""}#loco-admin.wrap .icon-outdent:before{content:""}#loco-admin.wrap .icon-link:before{content:""}#loco-admin.wrap .icon-unlink:before{content:""}#loco-admin.wrap .icon-bold:before{content:"B"}#loco-admin.wrap .icon-italic:before{content:"I"}#loco-admin.wrap .icon-translate:before{content:""}#loco-admin.wrap .icon-proj:before{content:""}#loco-admin.wrap .icon-plural:before{content:"᛬"}#loco-admin.wrap .icon-max:before,#loco-admin.wrap .icon-full-screen:before{content:""}#loco-admin.wrap .icon-min:before{content:""}#loco-admin.wrap .icon-sort:before{content:""}#loco-admin.wrap .icon-ok:before,#loco-admin.wrap .notice-success>.has-icon:before,#loco-admin.wrap .notice-success p>strong.has-icon:before{content:"✓"}#loco-admin.wrap .icon-ok-empty:before{content:"🗌"}#loco-admin.wrap .icon-checkbox-checked:before,#loco-admin.wrap .selector.multi li.checked .icon-checkbox:before{content:"☑"}#loco-admin.wrap .icon-checkbox-unchecked:before{content:"☐"}#loco-admin.wrap .icon-checkbox-partial:before{content:"☉"}#loco-admin.wrap .icon-radio-checked:before{content:"⚫"}#loco-admin.wrap .icon-radio-unchecked:before{content:"⚪"}#loco-admin.wrap .icon-ext:before{content:"⬈"}#loco-admin.wrap .icon-share:before{content:""}#loco-admin.wrap .icon-star:before{content:""}#loco-admin.wrap .icon-user:before{content:""}#loco-admin.wrap .icon-remove:before,#loco-admin.wrap a.icon.close:before{content:"×"}#loco-admin.wrap .icon-cog:before{content:""}#loco-admin.wrap .icon-trash:before{content:""}#loco-admin.wrap .icon-time:before,#loco-admin.wrap .icon-history:before{content:""}#loco-admin.wrap .icon-download:before{content:""}#loco-admin.wrap .icon-revert:before{content:""}#loco-admin.wrap .icon-sync:before{content:""}#loco-admin.wrap .icon-lock:before,#loco-admin.wrap .notice-locked>.has-icon:before,#loco-admin.wrap .notice-locked p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-flag:before{content:""}#loco-admin.wrap .icon-tag:before{content:""}#loco-admin.wrap .icon-tags:before{content:""}#loco-admin.wrap .icon-print:before{content:""}#loco-admin.wrap .icon-camera:before{content:""}#loco-admin.wrap .icon-pencil:before{content:""}#loco-admin.wrap .icon-add:before{content:""}#loco-admin.wrap .icon-del:before{content:""}#loco-admin.wrap .icon-clear:before,#loco-admin.wrap a.icon.clear:before{content:""}#loco-admin.wrap .icon-ok-sign:before{content:"✔"}#loco-admin.wrap .icon-help:before{content:"?"}#loco-admin.wrap .icon-info:before,#loco-admin.wrap .notice-info>.has-icon:before,#loco-admin.wrap .notice-info p>strong.has-icon:before{content:"ℹ"}#loco-admin.wrap .icon-cancel:before{content:""}#loco-admin.wrap .icon-warn:before,#loco-admin.wrap .notice-error>.has-icon:before,#loco-admin.wrap .notice-error p>strong.has-icon:before,#loco-admin.wrap .notice-warning>.has-icon:before,#loco-admin.wrap .notice-warning p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-comment:before{content:""}#loco-admin.wrap .icon-bar-chart:before{content:""}#loco-admin.wrap .icon-key:before{content:""}#loco-admin.wrap .icon-cogs:before{content:""}#loco-admin.wrap .icon-comments:before{content:""}#loco-admin.wrap .icon-signout:before{content:""}#loco-admin.wrap .icon-signin:before{content:""}#loco-admin.wrap .icon-upload:before{content:""}#loco-admin.wrap .icon-twitter:before{content:"🐦"}#loco-admin.wrap .icon-facebook:before{content:""}#loco-admin.wrap .icon-github:before{content:""}#loco-admin.wrap .icon-feed:before{content:""}#loco-admin.wrap .icon-globe:before{content:""}#loco-admin.wrap .icon-wrench:before,#loco-admin.wrap .notice-debug>.has-icon:before,#loco-admin.wrap .notice-debug p>strong.has-icon:before{content:""}#loco-admin.wrap .icon-group:before{content:""}#loco-admin.wrap .icon-cloud:before{content:""}#loco-admin.wrap .icon-copy:before{content:""}#loco-admin.wrap .icon-save:before{content:""}#loco-admin.wrap .icon-menu:before{content:""}#loco-admin.wrap .icon-table:before{content:""}#loco-admin.wrap .icon-caret-down:before{content:"▼"}#loco-admin.wrap .icon-caret-up:before{content:"▲"}#loco-admin.wrap .icon-caret-right:before{content:"▶"}#loco-admin.wrap .icon-mail:before{content:""}#loco-admin.wrap .icon-cloud-upload:before{content:""}#loco-admin.wrap .icon-file:before{content:""}#loco-admin.wrap .icon-circle-white:before{content:"⚬"}#loco-admin.wrap .icon-circle-black:before{content:"●"}#loco-admin.wrap .icon-eraser:before{content:""}#loco-admin.wrap .icon-unlock:before{content:""}#loco-admin.wrap .icon-apple:before{content:""}#loco-admin.wrap .icon-android:before{content:""}#loco-admin.wrap .icon-robot:before{content:"🤖"}#loco-admin.wrap .icon-back:before{content:"⬅"}#loco-admin.wrap .icon-next:before{content:"➔"}#loco-admin.wrap .icon-arrow-up:before{content:""}#loco-admin.wrap .icon-ccard:before{content:""}#loco-admin.wrap .icon-caret-left:before{content:"◀"}#loco-admin.wrap .icon-pro:before{content:"⚡"}#loco-admin.wrap .icon-bell:before{content:""}#loco-admin.wrap .icon-code:before{content:""}#loco-admin.wrap .icon-privacy:before{content:"🛡"}#loco-admin.wrap .icon-hellip:before{content:"…"}#loco-admin.wrap .icon-vellip:before{content:"⁞"}#loco-admin.wrap .icon-collapse:before{content:""}#loco-admin.wrap .icon-expand:before{content:""}#loco-admin.wrap .icon-wordpress:before{content:""}#loco-admin.wrap .icon-database:before{content:""}#loco-admin.wrap .icon-restore:before{content:""}#loco-admin.wrap .icon-pilcrow:before{content:"¶"}#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before,#loco-admin.wrap .has-dashicon:before{speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-admin.wrap .icon,#loco-admin.wrap .has-icon:before{font-family:"loco"}#loco-admin.wrap .has-dashicon:before{font-family:"dashicons";font-size:1.4em}#loco-admin.wrap .has-icon:before,#loco-admin.wrap .has-dashicon:before,#loco-admin.wrap .has-icon>span{display:inline-block;vertical-align:middle}#loco-admin.wrap .only-icon{text-align:center}#loco-admin.wrap .only-icon:before{text-align:center;padding:0}#loco-admin.wrap .only-icon span{display:none}#loco-admin.wrap a,#loco-admin.wrap .wp-core-ui .button-link{text-decoration:none}#loco-admin.wrap h3:hover>a.loco-anchor{color:#ccc}#loco-admin.wrap h3:hover>a.loco-anchor:before{content:"¶"}#loco-admin.wrap .has-lang>span{display:inline-block;vertical-align:middle}#loco-admin.wrap a.has-lang:hover>span:last-child{text-decoration:underline}#loco-admin.wrap h1 ul,#loco-admin.wrap h1 li{margin:0;padding:0}#loco-admin.wrap h1 li{display:inline-block}#loco-admin.wrap h1 li:after{content:"/";color:#999;text-shadow:none;display:inline-block}#loco-admin.wrap h1 li:last-child:after{content:""}#loco-admin.wrap h1 li:last-child a{color:inherit;pointer-events:none;cursor:auto}#loco-admin.wrap h2 span{color:#999;font-weight:normal}#loco-admin.wrap h2 .loco-meta,#loco-admin.wrap h3 .loco-meta{color:inherit;font-size:14px;font-weight:normal;vertical-align:middle}#loco-admin.wrap .wp-list-table td:first-child .icon{width:16px;display:inline-block;text-align:center}#loco-admin.wrap .wp-list-table td{white-space:nowrap}#loco-admin.wrap .wp-list-table td>a,#loco-admin.wrap .wp-list-table td>time{display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis}#loco-admin.wrap .wp-list-table th.loco-sort{cursor:pointer}#loco-admin.wrap .wp-list-table th.loco-sort:hover{color:#000}#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after,#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after{padding:0 0 0 4px;color:#999}#loco-admin.wrap .wp-list-table th.loco-sort.loco-desc:after{content:"▼"}#loco-admin.wrap .wp-list-table th.loco-sort.loco-asc:after{content:"▲"}#loco-admin.wrap .wp-list-table td.has-row-actions{overflow:visible}#loco-admin.wrap form.loco-filter{display:block;margin-bottom:5px}#loco-admin.wrap form.loco-filter .icon-filter{color:#999}#loco-admin.wrap nav.above-list-table{margin-bottom:1em}#loco-admin.wrap nav.above-list-table a{display:inline-block;margin-right:1em}#loco-admin.wrap .wp-core-ui button.inverted,#loco-admin.wrap .wp-core-ui button.inverted:hover,#loco-admin.wrap .po-fuzzy button.icon-cloud{background:-moz-linear-gradient(top, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);background:-webkit-linear-gradient(top, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);background:linear-gradient(to bottom, #cccccc 0%, #e0e0e0 30%, #fefefe 100%);-webkit-box-shadow:0 1px 0 #fff;-moz-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;border-color:gray}#loco-admin.wrap .wp-core-ui button:active,#loco-admin.wrap .wp-core-ui button.inverted:active{border-color:#5b9dd9}#loco-admin.wrap .loco-clearable{display:inline-block;vertical-align:middle;position:relative}#loco-admin.wrap .loco-clearable a.clear,#loco-admin.wrap .auto-comp-wrap a.clear{top:0;right:0;outline:none;margin:0;border:solid 1px transparent;padding:5px 5px;position:absolute;font-size:1em;line-height:normal}#loco-admin.wrap .loco-clearable a.clear:before,#loco-admin.wrap .auto-comp-wrap a.clear:before{vertical-align:middle;padding:0;color:#999}#loco-admin.wrap .loco-clearable a.clear:hover:before,#loco-admin.wrap .auto-comp-wrap a.clear:hover:before{color:#333}#loco-admin.wrap .loco-clearable a.clear span,#loco-admin.wrap .auto-comp-wrap a.clear span{display:none}#loco-admin.wrap .loco-clearable ::-ms-clear,#loco-admin.wrap .auto-comp-wrap ::-ms-clear{display:none}#loco-admin.wrap div.progress{color:#000;background:transparent !important}#loco-admin.wrap div.progress *{height:100%;overflow:hidden;white-space:nowrap}#loco-admin.wrap div.progress .t{background-color:#ddd;border:1px solid #ccc}#loco-admin.wrap div.progress .t .bar{float:left;clear:none;background-color:#3db63d}#loco-admin.wrap div.progress .t .bar.f{background-color:#bd2c00}#loco-admin.wrap div.progress .l{display:block}#loco-admin.wrap td div.progress .t{border:none}#loco-admin.wrap td div.progress .l{display:none}#loco-admin.wrap code.path{color:#333;margin:0;padding:0;display:inline;background:transparent}#loco-admin.wrap .loco-danger{color:#d54e21}#loco-admin.wrap .notice,#loco-admin.wrap .panel{background:#fff;position:relative;margin:1em 0;padding:1px 12px}#loco-admin.wrap .notice-generic{border-color:#ddd}#loco-admin.wrap .notice-success>.has-icon,#loco-admin.wrap .notice-success p>strong.has-icon{color:#000}#loco-admin.wrap .notice-warning{border-color:orange}#loco-admin.wrap .notice-error{border-color:#dc3232}#loco-admin.wrap .notice-debug{border-color:#00a0d2}#loco-admin.wrap .notice-danger{border-color:#dc3232}#loco-admin.wrap .notice-locked{border-color:orange}#loco-admin.wrap .notice>.has-icon:before,#loco-admin.wrap .notice p>strong.has-icon:before{padding-right:6px}#loco-admin.wrap .notice>p>a.button.has-icon:before{width:1.2em}#loco-admin.wrap .notice>p>em{color:#d54e21;font-style:normal}#loco-admin.wrap .notice>p>em a{color:inherit}#loco-admin.wrap .notice>p a:hover,#loco-admin.wrap .notice>nav a:hover{text-decoration:underline}#loco-admin.wrap .notice>p a.button,#loco-admin.wrap .notice>nav a.button{text-decoration:inherit}#loco-admin.wrap .notice.has-nav{display:flex;flex-direction:row}#loco-admin.wrap .notice.has-nav p,#loco-admin.wrap .notice.has-nav nav{line-height:22px;flex-grow:1}#loco-admin.wrap .notice.has-nav nav{text-align:right;padding:2px;margin:.5em 0}#loco-admin.wrap .notice.has-nav.is-dismissible{padding-right:38px}#loco-admin.wrap .notice.has-nav a{white-space:nowrap}#loco-admin.wrap .notice.has-nav nav>span{color:#666}#loco-admin.wrap .notice>h3>span{display:inline-block;vertical-align:middle}#loco-admin.wrap ul.problems li{font-style:italic}#loco-admin.wrap label{position:relative}#loco-admin.wrap label.for-disabled,#loco-admin.wrap label.for-disabled>input{cursor:default !important}#loco-admin.wrap input.regular-text,#loco-admin.wrap textarea.regular-text{width:25em}#loco-admin.wrap .button-link{padding:0 10px 1px}#loco-admin.wrap .button-danger{background:#ba0000;border-color:#900 #600 #600;-webkit-box-shadow:0 1px 0 #600;-moz-box-shadow:0 1px 0 #600;box-shadow:0 1px 0 #600;color:#fff;text-shadow:0 -1px 1px #600,1px 0 1px #600,0 1px 1px #600,-1px 0 1px #600}#loco-admin.wrap .button-success{background:#00b500;border-color:#090 #2e892e #2e892e;-webkit-box-shadow:0 1px 0 #2e892e;-moz-box-shadow:0 1px 0 #2e892e;box-shadow:0 1px 0 #2e892e;color:#fff;text-shadow:0 -1px 1px #2e892e,1px 0 1px #2e892e,0 1px 1px #2e892e,-1px 0 1px #2e892e}#loco-admin.wrap .button-success:hover{background:#3db63d}#loco-admin.wrap .button-danger[disabled],#loco-admin.wrap .button-success[disabled]{text-shadow:none !important}#loco-admin.wrap form button.loco-loading.button-large{padding-left:0}#loco-admin.wrap form button.loco-loading.button-large:before{width:16px;height:16px;margin:0 4px;content:" ";font-size:16px;line-height:1;display:inline-block;vertical-align:sub}#loco-admin.wrap ::placeholder{color:#ccc}#loco-admin.wrap ::-webkit-input-placeholder{color:#ccc}#loco-admin.wrap :-moz-placeholder{color:#ccc;opacity:1}#loco-admin.wrap ::-moz-placeholder{color:#ccc;opacity:1}#loco-admin.wrap :-ms-input-placeholder{color:#ccc}#loco-admin.wrap .ielt10 .placeheld{color:#ccc}#loco-admin.wrap a.has-raquo:after{content:" »"}#loco-admin.wrap a.has-laquo:before{content:"« "}#loco-admin.wrap span.inline-spinner{display:inline-block;min-width:16px;min-height:16px;background:transparent url(../img/spin-modal.gif?v=2.4.5) 0 0 no-repeat}.js #wpbody-content>.notice{display:none}.js #wpbody-content>.notice.inline{display:block}.js #loco-admin.wrap .jshide,.no-js #loco-admin.wrap .jsonly{display:none !important}#loco-admin.wrap .invis{visibility:hidden}.form-table tr{vertical-align:top}.form-table tr.compact td{padding-top:0}.loco-modal{min-width:50%;min-height:100px}.loco-modal-wide{min-width:90% !important}.loco-modal-no-close .ui-dialog-titlebar-close{display:none}.loco-modal.request-filesystem-credentials-dialog{top:15% !important;max-height:85% !important}.loco-modal.request-filesystem-credentials-dialog>.ui-dialog-content{background:inherit}.loco-modal.request-filesystem-credentials-dialog .ftp-password>label>em:last-child{display:none}.ui-dialog-content>div.loco-loading{height:100%;background:transparent url(../img/spin-modal.gif?v=2.4.5) center 20px no-repeat}#loco-po-ref ol li{color:#aaa;margin:0;white-space:pre;padding:0 0 0 1em;font:normal 12px/17px Consolas,Monaco,monospace;background:transparent;border-left:1px solid #eee}#loco-po-ref ol li code{margin:0;padding:0;display:inline;background:inherit}#loco-po-ref ol li.highlighted{color:#666;background-color:#f8eec7}#loco-po-ref ol li.highlighted code.T_CONSTANT_ENCAPSED_STRING{color:#c931c7}#loco-credit>*{vertical-align:middle}#loco-credit>a{display:inline-block;position:relative;overflow:hidden;background:transparent url(../img/logo-foot.gif?v=2.4.5) 0 0 no-repeat;height:30px;width:100px;text-indent:200px;-webkit-transition-duration:0s;transition-duration:0s}#loco-credit>a:hover{background-position:0 -35px}#loco-content{position:relative}#footer-upgrade span:before{color:#ccc;content:" | ";display:inline;padding-left:.5em;padding-right:.5em}#footer-upgrade span:first-child:before{content:"";display:none}.loco-clearfix:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}dl.debug dt{font-weight:bold}dl.debug dt,dl.debug dd{white-space:pre}.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(0,115,170,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#0073aa;foo:#0073aa}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#66c6e4 !important;background:#008ec2 !important;border-color:#008ec2 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../img/skins/fresh/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/editor.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#loco-editor{border:solid 1px #ccc}#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}#loco-editor ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.4) 0 0 no-repeat;min-height:75px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.4);background-size:16px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.4);background-size:16px}}#loco-editor ._green_glow_inner,#loco-editor .is-editable>.wg-content>textarea:focus,#loco-editor .is-editable>.wg-content.has-focus .ace_scroller,#loco-editor .is-editable>.wg-content.has-focus .wysihtml-editor,#loco-editor .is-editable>.wg-content.has-focus .mce-content-body{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-editor ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-editor .loco-font,#loco-editor .is-table .wg-thead .wg-sortable>header:after{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-editor div.ta-mirror{position:absolute;top:0;border:solid 1px transparent;color:transparent;padding:.4em .6em;pointer-events:none}#loco-editor div.ta-mirror span{position:relative}#loco-editor div.ta-mirror span:after{color:#ccc;white-space:pre;display:inline-block;position:absolute;top:0;line-height:normal}#loco-editor div.ta-mirror .crlf:after{content:"¬"}#loco-editor div.ta-mirror .eof:after{content:"¶"}#loco-editor div.ta-mirror .x20:after{content:"·";color:#aaa}#loco-editor div.ta-mirror .x9:after{content:"⟶"}#loco-editor div.ta-mirror,#loco-editor .has-mirror textarea{white-space:pre-wrap;word-wrap:break-word;word-spacing:0px}#loco-editor .has-mirror ::placeholder{color:transparent}#loco-editor .has-mirror ::-webkit-input-placeholder{color:transparent}#loco-editor .has-mirror :-moz-placeholder{color:transparent;opacity:1}#loco-editor .has-mirror ::-moz-placeholder{color:transparent;opacity:1}#loco-editor .has-mirror :-ms-input-placeholder{color:transparent}#loco-editor .has-mirror .ielt10 .placeheld{color:transparent}#loco-editor div.ta-mirror{left:0;text-align:left}#loco-editor div.ta-mirror span:after{left:0}#loco-editor div.ta-mirror .eol:after{padding-left:.2em}#loco-editor [dir=RTL] div.ta-mirror{left:auto;right:0;text-align:right}#loco-editor [dir=RTL] div.ta-mirror span:after{right:0}#loco-editor [dir=RTL] div.ta-mirror .eol:after{padding-left:0;padding-right:.2em}#loco-editor .has-proxy>textarea{display:none !important}#loco-editor .has-proxy .ace_editor{height:100%;font-size:13px !important;line-height:1.4 !important}#loco-editor .has-proxy .ace_editor .ace_marker-layer .ace_bracket{display:none}#loco-editor .has-proxy .ace_print-margin{display:none}#loco-editor .ace_printf{color:#b90690;background-color:#edf1be}#loco-editor .ace_locked{color:gray}#loco-editor .ace_icu-quoted{color:gray}#loco-editor .ace_icu{color:#697eb9}#loco-editor .ace_icu.ace_name{color:#b90600}#loco-editor .resizer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0 0 6px 0;background:#f0f0f0 url(../img/wg/splity.png?v=2.4.4) center bottom no-repeat;border:1px solid #ddd;overflow:hidden;cursor:move;cursor:row-resize;cursor:s-resize}#loco-editor .resizer>*{height:100%;border:none}#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}#loco-editor ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.4) 0 0 no-repeat;min-height:75px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.4);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.4);background-size:16px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.4);background-size:16px}}#loco-editor ._green_glow_inner,#loco-editor .is-editable>.wg-content>textarea:focus,#loco-editor .is-editable>.wg-content.has-focus .ace_scroller,#loco-editor .is-editable>.wg-content.has-focus .wysihtml-editor,#loco-editor .is-editable>.wg-content.has-focus .mce-content-body{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-editor ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-editor .loco-font,#loco-editor .is-table .wg-thead .wg-sortable>header:after{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-editor .wg-cell,#loco-editor .wg-cell>div{clear:both;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;outline:none}#loco-editor .wg-cell{left:0;top:0;padding:0;margin:0;overflow:hidden}#loco-editor .wg-split{background:#eee}#loco-editor .wg-body:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}#loco-editor .wg-split-x>div>.not-first>*{margin-left:6px}#loco-editor .wg-split-y>div>.not-first>*{margin-top:6px}#loco-editor .wg-split>div>.has-title .wg-content{margin-top:0}#loco-editor .wg-split-x>div>.wg-cell{float:left;clear:none;height:100%}#loco-editor .wg-split-x>div{cursor:move;cursor:ew-resize;cursor:col-resize}#loco-editor .wg-split>div>.not-first:before{display:block;position:absolute;overflow:hidden;content:" "}#loco-editor .wg-split-x>div>.not-first:before{width:6px;height:100%;background:transparent url(../img/wg/splitx.png?v=2.4.4) center center no-repeat}#loco-editor .wg-split-y>div{cursor:move;cursor:ns-resize;cursor:row-resize}#loco-editor .wg-split-y>div>.not-first:before{height:6px;width:100%;background:transparent url(../img/wg/splity.png?v=2.4.4) center center no-repeat}#loco-editor .wg-split>div.locked{cursor:default}#loco-editor .wg-split-x>div.locked>.not-first>*{margin-left:0px}#loco-editor .wg-split-y>div.locked>.not-first>*{margin-top:0px}#loco-editor .wg-split>div.locked>.not-first:before{display:none}#loco-editor .has-title>header{background:#e2e2e2;cursor:default !important;margin:0;white-space:nowrap}#loco-editor .wg-content{background:#fff;cursor:default;padding:4px 6px;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#loco-editor .wg-toolbar{top:0;right:0;margin-top:6px;position:absolute}#loco-editor .wg-toolbar>span{color:#fff;background:#000;display:block;padding:0 6px;cursor:default !important}#loco-editor .wg-toolbar>span:active{color:#000;background-color:#fff}#loco-editor .wg-content,#loco-editor .wg-tbody>div{overflow:scroll;overflow-x:hidden;overflow-y:auto}#loco-editor .is-table{background-color:#fff}#loco-editor .is-table .wg-thead .has-title>header{font-weight:normal;background:transparent;padding:4px 0;margin:0 0 0 10px}#loco-editor .is-table .wg-thead>div>.not-first:before{background-position:center center}#loco-editor .is-table .wg-thead{background:#e2e2e2;border-bottom:solid 1px #ccc}#loco-editor .is-table .wg-tbody{background-image:url(data:image/gif;base64,R0lGODlhAQAsAIABAPz8/P///yH5BAEAAAEALAAAAAABACwAAAIIjI+pAe0PIygAOw==);position:relative}#loco-editor .is-table .wg-cols>div{float:left;clear:none}#loco-editor .is-table .wg-cols>div>div{white-space:nowrap;line-height:1.7em;padding-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;background-color:#fff}#loco-editor .is-table .wg-cols>div>div:nth-child(even){background-color:#f7f7f7}#loco-editor .is-table .wg-cols>div>div.selected{background-color:#3db63d;color:#fff}#loco-editor .is-table .wg-cols>div>div.selected::selection{background-color:#fff;color:#000}#loco-editor .is-table .wg-cols>div:first-child>div{padding-left:4px}#loco-editor .is-table .wg-dead{clear:both}#loco-editor .is-table .wg-thead .wg-sortable>header{cursor:pointer !important}#loco-editor .is-table .wg-thead .wg-sortable>header:after{padding:0 0 0 5px;color:#999}#loco-editor .is-table .wg-thead .wg-sortable.wg-asc>header:after{content:"▲"}#loco-editor .is-table .wg-thead .wg-sortable.wg-desc>header:after{content:"▼"}#loco-editor .is-table .wg-thead .wg-sortable:hover>header:after{color:#000}#loco-editor .is-field>.wg-content{cursor:text;padding:0;line-height:normal;overflow:hidden;overflow-y:hidden}#loco-editor .is-field>.wg-content>div,#loco-editor .is-field>.wg-content>textarea{font-size:14px;line-height:1.4;border:1px solid #ddd;width:100%;height:100%;padding:8px 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#loco-editor .is-field>.wg-content textarea{resize:none;overflow:auto;display:block}#loco-editor .is-field>.wg-content>.ace_editor{padding:0;border-width:0}#loco-editor .is-field>.wg-content>div[contenteditable]{overflow:scroll;overflow-x:hidden;overflow-y:auto}#loco-editor .is-readonly>.wg-content{cursor:default}#loco-editor .is-readonly>.wg-content>div,#loco-editor .is-readonly>.wg-content>textarea,#loco-editor .is-readonly>.wg-content>textarea[readonly]{background:#f8f8f8;text-shadow:0 1px #fff;color:inherit}#loco-editor .is-readonly>.wg-content .ace_scroller{cursor:default;background:#f8f8f8}#loco-editor .is-readonly>.wg-content .ace_cursor-layer{display:none}#loco-editor .is-readonly>.wg-content>textarea[readonly]{cursor:default}#loco-editor .is-editable>.wg-content[dir=RTL] .ace_editor .ace_line{direction:ltr;unicode-bidi:bidi-override}#loco-editor .wg-split-x>nav.wg-tabs{white-space:nowrap;text-align:center;cursor:default}#loco-editor .wg-split-x>nav.wg-tabs>a{display:inline-block;padding:.5em 1em;margin-top:.2em;color:#000;text-decoration:none;-webkit-border-radius:.2em .2em 0 0;-moz-border-radius:.2em .2em 0 0;-ms-border-radius:.2em .2em 0 0;-o-border-radius:.2em .2em 0 0;border-radius:.2em .2em 0 0;background-color:#f3f7fd}#loco-editor .wg-split-x>nav.wg-tabs>a:hover{background-color:#fff}#loco-editor .wg-split-x>nav.wg-tabs>a.active{background-color:#3db63d;color:#fff}#loco-editor .wg-split>div>.has-nav>.wg-body{margin-top:0px}#loco-editor .wg-dead{visibility:hidden}@media all and (max-width: 768px){#loco-editor .wg-split-x>div>.not-first>*{margin-left:20px}#loco-editor .wg-split-y>div>.not-first>*{margin-top:20px}#loco-editor .wg-split-x>div>.not-first:before{width:20px}#loco-editor .wg-split-y>div>.not-first:before{height:20px}#loco-editor .is-table .wg-thead header{padding-left:20px}}#loco-editor .is-table .po-fuzzy{color:#b59829;font-weight:bold}#loco-editor .is-table .po-empty{color:#1f507a;font-weight:bold}#loco-editor .is-table .po-flagged{color:#bd2c00}#loco-editor .is-table .wg-cols>div:first-child>div:before{font-family:loco;vertical-align:inherit;display:inline-block;content:" ";width:1.3em;line-height:1}#loco-editor .is-table .wg-cols>div:first-child>div.po-fuzzy:before{content:""}#loco-editor .is-table .wg-cols>div:first-child>div.po-flagged:before{content:""}#loco-editor .is-table .wg-cols>div:first-child>div.po-comment:before{content:"";color:#999}#loco-editor .is-table .wg-cols>div:first-child>div.po-unsaved:before{content:"";color:#f1d040}#loco-editor .is-table .wg-cols>div:first-child>div.selected:before{color:#fff !important}#loco-editor .wg-cell>.meta{color:#333;margin:0 !important;padding:6px 10px;font-weight:normal;font-size:13px;line-height:1.4em;cursor:default !important}#loco-editor .wg-cell>.meta>*{display:inline-block;margin-top:3px;margin-bottom:3px}#loco-editor .wg-cell>.meta>span{border:1px solid transparent;border-left:none}#loco-editor .wg-cell>.meta>mark{color:#fff;border-radius:2px;background-color:silver;border:1px solid silver;padding:0 .3em}#loco-editor .wg-cell>.meta>mark.tag{color:#999;background-color:#eee}#loco-editor .wg-cell>.meta>p{display:block;white-space:pre-line}#loco-editor .wg-cell>.meta .icon-warn{color:#c00}#loco-editor .wg-cell>.meta .has-icon:before{padding-right:0;width:17px}#loco-editor .wg-cell>.meta code{font-size:12px}#loco-editor .is-table .wg-cols>div>div>mark{display:inline-block;vertical-align:text-bottom;font:inherit;font-weight:normal;color:#fff;border-radius:2px;font-size:90%;line-height:1;padding:.2em .3em;background-color:rgba(0,0,0,.25)}#loco-editor .is-table .wg-cols>div>div.selected.po-flagged{background-color:#bd2c00}#loco-editor .is-table .wg-cols>div>div.selected.po-fuzzy{background-color:#b59829}#loco-editor .is-table .wg-cols>div>div.selected.po-empty{background-color:#999}#loco-editor #po-target header nav{display:block;position:absolute;right:0px;top:0px;padding:2px}#loco-editor #po-target header nav button{margin-left:5px}#loco-editor #po-target header nav.po-empty .icon-cloud{display:none !important}#loco-editor #po-list .wg-content{padding:0}#loco-editor #po-source>.wg-body>.has-title>header{background:transparent;font-weight:normal;float:left;clear:none;min-width:3.4em}#loco-editor #po-source>.wg-body>.has-title>.wg-content{clear:none}#loco-editor .has-title>header{line-height:normal;padding:6px}#loco-editor .has-title>header .lang{margin-right:6px;margin-bottom:1px}#loco-editor .trg-rtl #po-list-tbody .wg-cols>div[for=po-list-col-target]>div,#loco-editor .src-rtl #po-list-tbody .wg-cols>div[for=po-list-col-source]>div{direction:rtl;padding-left:0;padding-right:10px;text-align:right}#loco-editor #po-source>.wg-body>.has-title>h2{min-width:4.5em}#loco-editor .is-table .wg-td{font-size:13px}#loco-editor header,#loco-editor nav{display:block;position:relative}#loco-editor-inner{min-height:600px;font-size:14px;clear:both}#loco-editor-inner>div.loco-loading{height:100px;background:transparent url(../img/spin-editor-button.gif?v=2.4.4) center 20px no-repeat}#loco-editor-inner h2{color:#000;line-height:1}#loco-editor-inner .wg-cell>.meta code{padding:0;color:#0073aa;background:inherit;cursor:pointer}#loco-editor-inner .wg-cell>.meta code:hover{text-decoration:underline}#loco-admin.wrap #loco-editor>nav{font-size:14px;height:50px}#loco-admin.wrap #loco-editor>nav form{display:block;float:left;clear:none;padding:0;margin:0}#loco-admin.wrap #loco-editor>nav form.aux{float:right;margin-right:5px}#loco-admin.wrap #loco-editor>nav fieldset{display:block;position:relative;float:left;clear:none}#loco-admin.wrap #loco-editor>nav button,#loco-admin.wrap #loco-editor>nav input[type=text]{display:block;position:relative;float:left;clear:none;margin:5px 0 0 5px;height:36px;text-align:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#loco-admin.wrap #loco-editor>nav input[type=text]{padding:0 10px;font-size:14px;line-height:normal}#loco-admin.wrap #loco-editor>nav .invalid input[type=text]:focus{border-color:#c00;-webkit-box-shadow:0 0 2px rgba(153,0,0,.5);-moz-box-shadow:0 0 2px rgba(153,0,0,.5);box-shadow:0 0 2px rgba(153,0,0,.5)}#loco-admin.wrap #loco-editor>nav .loco-clearable{padding:0 20px}#loco-admin.wrap #loco-editor>nav .loco-clearable.invalid a.clear:before{color:#c00}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear{right:25px;line-height:2}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:hover:before{color:#c00}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:active:before{color:#000}#loco-admin.wrap #loco-editor>nav button.only-icon{width:40px}#loco-admin.wrap button.has-icon:before{width:16px;padding:0}#loco-admin.wrap button.has-icon.loco-loading:before{content:" ";height:16px;background:transparent url(../img/spin-editor-button.gif?v=2.4.4) 0 0 no-repeat}#loco-admin.wrap .button,#loco-admin.wrap .button-link,#loco-admin.wrap input[type=text]{border-color:#aaa;color:#444}#loco-admin.wrap .button:hover,#loco-admin.wrap .button-link:hover{color:#000}#loco-admin.wrap .button-primary,#loco-admin.wrap .button-primary:hover{color:#fff}#loco-admin.wrap button.icon-translate:before{font-size:16px}.loco-modal .loco-api{position:relative;padding:10px;background:#f7f7f7;border:solid 1px #eee;font-size:14px;margin-bottom:16px}.loco-modal .loco-api p{padding:0;margin:0;font-size:inherit}.loco-modal .loco-api blockquote{font-weight:bold;margin:0;padding:10px 0}.loco-modal .loco-api a.loco-api-credit{padding:0;display:block;position:absolute;right:10px;bottom:10px;text-decoration:none;white-space:nowrap;overflow:hidden;font-size:12px}.loco-modal .loco-api a.loco-api-credit:hover{text-decoration:underline}.loco-modal .loco-api-loading{text-indent:20px;background:transparent url(../img/spin-modal.gif?v=2.4.4) 10px center no-repeat}.loco-modal .loco-alert p{margin-bottom:2em;font-size:14px}.loco-modal .loco-alert nav{display:block;position:relative;margin:1em 0}.loco-modal .loco-alert nav a{display:inline-block;margin-right:1em;padding:10px}#loco-auto{display:none;min-width:50%;min-height:300px;position:relative}#loco-auto form blockquote{margin:0;padding:1em 0;font-size:14px}.loco-api a.loco-api-credit{color:inherit}.loco-api-yandex a.loco-api-credit:before{content:"Powered by "}.loco-api-google a.loco-api-credit{text-indent:200px;width:122px;height:16px;background:transparent url(../img/api/google.png?v=2.4.4) 0 0 no-repeat}.loco-api-microsoft a.loco-api-credit{text-indent:200px;width:152px;height:16px;background:transparent url(../img/api/microsoft.png?v=2.4.4) 0 0 no-repeat}.loco-api-deepl a.loco-api-credit{text-indent:200px;width:122px;height:16px;background:transparent url(../img/api/deepl.png?v=2.4.4) 0 0 no-repeat}
|
1 |
+
#loco-editor{border:solid 1px #ccc}#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}#loco-editor ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.5) 0 0 no-repeat;min-height:75px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.5);background-size:16px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.5);background-size:16px}}#loco-editor ._green_glow_inner,#loco-editor .is-editable>.wg-content>textarea:focus,#loco-editor .is-editable>.wg-content.has-focus .ace_scroller,#loco-editor .is-editable>.wg-content.has-focus .wysihtml-editor,#loco-editor .is-editable>.wg-content.has-focus .mce-content-body{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-editor ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-editor .loco-font,#loco-editor .is-table .wg-thead .wg-sortable>header:after{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-editor div.ta-mirror{position:absolute;top:0;border:solid 1px transparent;color:transparent;padding:.4em .6em;pointer-events:none}#loco-editor div.ta-mirror span{position:relative}#loco-editor div.ta-mirror span:after{color:#ccc;white-space:pre;display:inline-block;position:absolute;top:0;line-height:normal}#loco-editor div.ta-mirror .crlf:after{content:"¬"}#loco-editor div.ta-mirror .eof:after{content:"¶"}#loco-editor div.ta-mirror .x20:after{content:"·";color:#aaa}#loco-editor div.ta-mirror .x9:after{content:"⟶"}#loco-editor div.ta-mirror,#loco-editor .has-mirror textarea{white-space:pre-wrap;word-wrap:break-word;word-spacing:0px}#loco-editor .has-mirror ::placeholder{color:transparent}#loco-editor .has-mirror ::-webkit-input-placeholder{color:transparent}#loco-editor .has-mirror :-moz-placeholder{color:transparent;opacity:1}#loco-editor .has-mirror ::-moz-placeholder{color:transparent;opacity:1}#loco-editor .has-mirror :-ms-input-placeholder{color:transparent}#loco-editor .has-mirror .ielt10 .placeheld{color:transparent}#loco-editor div.ta-mirror{left:0;text-align:left}#loco-editor div.ta-mirror span:after{left:0}#loco-editor div.ta-mirror .eol:after{padding-left:.2em}#loco-editor [dir=RTL] div.ta-mirror{left:auto;right:0;text-align:right}#loco-editor [dir=RTL] div.ta-mirror span:after{right:0}#loco-editor [dir=RTL] div.ta-mirror .eol:after{padding-left:0;padding-right:.2em}#loco-editor .has-proxy>textarea{display:none !important}#loco-editor .has-proxy .ace_editor{height:100%;font-size:13px !important;line-height:1.4 !important}#loco-editor .has-proxy .ace_editor .ace_marker-layer .ace_bracket{display:none}#loco-editor .has-proxy .ace_print-margin{display:none}#loco-editor .ace_printf{color:#b90690;background-color:#edf1be}#loco-editor .ace_locked{color:gray}#loco-editor .ace_icu-quoted{color:gray}#loco-editor .ace_icu{color:#697eb9}#loco-editor .ace_icu.ace_name{color:#b90600}#loco-editor .resizer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0 0 6px 0;background:#f0f0f0 url(../img/wg/splity.png?v=2.4.5) center bottom no-repeat;border:1px solid #ddd;overflow:hidden;cursor:move;cursor:row-resize;cursor:s-resize}#loco-editor .resizer>*{height:100%;border:none}#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}#loco-editor ._ajax_loader_f2x4{background:transparent url(../img/ajax-loader-f2-x4.gif?v=2.4.5) 0 0 no-repeat;min-height:75px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc.gif?v=2.4.5);background-repeat:no-repeat;min-height:16px}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){#loco-editor ._ajax_loader_f2{background-image:url(../img/ajax-loader-f2-x2.gif?v=2.4.5);background-size:16px}#loco-editor ._ajax_loader_cc{background-image:url(../img/ajax-loader-cc-x2.gif?v=2.4.5);background-size:16px}}#loco-editor ._green_glow_inner,#loco-editor .is-editable>.wg-content>textarea:focus,#loco-editor .is-editable>.wg-content.has-focus .ace_scroller,#loco-editor .is-editable>.wg-content.has-focus .wysihtml-editor,#loco-editor .is-editable>.wg-content.has-focus .mce-content-body{-webkit-box-shadow:inset 0 0 10px 0 #3db63d;-moz-box-shadow:inset 0 0 10px 0 #3db63d;box-shadow:inset 0 0 10px 0 #3db63d}#loco-editor ._green_glow_outer{-webkit-box-shadow:0 0 .5em 0 #3db63d;-moz-box-shadow:0 0 .5em 0 #3db63d;box-shadow:0 0 .5em 0 #3db63d}#loco-editor .loco-font,#loco-editor .is-table .wg-thead .wg-sortable>header:after{font-family:"loco";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#loco-editor .wg-cell,#loco-editor .wg-cell>div{clear:both;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;outline:none}#loco-editor .wg-cell{left:0;top:0;padding:0;margin:0;overflow:hidden}#loco-editor .wg-split{background:#eee}#loco-editor .wg-body:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}#loco-editor .wg-split-x>div>.not-first>*{margin-left:6px}#loco-editor .wg-split-y>div>.not-first>*{margin-top:6px}#loco-editor .wg-split>div>.has-title .wg-content{margin-top:0}#loco-editor .wg-split-x>div>.wg-cell{float:left;clear:none;height:100%}#loco-editor .wg-split-x>div{cursor:move;cursor:ew-resize;cursor:col-resize}#loco-editor .wg-split>div>.not-first:before{display:block;position:absolute;overflow:hidden;content:" "}#loco-editor .wg-split-x>div>.not-first:before{width:6px;height:100%;background:transparent url(../img/wg/splitx.png?v=2.4.5) center center no-repeat}#loco-editor .wg-split-y>div{cursor:move;cursor:ns-resize;cursor:row-resize}#loco-editor .wg-split-y>div>.not-first:before{height:6px;width:100%;background:transparent url(../img/wg/splity.png?v=2.4.5) center center no-repeat}#loco-editor .wg-split>div.locked{cursor:default}#loco-editor .wg-split-x>div.locked>.not-first>*{margin-left:0px}#loco-editor .wg-split-y>div.locked>.not-first>*{margin-top:0px}#loco-editor .wg-split>div.locked>.not-first:before{display:none}#loco-editor .has-title>header{background:#e2e2e2;cursor:default !important;margin:0;white-space:nowrap}#loco-editor .wg-content{background:#fff;cursor:default;padding:4px 6px;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#loco-editor .wg-toolbar{top:0;right:0;margin-top:6px;position:absolute}#loco-editor .wg-toolbar>span{color:#fff;background:#000;display:block;padding:0 6px;cursor:default !important}#loco-editor .wg-toolbar>span:active{color:#000;background-color:#fff}#loco-editor .wg-content,#loco-editor .wg-tbody>div{overflow:scroll;overflow-x:hidden;overflow-y:auto}#loco-editor .is-table{background-color:#fff}#loco-editor .is-table .wg-thead .has-title>header{font-weight:normal;background:transparent;padding:4px 0;margin:0 0 0 10px}#loco-editor .is-table .wg-thead>div>.not-first:before{background-position:center center}#loco-editor .is-table .wg-thead{background:#e2e2e2;border-bottom:solid 1px #ccc}#loco-editor .is-table .wg-tbody{background-image:url(data:image/gif;base64,R0lGODlhAQAsAIABAPz8/P///yH5BAEAAAEALAAAAAABACwAAAIIjI+pAe0PIygAOw==);position:relative}#loco-editor .is-table .wg-cols>div{float:left;clear:none}#loco-editor .is-table .wg-cols>div>div{white-space:nowrap;line-height:1.7em;padding-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;background-color:#fff}#loco-editor .is-table .wg-cols>div>div:nth-child(even){background-color:#f7f7f7}#loco-editor .is-table .wg-cols>div>div.selected{background-color:#3db63d;color:#fff}#loco-editor .is-table .wg-cols>div>div.selected::selection{background-color:#fff;color:#000}#loco-editor .is-table .wg-cols>div:first-child>div{padding-left:4px}#loco-editor .is-table .wg-dead{clear:both}#loco-editor .is-table .wg-thead .wg-sortable>header{cursor:pointer !important}#loco-editor .is-table .wg-thead .wg-sortable>header:after{padding:0 0 0 5px;color:#999}#loco-editor .is-table .wg-thead .wg-sortable.wg-asc>header:after{content:"▲"}#loco-editor .is-table .wg-thead .wg-sortable.wg-desc>header:after{content:"▼"}#loco-editor .is-table .wg-thead .wg-sortable:hover>header:after{color:#000}#loco-editor .is-field>.wg-content{cursor:text;padding:0;line-height:normal;overflow:hidden;overflow-y:hidden}#loco-editor .is-field>.wg-content>div,#loco-editor .is-field>.wg-content>textarea{font-size:14px;line-height:1.4;border:1px solid #ddd;width:100%;height:100%;padding:8px 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#loco-editor .is-field>.wg-content textarea{resize:none;overflow:auto;display:block}#loco-editor .is-field>.wg-content>.ace_editor{padding:0;border-width:0}#loco-editor .is-field>.wg-content>div[contenteditable]{overflow:scroll;overflow-x:hidden;overflow-y:auto}#loco-editor .is-readonly>.wg-content{cursor:default}#loco-editor .is-readonly>.wg-content>div,#loco-editor .is-readonly>.wg-content>textarea,#loco-editor .is-readonly>.wg-content>textarea[readonly]{background:#f8f8f8;text-shadow:0 1px #fff;color:inherit}#loco-editor .is-readonly>.wg-content .ace_scroller{cursor:default;background:#f8f8f8}#loco-editor .is-readonly>.wg-content .ace_cursor-layer{display:none}#loco-editor .is-readonly>.wg-content>textarea[readonly]{cursor:default}#loco-editor .is-editable>.wg-content[dir=RTL] .ace_editor .ace_line{direction:ltr;unicode-bidi:bidi-override}#loco-editor .wg-split-x>nav.wg-tabs{white-space:nowrap;text-align:center;cursor:default}#loco-editor .wg-split-x>nav.wg-tabs>a{display:inline-block;padding:.5em 1em;margin-top:.2em;color:#000;text-decoration:none;-webkit-border-radius:.2em .2em 0 0;-moz-border-radius:.2em .2em 0 0;-ms-border-radius:.2em .2em 0 0;-o-border-radius:.2em .2em 0 0;border-radius:.2em .2em 0 0;background-color:#f3f7fd}#loco-editor .wg-split-x>nav.wg-tabs>a:hover{background-color:#fff}#loco-editor .wg-split-x>nav.wg-tabs>a.active{background-color:#3db63d;color:#fff}#loco-editor .wg-split>div>.has-nav>.wg-body{margin-top:0px}#loco-editor .wg-dead{visibility:hidden}@media all and (max-width: 768px){#loco-editor .wg-split-x>div>.not-first>*{margin-left:20px}#loco-editor .wg-split-y>div>.not-first>*{margin-top:20px}#loco-editor .wg-split-x>div>.not-first:before{width:20px}#loco-editor .wg-split-y>div>.not-first:before{height:20px}#loco-editor .is-table .wg-thead header{padding-left:20px}}#loco-editor .is-table .po-fuzzy{color:#b59829;font-weight:bold}#loco-editor .is-table .po-empty{color:#1f507a;font-weight:bold}#loco-editor .is-table .po-flagged{color:#bd2c00}#loco-editor .is-table .wg-cols>div:first-child>div:before{font-family:loco;vertical-align:inherit;display:inline-block;content:" ";width:1.3em;line-height:1}#loco-editor .is-table .wg-cols>div:first-child>div.po-fuzzy:before{content:""}#loco-editor .is-table .wg-cols>div:first-child>div.po-flagged:before{content:""}#loco-editor .is-table .wg-cols>div:first-child>div.po-comment:before{content:"";color:#999}#loco-editor .is-table .wg-cols>div:first-child>div.po-unsaved:before{content:"";color:#f1d040}#loco-editor .is-table .wg-cols>div:first-child>div.selected:before{color:#fff !important}#loco-editor .wg-cell>.meta{color:#333;margin:0 !important;padding:6px 10px;font-weight:normal;font-size:13px;line-height:1.4em;cursor:default !important}#loco-editor .wg-cell>.meta>*{display:inline-block;margin-top:3px;margin-bottom:3px}#loco-editor .wg-cell>.meta>span{border:1px solid transparent;border-left:none}#loco-editor .wg-cell>.meta>mark{color:#fff;border-radius:2px;background-color:silver;border:1px solid silver;padding:0 .3em}#loco-editor .wg-cell>.meta>mark.tag{color:#999;background-color:#eee}#loco-editor .wg-cell>.meta>p{display:block;white-space:pre-line}#loco-editor .wg-cell>.meta .icon-warn{color:#c00}#loco-editor .wg-cell>.meta .has-icon:before{padding-right:0;width:17px}#loco-editor .wg-cell>.meta code{font-size:12px}#loco-editor .is-table .wg-cols>div>div>mark{display:inline-block;vertical-align:text-bottom;font:inherit;font-weight:normal;color:#fff;border-radius:2px;font-size:90%;line-height:1;padding:.2em .3em;background-color:rgba(0,0,0,.25)}#loco-editor .is-table .wg-cols>div>div.selected.po-flagged{background-color:#bd2c00}#loco-editor .is-table .wg-cols>div>div.selected.po-fuzzy{background-color:#b59829}#loco-editor .is-table .wg-cols>div>div.selected.po-empty{background-color:#999}#loco-editor #po-target header nav{display:block;position:absolute;right:0px;top:0px;padding:2px}#loco-editor #po-target header nav button{margin-left:5px}#loco-editor #po-target header nav.po-empty .icon-cloud{display:none !important}#loco-editor #po-list .wg-content{padding:0}#loco-editor #po-source>.wg-body>.has-title>header{background:transparent;font-weight:normal;float:left;clear:none;min-width:3.4em}#loco-editor #po-source>.wg-body>.has-title>.wg-content{clear:none}#loco-editor .has-title>header{line-height:normal;padding:6px}#loco-editor .has-title>header .lang{margin-right:6px;margin-bottom:1px}#loco-editor .trg-rtl #po-list-tbody .wg-cols>div[for=po-list-col-target]>div,#loco-editor .src-rtl #po-list-tbody .wg-cols>div[for=po-list-col-source]>div{direction:rtl;padding-left:0;padding-right:10px;text-align:right}#loco-editor #po-source>.wg-body>.has-title>h2{min-width:4.5em}#loco-editor .is-table .wg-td{font-size:13px}#loco-editor header,#loco-editor nav{display:block;position:relative}#loco-editor-inner{min-height:600px;font-size:14px;clear:both}#loco-editor-inner>div.loco-loading{height:100px;background:transparent url(../img/spin-editor-button.gif?v=2.4.5) center 20px no-repeat}#loco-editor-inner h2{color:#000;line-height:1}#loco-editor-inner .wg-cell>.meta code{padding:0;color:#0073aa;background:inherit;cursor:pointer}#loco-editor-inner .wg-cell>.meta code:hover{text-decoration:underline}#loco-admin.wrap #loco-editor>nav{font-size:14px;height:50px}#loco-admin.wrap #loco-editor>nav form{display:block;float:left;clear:none;padding:0;margin:0}#loco-admin.wrap #loco-editor>nav form.aux{float:right;margin-right:5px}#loco-admin.wrap #loco-editor>nav fieldset{display:block;position:relative;float:left;clear:none}#loco-admin.wrap #loco-editor>nav button,#loco-admin.wrap #loco-editor>nav input[type=text]{display:block;position:relative;float:left;clear:none;margin:5px 0 0 5px;height:36px;text-align:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#loco-admin.wrap #loco-editor>nav input[type=text]{padding:0 10px;font-size:14px;line-height:normal}#loco-admin.wrap #loco-editor>nav .invalid input[type=text]:focus{border-color:#c00;-webkit-box-shadow:0 0 2px rgba(153,0,0,.5);-moz-box-shadow:0 0 2px rgba(153,0,0,.5);box-shadow:0 0 2px rgba(153,0,0,.5)}#loco-admin.wrap #loco-editor>nav .loco-clearable{padding:0 20px}#loco-admin.wrap #loco-editor>nav .loco-clearable.invalid a.clear:before{color:#c00}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear{right:25px;line-height:2}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:hover:before{color:#c00}#loco-admin.wrap #loco-editor>nav .loco-clearable a.clear:active:before{color:#000}#loco-admin.wrap #loco-editor>nav button.only-icon{width:40px}#loco-admin.wrap button.has-icon:before{width:16px;padding:0}#loco-admin.wrap button.has-icon.loco-loading:before{content:" ";height:16px;background:transparent url(../img/spin-editor-button.gif?v=2.4.5) 0 0 no-repeat}#loco-admin.wrap .button,#loco-admin.wrap .button-link,#loco-admin.wrap input[type=text]{border-color:#aaa;color:#444}#loco-admin.wrap .button:hover,#loco-admin.wrap .button-link:hover{color:#000}#loco-admin.wrap .button-primary,#loco-admin.wrap .button-primary:hover{color:#fff}#loco-admin.wrap button.icon-translate:before{font-size:16px}.loco-modal .loco-api{position:relative;padding:10px;background:#f7f7f7;border:solid 1px #eee;font-size:14px;margin-bottom:16px}.loco-modal .loco-api p{padding:0;margin:0;font-size:inherit}.loco-modal .loco-api blockquote{font-weight:bold;margin:0;padding:10px 0}.loco-modal .loco-api a.loco-api-credit{padding:0;display:block;position:absolute;right:10px;bottom:10px;text-decoration:none;white-space:nowrap;overflow:hidden;font-size:12px}.loco-modal .loco-api a.loco-api-credit:hover{text-decoration:underline}.loco-modal .loco-api-loading{text-indent:20px;background:transparent url(../img/spin-modal.gif?v=2.4.5) 10px center no-repeat}.loco-modal .loco-alert p{margin-bottom:2em;font-size:14px}.loco-modal .loco-alert nav{display:block;position:relative;margin:1em 0}.loco-modal .loco-alert nav a{display:inline-block;margin-right:1em;padding:10px}#loco-auto{display:none;min-width:50%;min-height:300px;position:relative}#loco-auto form blockquote{margin:0;padding:1em 0;font-size:14px}.loco-api a.loco-api-credit{color:inherit}.loco-api-yandex a.loco-api-credit:before{content:"Powered by "}.loco-api-google a.loco-api-credit{text-indent:200px;width:122px;height:16px;background:transparent url(../img/api/google.png?v=2.4.5) 0 0 no-repeat}.loco-api-microsoft a.loco-api-credit{text-indent:200px;width:152px;height:16px;background:transparent url(../img/api/microsoft.png?v=2.4.5) 0 0 no-repeat}.loco-api-deepl a.loco-api-credit{text-indent:200px;width:122px;height:16px;background:transparent url(../img/api/deepl.png?v=2.4.5) 0 0 no-repeat}
|
pub/css/podiff.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#loco-admin.wrap .revisions-diff{padding:10px;min-height:20px}#loco-admin.wrap table.diff{border-collapse:collapse}#loco-admin.wrap table.diff td{white-space:nowrap;overflow:hidden;font:normal 12px/17px "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;padding:2px}#loco-admin.wrap table.diff td>span{color:#aaa}#loco-admin.wrap table.diff td>span:after{content:". "}#loco-admin.wrap table.diff tbody{border-top:1px dashed #ccc}#loco-admin.wrap table.diff tbody:first-child{border-top:none}#loco-admin.wrap .revisions.loading .diff-meta{color:#eee}#loco-admin.wrap .revisions.loading .loading-indicator span.spinner{visibility:visible;background:#fff url(../img/spin-modal.gif?v=2.4.
|
1 |
+
#loco-admin.wrap .revisions-diff{padding:10px;min-height:20px}#loco-admin.wrap table.diff{border-collapse:collapse}#loco-admin.wrap table.diff td{white-space:nowrap;overflow:hidden;font:normal 12px/17px "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;padding:2px}#loco-admin.wrap table.diff td>span{color:#aaa}#loco-admin.wrap table.diff td>span:after{content:". "}#loco-admin.wrap table.diff tbody{border-top:1px dashed #ccc}#loco-admin.wrap table.diff tbody:first-child{border-top:none}#loco-admin.wrap .revisions.loading .diff-meta{color:#eee}#loco-admin.wrap .revisions.loading .loading-indicator span.spinner{visibility:visible;background:#fff url(../img/spin-modal.gif?v=2.4.5) center center no-repeat}#loco-admin.wrap .revisions-meta{clear:both;padding:10px 12px;margin:0;position:relative;top:10px}#loco-admin.wrap .revisions-meta .diff-meta{clear:none;float:left;width:50%;padding:0;min-height:auto}#loco-admin.wrap .revisions-meta .diff-meta button{margin-top:5px}#loco-admin.wrap .revisions-meta .diff-meta-current{float:right;text-align:right}#loco-admin.wrap .revisions-meta time{color:#72777c}#loco-admin.wrap .revisions-control-frame{margin:10px 0}#loco-admin.wrap .revisions-diff-frame{margin-top:20px}
|
pub/css/poview.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.js #loco-admin.wrap .loco-loading{min-height:100px;background:#fff url(../img/spin-modal.gif?v=2.4.
|
1 |
+
.js #loco-admin.wrap .loco-loading{min-height:100px;background:#fff url(../img/spin-modal.gif?v=2.4.5) center center no-repeat}.js #loco-admin.wrap .loco-loading ol.msgcat{display:none}#loco-admin.wrap #loco-po{padding-right:0;overflow:auto}#loco-admin.wrap ol.msgcat{margin-left:3em;padding-top:1em;border-top:1px dashed #ccc}#loco-admin.wrap ol.msgcat:first-child{padding-top:0;border-top:none}#loco-admin.wrap ol.msgcat li{color:#aaa;margin:0;padding:0 0 0 1em;font:normal 12px/17px "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;border-left:1px solid #eee}#loco-admin.wrap ol.msgcat li>*{color:#333;white-space:pre}#loco-admin.wrap ol.msgcat li>.po-comment{color:#3cc200}#loco-admin.wrap ol.msgcat li>.po-refs{color:#0073aa}#loco-admin.wrap ol.msgcat li>.po-refs a{color:inherit;text-decoration:none}#loco-admin.wrap ol.msgcat li>.po-refs a:hover{text-decoration:underline}#loco-admin.wrap ol.msgcat li>.po-flags{color:#77904a}#loco-admin.wrap ol.msgcat li>.po-flags em{font-style:normal}#loco-admin.wrap ol.msgcat li>.po-word{color:#000}#loco-admin.wrap ol.msgcat li>.po-junk{font-style:italic;color:#ccc}#loco-admin.wrap ol.msgcat li>.po-string>span{color:#c931c7}#loco-admin.wrap form.loco-filter{top:0;right:0;position:absolute}#loco-admin.wrap .loco-invalid form.loco-filter input[type=text]:focus{border-color:#c00;-webkit-box-shadow:0 0 2px rgba(153,0,0,.5);-moz-box-shadow:0 0 2px rgba(153,0,0,.5);box-shadow:0 0 2px rgba(153,0,0,.5)}#loco-admin.wrap .loco-invalid ol.msgcat{list-style-type:none}#loco-admin.wrap .loco-invalid ol.msgcat li{color:#000}
|
pub/css/skins/blue.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(9,100,132,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#096484;foo:#096484}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1cdc7 !important;background:#db9925 !important;border-color:#db9925 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/blue/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(9,100,132,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#096484;foo:#096484}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1cdc7 !important;background:#db9925 !important;border-color:#db9925 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/blue/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/coffee.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(199,165,137,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#c7a589;foo:#c7a589}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1ccc7 !important;background:#ba906d !important;border-color:#ba906d !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/coffee/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(199,165,137,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#c7a589;foo:#c7a589}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1ccc7 !important;background:#ba906d !important;border-color:#ba906d !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/coffee/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/ectoplasm.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(163,183,69,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#a3b745;foo:#a3b745}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#cfd1c7 !important;background:#89993a !important;border-color:#89993a !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/ectoplasm/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(163,183,69,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#a3b745;foo:#a3b745}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#cfd1c7 !important;background:#89993a !important;border-color:#89993a !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/ectoplasm/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/light.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(136,136,136,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#888;foo:#04a4cc}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7cfd1 !important;background:#0384a4 !important;border-color:#0384a4 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/light/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(136,136,136,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#888;foo:#04a4cc}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7cfd1 !important;background:#0384a4 !important;border-color:#0384a4 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/light/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/midnight.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(225,77,67,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#e14d43;foo:#e14d43}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1c8c7 !important;background:#d92e23 !important;border-color:#d92e23 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/midnight/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(225,77,67,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#e14d43;foo:#e14d43}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1c8c7 !important;background:#d92e23 !important;border-color:#d92e23 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/midnight/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/modern.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(56,88,233,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#3858e9;foo:#3858e9}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7c9d1 !important;background:#193ddf !important;border-color:#193ddf !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/modern/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(56,88,233,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#3858e9;foo:#3858e9}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7c9d1 !important;background:#193ddf !important;border-color:#193ddf !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/modern/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/ocean.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(158,186,160,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#9ebaa0;foo:#9ebaa0}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7d1c8 !important;background:#86a989 !important;border-color:#86a989 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/ocean/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(158,186,160,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#9ebaa0;foo:#9ebaa0}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#c7d1c8 !important;background:#86a989 !important;border-color:#86a989 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/ocean/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/css/skins/sunrise.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(221,130,59,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#dd823b;foo:#dd823b}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1cbc7 !important;background:#cc6d23 !important;border-color:#cc6d23 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/sunrise/spin-primary-button.gif?v=2.4.
|
1 |
+
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(221,130,59,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#dd823b;foo:#dd823b}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}.wp-core-ui .button-primary.loco-loading[disabled]{color:#d1cbc7 !important;background:#cc6d23 !important;border-color:#cc6d23 !important}.wp-core-ui .button-primary.loco-loading[disabled]:before{background:transparent url(../../img/skins/sunrise/spin-primary-button.gif?v=2.4.5) 0 0 no-repeat !important}
|
pub/js/min/admin.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
(function(v,
|
2 |
-
|
3 |
-
g.init=function(){return g};return g}({},v,
|
4 |
-
if(99<c)c=Math.min(c,99.9),
|
5 |
-
for(d=0<=d?d:Math.max(b-Math.abs(d),0);d<b;d++)if(d in c&&c[d]===
|
6 |
-
|
7 |
-
clearTimeout(
|
8 |
-
|
9 |
-
a+' loco-notice inline"></div>').prependTo(
|
10 |
-
|
11 |
-
g.error).call(g,a.message)};g.convert=c;g.init=function(a){
|
12 |
-
"")):t._("Server returned invalid data")}function c(a){
|
13 |
-
s._("Check console output for debugging information")),
|
14 |
-
a.notices,d=
|
15 |
-
a.find("button").each(
|
16 |
-
!0,G=s||{},
|
17 |
-
hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});
|
18 |
-
(d=/^([a-z]{2,3})(?:[-_]([a-z]{2}))?(?:[-_]([a-z0-9]{3,8}))?$/i)).exec(b))return null;var a=new
|
19 |
-
"region","lang"],
|
20 |
"\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c","\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e",
|
21 |
"\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e","\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i",
|
22 |
"\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j","\u1e31":"k","\u01e9":"k","\u0137":"k","\ua7a3":"k","\u1e33":"k","\u1e35":"k","\u013a":"l","\u013e":"l","\u013c":"l","\u0142":"l","\u1e37":"l","\u1e39":"l","\u1e3d":"l","\u1e3b":"l","\u0140":"l","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0144":"n","\u01f9":"n","\u0148":"n","\u00f1":"n","\u1e45":"n","\u0146":"n","\ua7a5":"n",
|
@@ -28,172 +28,168 @@ hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cpr
|
|
28 |
"\u1f25":"\u03b7","\u1f95":"\u03b7","\u1f23":"\u03b7","\u1f93":"\u03b7","\u1f27":"\u03b7","\u1f97":"\u03b7","\u1f91":"\u03b7","\u03ae":"\u03b7","\u1f75":"\u03b7","\u1fc4":"\u03b7","\u1f74":"\u03b7","\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9",
|
29 |
"\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf","\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5",
|
30 |
"\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9","\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9",
|
31 |
-
"\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});
|
32 |
-
|
33 |
-
pull:function(b,
|
34 |
-
(
|
35 |
-
a)return
|
36 |
-
function(){
|
37 |
-
height:b[0].offsetHeight}),
|
38 |
-
|
39 |
-
b.attr("original-title",a).removeAttr("title")},getTitle:function(){var b,a=this.$element,
|
40 |
-
"html":"text"](b)},tip:function(){this.$tip||(this.$tip=
|
41 |
-
|
42 |
-
"live":"bind",
|
43 |
-
function(){return
|
44 |
-
function(){return 0});"".trim||(String.prototype.trim=function(){return
|
45 |
-
v,
|
46 |
-
RegExp.$1.toLowerCase();if(a=RegExp.$2)b.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)b.region=a.toUpperCase();if(a=RegExp.$4)b.variant=a.toLowerCase();if(a=RegExp.$5)b.extension=a;return b};
|
47 |
-
|
48 |
-
function(){return"[Undefined]"};b.prototype._validate=function(a){var b,
|
49 |
-
|
50 |
-
|
51 |
-
"touchend";g.ok=function(a){null==c&&(c="function"===typeof
|
52 |
-
s(
|
53 |
-
F[a]-c.clientX;
|
54 |
-
1:-1,
|
55 |
-
return g}({},v,
|
56 |
-
|
57 |
-
g=null);
|
58 |
-
g.stat=function(b){var a;if(!(a=c)){for(var
|
59 |
-
function c(a){d(a);a.setReadOnly(!0);a.setHighlightGutterLine(!1);a.setHighlightActiveLine(!1)}function b(b,c){function
|
60 |
-
regex:/<!\[CDATA\[/},{token:"constant.language",regex:/\]\]>/},{token:"locked",regex:/<(?:xliff:)?(?:g|ph)[^>]*>[^<]*<\/(?:xliff:)?(?:g|ph)>/},{token:"locked",regex:/<(?:xliff:)?(bx|ex|x)[^\/>]*\/>/},{token:"constant.language",regex:/<\/?[:a-z]+[^>]*>/}]},c=
|
61 |
{token:"icu",regex:/{/,next:"icuName"},{token:"icu",regex:/}/,next:"icuType"}]),icuName:[{token:"icu",regex:"[\\s\\u0085\\u200E\\u200F\\u2028\\u2029]+"},{token:"icu.name",regex:"[^\\s\\u0085\\u200E\\u200F\\u2028\\u2029!-/:-@\\[-^{-~\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a9\u00ab\u00ac\u00ae\u00b0\u00b1\u00b6\u00bb\u00bf\u00d7\u00f7\\u2010-\\u2027\\u2030-\\u203E\\u2041-\\u2053\\u2055-\\u205E\\u2190-\\u245F\\u2500-\\u2775\\u2794-\\u2BFF\\u2E00-\\u2E7F\\u3001-\\u3003\\u3008-\\u3020\\u3030\\uFD3E\\uFD3F\\uFE45\\uFE46]+",
|
62 |
-
next:"icuType"},{defaultToken:"icu",next:"icuType"}],icuType:[{token:"icu",regex:/[{}]/,next:"start"},{defaultToken:"icu"}]}:c&&b.start.push({token:"printf",regex:c});this.$rules=b}}function
|
63 |
-
case "python":return/%(?:\([a-z]+\))?[-+0# ]*(?:\d+|\*)?(?:\.\d+|\.\*)?(?:[hlL])?[sdiouxXeEfFgGcra%]/;case "javascript":return/%(?:[1-9]\d*\$)?\+?(?:0|'[^$])?-?\d*(?:\.\d+)?[b-gijostTuvxX%]/;case "auto":return/%(?:\d+\$|\([a-z]+\))?(?:[-+0]?\d*(\.\d+)?[duxoefgaDUXOEFGA]|[@scSC%])/;case
|
64 |
-
function(
|
65 |
-
|
66 |
-
|
67 |
-
"</p>"===a.substr(-4);return a.replace(/(<\/?)script/ig,"$1loco:script")}function
|
68 |
-
s=a.parentNode,
|
69 |
block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;",forced_root_block:"p",relative_urls:!1,convert_urls:!1,remove_script_host:!1,document_base_url:"",allow_script_urls:!1,formats:{alignleft:{classes:"alignleft"},alignright:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"alignright"},aligncenter:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"aligncenter"},strikethrough:{inline:"del"}},fix_list_elements:!0,extended_valid_elements:"span,b,i,u,loco:script",
|
70 |
-
entities:"38,amp,60,lt,62,gt,160,nbsp",entity_encoding:"named",keep_styles:!1,init_instance_callback:
|
71 |
-
focus:function(){
|
72 |
-
|
73 |
-
b.readOnly?a.disable():a.enable();return a};TextAreaPrototype=d.prototype;TextAreaPrototype.destroy=function(){this.unlisten();var b=this.p;b&&(b.kill(),this.p=null);this.e=null};TextAreaPrototype.reload=function(b,a){var c=this.l;c&&!a&&(this.disable(),c=null);this.val(b||"");a&&!c&&this.enable();return this};TextAreaPrototype.val=function(b){var a=this.e;if(null==b)return a.value;var c=this.l,d=this.p;d&&d.val(b);c&&c.val(b);c||a.value===b||(a.value=b,
|
74 |
-
TextAreaPrototype.fire=function(){this.l&&this.l.fire();return this};TextAreaPrototype.ping=function(){this.l&&this.l.ping();return this};TextAreaPrototype.focus=function(){var b=this.p;b?b.focus():
|
75 |
-
function(){return!!this.l};TextAreaPrototype.enable=function(){var b=this.p;this.e.removeAttribute("readonly");this.listen();b&&b.enable&&b.enable(this.l);return this};TextAreaPrototype.disable=function(){var b=this.p;this.e.setAttribute("readonly",!0);this.unlisten();b&&b.disable&&b.disable();return this};TextAreaPrototype.listen=function(){var b=this.l;b&&b.kill();this.l=
|
76 |
-
function(b,a){var c=this.i||!1;if(a||c!==b)this._i&&(this._i.kill(),delete this._i),(c=this.p)?c.invs&&c.invs(b):b&&(this._i=
|
77 |
-
!0),c&&this.focus());return this};TextAreaPrototype.setStrf=function(b){this["%"]=b;"code"===this.m&&this.p.strf(b);return this};TextAreaPrototype.name=function(b){this.e.setAttribute("name",b);return this};TextAreaPrototype.placeholder=function(b){this.e.setAttribute("placeholder",b);return this};TextAreaPrototype.redraw=function(){var b=this.p;b&&b.resize&&b.resize()};TextAreaPrototype=null;return g}({},v,
|
78 |
-
function d(a){var b=
|
79 |
-
b.ctrlKey||b.metaKey||b.altKey)return!0;a.selectNext(c);b.stopPropagation();b.preventDefault();return!1}}function
|
80 |
-
a||0;this.length=b.length}function
|
81 |
-
|
82 |
-
[],b=a.length;0!==b--;)a[b].destroy();this.pages=[];this.sy=this.mx=this.mn=this.vh=null;void 0;return this};
|
83 |
-
this.redrawDirty();this.redraw();null==
|
84 |
-
b.scrollTop,b=b.clientHeight;this.sy!==c&&(a=!0,this.sy=c);this.vh!==b&&(a=!0,this.vh=b);return a};
|
85 |
-
|
86 |
-
(
|
87 |
-
this.w.cells[1];
|
88 |
-
function(a){this._idxs||(this._idxs=this.idxs);this.idxs=this._sort(a);return this.clear().render()};
|
89 |
-
function(a,b){b?(this.s=b,b(a)):(b=this.s)&&b(a);return a};
|
90 |
-
return this};
|
91 |
-
this.rendered=!0;return this};
|
92 |
-
|
93 |
-
d;c++)
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
return b};
|
98 |
-
return this};
|
99 |
-
this.rtl);
|
100 |
-
(
|
101 |
-
function(a){for(var b=-1,c=0,
|
102 |
-
this.field.editable()?a.push("is-editable"):a.push("is-readonly"));a=a.join(" ");a!==this._css&&(this._css=a,this.el.className=a);return this};
|
103 |
-
(
|
104 |
-
b);d!==b&&this.restyle()}else this.length&&this.clear(),d=
|
105 |
-
b,
|
106 |
-
this.body;if(a.nodeType){var c=b.firstChild;
|
107 |
-
a||"",b;this.header(a);return this.t};
|
108 |
-
|
109 |
-
|
110 |
-
b.push("po-empty"),a.comment()&&b.push("po-comment"));return b.join(" ")}function d(a,b,c){b=
|
111 |
-
"number.js");var a="poUpdate",
|
112 |
-
|
113 |
-
a._x("Suggest translation","Editor");this.labels=b;this.t=a;return this};
|
114 |
-
return!0}).on("wgRowDeselect",function(a,c,
|
115 |
-
return this};
|
116 |
-
this.getContextEditable()};
|
117 |
-
this.po.length;c?
|
118 |
-
this.po;if(this.dirty||a)b.each(function(a,b){b.save()}),this.listCell.find("div.po-unsaved").removeClass("po-unsaved"),this.dirty=0,this.fire("poSave");return b};
|
119 |
-
|
120 |
-
b&&
|
121 |
-
this.updateListCell(a,"source");this.updateListCell(a,"target");return this};
|
122 |
-
|
123 |
-
c(this,
|
124 |
-
function(b){function c(a,b){var
|
125 |
-
c(
|
126 |
-
a.eachTextarea(function(a){a.ping()});a.off();var
|
127 |
-
|
128 |
-
(
|
129 |
-
|
130 |
-
|
131 |
-
a.textarea("",!1);if(a=this.sourceCell)a.textarea("",!1).setStrf(d).setMode(c).setInvs(
|
132 |
-
|
133 |
-
[b,d,c,
|
134 |
-
this.rebuildSearch(),this.active&&this.active.equals(b)&&this.unloadActive(),this.po.length&&(c&&this.filter(c),this.active||(
|
135 |
-
|
136 |
-
this.sourceLocale={lang:"en",label:"English",plurals:["One","Other"]}}function d(a){a=
|
137 |
-
"base.js");g.init=function(a){var b=new
|
138 |
-
b=[a._x("Source text","Editor")];this.targetLocale&&(b[1]=a._x("Translation","Editor"));return b};
|
139 |
-
function(){var a=this.po,b=a.length,c=0,d=0,e=0;a.each(function(a,b){b.fuzzy()?e++:b.translated()?c++:d++});return{t:b,p:c.percent(b)+"%",f:e,u:d}};
|
140 |
-
a&&(this.targetLocale=a,delete this._unlocked,this.po&&this.po.lock(a),this.editable={source:!1,context:!1,target:!0},this.targetCell=this.contextCell,delete this.contextCell,this.reload(),this.fire("poLock",[!0,a]),this.active&&this.loadMessage(this.active))};
|
141 |
-
[];a.translated()?a.fuzzy()&&
|
142 |
-
40:!0,73:!0},c={66:function(b,a){var c=a.current();c&&(c.normalize(),a.focus().pasteMessage(c))},75:function(b,a){var c=a.current();c&&(c.untranslate(),a.focus().pasteMessage(c))},85:function(b,a){a.focus().fuzzy(!a.fuzzy())},13:function(b,a){a.getFirstEditable()&&a.next(1,!0,!0)},40:function(b,a){var c=b.shiftKey;a.next(1,c,c)},38:function(b,a){var c=b.shiftKey;a.next(-1,c,c)},73:function(b,a){if(!b.shiftKey)return!1;a.setInvs(!a.getInvs())}};g.init=function(b,a){function
|
143 |
-
!a.metaKey&&!a.ctrlKey)return!0;var
|
144 |
-
g.init=function(){return new
|
145 |
-
this.length++);this[b]=c;return b};
|
146 |
-
b){return d(a[0],b[0])});for(c=0;c<b;c++)a=g[c],this[c]=a[0],a=a[1],f[c]=a,
|
147 |
-
a,f=/(?:\r\n|[\r\n\v\f\u2028\u2029])/g,
|
148 |
-
return
|
149 |
-
|
150 |
-
|
151 |
-
b?b:-1!==f?(c=(c||0)+1,d.source("Error, duplicate "+String(c)+": "+d.source()),this.reIndex(d,c)):this.rows.key(b,a)};
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
"
|
162 |
-
|
163 |
-
|
164 |
-
a
|
165 |
-
f)
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
d.getUrl=function(){return"https://
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
b.
|
188 |
-
b
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
g++}),k("tr",w).each(function(a,b){var c,g,h,k=[],l={_:a,$:b},m=b.getElementsByTagName("td");for(g in f){c=m[g];(h=c.textContent.replace(/(^\s+|\s+$)/g,""))&&k.push(h);c.hasAttribute("data-sort-value")&&(h=c.getAttribute("data-sort-value"));switch(f[g].type){case "n":h=Number(h)}l[g]=h}d[a]=l;B.index(a,k)}),a=k('form.loco-filter input[type="text"]',a.parentNode),a.length&&(a=a[0],v=k(a.form),1<d.length?n.require("$11","LocoTextListener.js").listen(a,c):v.hide(),v.on("submit",function(a){a.preventDefault();
|
197 |
-
return!1})))};return g}({},v,u));var C=v.loco||{},I=C.conf||{$v:[0,0]};v=n.require("$1","t.js").init();u=I.wplang;C.version=function(g){return I.$v[g||0]};n.require("$2","html.js");n.require("$3","number.js");n.require("$4","array.js");n.require("$5","json.js");C.l10n=v;v.load(I.wpl10n);u&&v.pluraleq(u.pluraleq);C.string=n.require("$6","string.js");C.notices=n.require("$7","notices.js").init(v);C.ajax=n.require("$8","ajax.js").init(I).localise(v);C.locale=n.require("$9","wplocale.js");C.fulltext=
|
198 |
-
n.require("$10","fulltext.js");C.watchtext=n.require("$11","LocoTextListener.js").listen;C.tooltip=n.require("$12","tooltip.js");C.po={ed:n.require("$13","poedit.js"),kbd:n.require("$14","hotkeys.js"),init:n.require("$15","po.js").create,ace:n.require("$16","ace.js").strf("php"),ref:n.require("$17","refs.js")};C.apis=n.require("$18","apis.js");C.fs=n.require("$19","fsconn.js");k("#loco-admin.wrap table.wp-list-table").each(function(g,f){n.require("$20","tables.js").init(f)});C.validate=function(g){return"2.4.4"!==
|
199 |
-
(/^\d+\.\d+\.\d+/.exec(g&&g[0]||"")&&RegExp.lastMatch)?(C.notices.warn("admin.js is the wrong version (2.4.4). Please empty all relevant caches and reload this page."),!1):!0}})(window,document,window.jQuery);
|
1 |
+
(function(v,x,h,J){var m=function(){function g(e){throw Error("Failed to require "+e);}var e={};return{register:function(g,l){e[g]=l},require:function(h,l){return e[h]||g(l)},include:function(h,l,d){return e[h]||(d?g(l):null)}}}();m.register("$1",function(g,e,h){function l(d){var c=typeof d;if("string"===c)if(/[^ <>!=()%^&|?:n0-9]/.test(d))console.error("Invalid plural: "+d);else return new Function("n","return "+d);"function"!==c&&(d=function(b){return 1!=b});return d}g.init=function(d){function c(a,
|
2 |
+
f,c){return(a=b[a])&&a[c]?a[c]:f||""}d=l(d);var b={};return{_:function(a){return c(a,a,0)},_x:function(a,b){return c(b+"\u0004"+a,a,0)},_n:function(a,b,n){n=Number(d(n));isNaN(n)&&(n=0);return c(a,n?b:a,n)},load:function(a){b=a||{};return this},pluraleq:function(a){d=l(a);return this}}};return g}({},v,x));m.register("$2",function(g,e,h){g.ie=function(){var l=!1,d=0;e.attachEvent&&e.navigator&&/MSIE (\d+)\./.exec(String(navigator.appVersion))&&(d=Number(RegExp.$1),l=11>d);return function(){return l}}();
|
3 |
+
g.init=function(){return g};return g}({},v,x));m.register("$3",function(g,e,h){Number.prototype.format=function(e){e=Math.pow(10,e||0);var d=Math.round(e*this)/e;e=[];var d=String(d),c=d.split("."),d=c[0],c=c[1],b=d.length;do e.unshift(d.substring(b-3,b));while(0<(b-=3));d=e.join(",");if(e=c){e=c;for(var a,c=e.length;"0"===e.charAt(--c);)a=c;a&&(e=e.substring(0,a));e=c=e}e&&(d+="."+c);return d};Number.prototype.percent=function(e){var d=0,c=this&&e?100*(this/e):0;if(0===c)return"0";if(100===c)return"100";
|
4 |
+
if(99<c)c=Math.min(c,99.9),e=c.format(++d);else if(0.5>c){c=Math.max(c,1E-4);do e=c.format(++d);while("0"===e&&4>d);e=e.substr(1)}else e=c.format(0);return e};return g}({},v,x));m.register("$4",function(g,e,h){Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var d,c=Object(this),b=c.length>>>0;if(0===b)return-1;d=0;1<arguments.length&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&Infinity!=d&&-Infinity!=d&&(d=(0<d||-1)*Math.floor(Math.abs(d))));if(d>=b)return-1;
|
5 |
+
for(d=0<=d?d:Math.max(b-Math.abs(d),0);d<b;d++)if(d in c&&c[d]===e)return d;return-1});return g}({},v,x));m.register("$5",function(g,e,m){e.JSON||(e.JSON={parse:h.parseJSON,stringify:null});return g=e.JSON}({},v,x));m.register("$6",function(g,e,h){g.trim=function(e,d){for(d||(d=" \n");e&&-1!==d.indexOf(e.substr(0,1));)e=e.substr(1);for(;e&&-1!==d.indexOf(e.substr(-1));)e=e.substr(0,e.length-1);return e};g.sprintf=function(e){var d=0,c,b=[].slice.call(arguments,1);return e.replace(/%([sud%])/g,function(a,
|
6 |
+
f){if("%"===f)return"%";c=b[d++];return String(c)||""})};return g}({},v,x));m.register("$21",function(g,e,h){function l(d){return function(c,b){for(var a=c[d]||0;(c=c.offsetParent)&&c!==(b||h.body);)a+=c[d]||0;return a}}g.top=l("offsetTop");g.left=l("offsetLeft");g.el=function(d,c){var b=h.createElement(d||"div");c&&(b.className=c);return b};g.txt=function(d){return h.createTextNode(d||"")};return g}({},v,x));m.register("$7",function(g,e,E){function l(a,b,c){function s(){f();w=setTimeout(b,c)}function f(){w&&
|
7 |
+
clearTimeout(w);w=null}var w;s();h(a).mouseenter(f).mouseleave(s);return{die:function(){f();h(a).off("mouseenter mouseleave")}}}function d(a,b){a.fadeTo(b,0,function(){a.slideUp(b,function(){a.remove();h(e).triggerHandler("resize")})});return a}function c(a,b){function c(b){r[w]=null;d(h(a),250);f&&f.die();var s;if(s=b)b.stopPropagation(),b.preventDefault(),s=!1;return s}function s(b){f&&f.die();return f=l(a,c,b)}var f,w,n,k=h(a),q=k.find("button");0===q.length&&(k.addClass("is-dismissible"),q=h('<button type="button" class="notice-dismiss"> </a>').appendTo(k));
|
8 |
+
q.off("click").click(c);h(e).triggerHandler("resize");z();w=r.length;r.push(c);b&&(f=s(b));return{link:function(b,w){var f=w||b,s=h(a).find("nav"),f=h("<nav></nav>").append(h("<a></a>").attr("href",b).text(f));n?(n.push(f.html()),s.html(n.join("<span> | </span>"))):(n=[f.html()],h(a).addClass("has-nav").append(f));return this},stick:function(){f&&f.die();f=null;r[w]=null;return this},slow:function(a){s(a||1E4);return this}}}function b(a,b,f){var s=m.require("$21","dom.js").el;a=h('<div class="notice notice-'+
|
9 |
+
a+' loco-notice inline"></div>').prependTo(h("#loco-notices"));var c=h(s("p"));f=h(s("span")).text(f);b=h(s("strong","has-icon")).text(b+": ");c.append(b).append(f).appendTo(a);return a}function a(a,f,s,n){a=b(s,f,a).css("opacity","0").fadeTo(500,1);h(e).triggerHandler("resize");return c(a,n)}function f(b){return a(b,q,"warning")}function n(){h("#loco-notices").find("div.notice").each(function(a,b){if(-1===b.className.indexOf("jshide")){var f=-1===b.className.indexOf("notice-success")?null:5E3;c(b,
|
10 |
+
f)}})}var r=[],k=e.console||{log:function(){}},z=Date.now||function(){return(new Date).getTime()},A,q,s,B;g.error=function(b){return a(b,A,"error")};g.warn=f;g.info=function(b){return a(b,s,"info")};g.success=function(b){return a(b,B,"success",5E3)};g.warning=f;g.log=function(){k.log.apply(k,arguments)};g.debug=function(a,b){(k.error||k.log)("Loco: "+a);b&&k.log(b)};g.clear=function(){for(var a=-1,b,f=r,s=f.length;++a<s;)(b=f[a])&&b.call&&b();r=[];return g};g.create=b;g.raise=function(a){(g[a.type]||
|
11 |
+
g.error).call(g,a.message)};g.convert=c;g.init=function(a){A=a._("Error");q=a._("Warning");s=a._("Notice");B=a._("OK");setTimeout(n,1E3);return g};return g}({},v,x));m.register("$8",function(g,e,E){function l(a){var b=h("<pre>"+a+"</pre>").text();b&&(b=b.replace(/[\r\n]+/g,"\n").replace(/(^|\n)\s+/g,"$1").replace(/\s+$/,""));b||(b=a)||(b="Blank response from server");return b}function d(a){return(a=a.split(/[\r\n]/)[0])?(a=a.replace(/ +in +\S+ on line \d+/,""),a=a.replace(/^[()! ]+Fatal error:\s*/,
|
12 |
+
"")):t._("Server returned invalid data")}function c(a){e.console&&console.error&&console.error('No nonce for "'+a+'"');return""}function b(a,b,f){a[b]=f}function a(a,b,f){a.push({name:b,value:f})}function f(a,b,f){a.append(b,f)}function n(a,b,f,c){function n(b,c,w){if("abort"!==c){var s=k||{_:function(a){return a}},y=b.status,e=b.responseText,p=l(e),g=b.getResponseHeader("Content-Type")||"text/html",A=b.getResponseHeader("Content-Length")||e.length;"success"===c&&w?r.error(w):(r.error(d(p)+".\n"+
|
13 |
+
s._("Check console output for debugging information")),r.debug("Ajax failure for "+a,{status:y,error:c,message:w,output:e}),"parsererror"===c&&(w="Response not JSON"),r.log([s._("Provide the following text when reporting a problem")+":","----","Status "+y+' "'+(w||s._("Unknown error"))+'" ('+g+" "+A+" bytes)",p,"===="].join("\n")));f&&f.call&&f(b,c,w);z=b}}c.url=A;c.dataType="json";var r=m.require("$7","notices.js").clear();z=null;return h.ajax(c).fail(n).done(function(a,f,w){var c=a&&a.data,k=a&&
|
14 |
+
a.notices,d=k&&k.length;for(!c||a.error?n(w,f,a&&a.error&&a.error.message):b&&b(c,f,w);d--;)r.raise(k[d])})}var r={},k,z,A=e.ajaxurl||"/wp-admin/admin-ajax.php";g.init=function(a){r=a.nonces||r;return g};g.localise=function(a){k=a;return g};g.xhr=function(){return z};g.strip=l;g.parse=d;g.submit=function(a,b,f){function c(a,b){b.disabled?b.setAttribute("data-was-disabled","true"):b.disabled=!0}function k(a,b){b.getAttribute("data-was-disabled")||(b.disabled=!1)}function r(a){a.find(".button-primary").removeClass("loading");
|
15 |
+
a.find("button").each(k);a.find("input").each(k);a.find("select").each(k);a.find("textarea").each(k);a.removeClass("disabled loading")}var d=h(a),z=d.serialize();(function(a){a.find(".button-primary").addClass("loading");a.find("button").each(c);a.find("input").each(c);a.find("select").each(c);a.find("textarea").each(c);a.addClass("disabled loading")})(d);return n(a.route.value,function(a,f,c){r(d);b&&b(a,f,c)},function(a,b,c){r(d);f&&f(a,b,c)},{type:a.method,data:z})};g.post=function(k,s,d,z){var y=
|
16 |
+
!0,G=s||{},C=r[k]||c(k);e.FormData&&G instanceof FormData?(y=!1,s=f):s=Array.isArray(G)?a:b;s(G,"action","loco_json");s(G,"route",k);s(G,"loco-nonce",C);return n(k,d,z,{type:"post",data:G,processData:y,contentType:y?"application/x-www-form-urlencoded; charset=UTF-8":!1})};g.get=function(a,b,f,k){b=b||{};var d=r[a]||c(a);b.action="loco_json";b.route=a;b["loco-nonce"]=d;return n(a,f,k,{type:"get",data:b})};g.setNonce=function(a,b){r[a]=b;return g};return g}({},v,x));m.register("$22",{arab:1,aran:1,
|
17 |
+
hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});m.register("$9",function(g,e,h){function l(){}var d,c=m.require("$22","rtl.json");g.init=function(){return new l};g.cast=function(b){return b instanceof l?b:"string"===typeof b?g.parse(b):g.clone(b)};g.clone=function(b){var a,f=new l;for(a in b)f[a]=b[a];return f};g.parse=function(b){if(!(d||
|
18 |
+
(d=/^([a-z]{2,3})(?:[-_]([a-z]{2}))?(?:[-_]([a-z0-9]{3,8}))?$/i)).exec(b))return null;var a=new l;a.lang=RegExp.$1.toLowerCase();if(b=RegExp.$2)a.region=b.toUpperCase();if(b=RegExp.$3)a.variant=b.toLowerCase();return a};e=l.prototype;e.isValid=function(){return!!this.lang};e.isKnown=function(){var b=this.lang;return!(!b||"zxx"===b)};e.toString=function(b){b=b||"_";var a,f=this.lang||"zxx";if(a=this.region)f+=b+a;if(a=this.variant)f+=b+a;return f};e.getIcon=function(){for(var b=3,a,f,c=["variant",
|
19 |
+
"region","lang"],d=[];0!==b--;)if(a=c[b],f=this[a])d.push(a),d.push(a+"-"+f.toLowerCase());return d.join(" ")};e.isRTL=function(){return!!c[String(this.lang).toLowerCase()]};e=null;return g}({},v,x));m.register("$23",{"\u00e1":"a","\u00e0":"a","\u0103":"a","\u1eaf":"a","\u1eb1":"a","\u1eb5":"a","\u1eb3":"a","\u00e2":"a","\u1ea5":"a","\u1ea7":"a","\u1eab":"a","\u1ea9":"a","\u01ce":"a","\u00e5":"a","\u01fb":"a","\u00e4":"a","\u01df":"a","\u00e3":"a","\u0227":"a","\u01e1":"a","\u0105":"a","\u0101":"a",
|
20 |
"\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c","\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e",
|
21 |
"\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e","\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i",
|
22 |
"\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j","\u1e31":"k","\u01e9":"k","\u0137":"k","\ua7a3":"k","\u1e33":"k","\u1e35":"k","\u013a":"l","\u013e":"l","\u013c":"l","\u0142":"l","\u1e37":"l","\u1e39":"l","\u1e3d":"l","\u1e3b":"l","\u0140":"l","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0144":"n","\u01f9":"n","\u0148":"n","\u00f1":"n","\u1e45":"n","\u0146":"n","\ua7a5":"n",
|
28 |
"\u1f25":"\u03b7","\u1f95":"\u03b7","\u1f23":"\u03b7","\u1f93":"\u03b7","\u1f27":"\u03b7","\u1f97":"\u03b7","\u1f91":"\u03b7","\u03ae":"\u03b7","\u1f75":"\u03b7","\u1fc4":"\u03b7","\u1f74":"\u03b7","\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9",
|
29 |
"\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf","\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5",
|
30 |
"\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9","\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9",
|
31 |
+
"\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});m.register("$10",function(g,e,h){g.init=function(){function e(a){return k[a]||a}function d(a,b,f,c){b=a.split(b);for(var n=b.length;0!==n--;)(a=b[n])&&null==c[a]&&(f.push(a),c[a]=!0);return f}function c(a){return d(String(a||"").toLowerCase().replace(n,e),r,[],{})}function b(a,b){for(var c=[],s={},k,
|
32 |
+
p=b.length,y=r;0!==p--;)(k=b[p])&&d(String(k||"").toLowerCase().replace(n,e),y,c,s);f[a]=c}function a(a,b){var c=[],s=-1,n=f,k=n.length,d,r,e,u,w,F,g=a.length,l=b?!0:!1;a:for(;++s<k;)if(e=n[s],null!=e&&(u=e.length)){w=0;b:for(;w<g;w++){F=a[w];for(d=0;d<u;d++)if(r=e[d],0===r.indexOf(F))continue b;continue a}c.push(l?b[s]:s)}return c}var f=[],n=/[^a-z0-9]/g,r=/[\-_\s.?!;:,*^+=~`"(){}<>\[\]\/\\\u00a0\u1680\u180e\u2000-\u206f\u2e00-\u2e7f\u3000-\u303f]+/,k=m.require("$23","flatten.json");return{split:c,
|
33 |
+
pull:function(b,f){return a(b,f)},find:function(b,f){return a(c(b),f)},add:function(a,b){f[a]=c(b)},push:function(a){b(f.length,a)},index:function(a,f){b(a,f)},size:function(){return f.length},clear:function(){f=[]},remove:function(a){f[a]=null}}};return g}({},v,x));m.register("$11",function(g,e,m){g.listen=function(g,d){function c(){q[n?"show":"hide"]()}function b(a){A&&g.setAttribute("size",2+a.length);n=a;c();return a}function a(){r=null;d(n)}function f(){var f=g.value;z&&f===z&&(f="");f!==n&&
|
34 |
+
(r&&clearTimeout(r),b(f),k?r=setTimeout(a,k):a())}g instanceof jQuery&&(g=g[0]);var n,r,k=150,z=e.attachEvent&&g.getAttribute("placeholder"),A=1===Number(g.size),q=h('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(){g.value="";f();return!1});b(g.value);h(g).on("input blur focus",function(){f();return!0}).after(q);c();return{delay:function(a){k=a},ping:function(c){c?(r&&clearTimeout(r),c=g.value,z&&c===z&&(c=""),b(c),a(),c=void 0):c=f();return c},val:function(a){if(null==
|
35 |
+
a)return n;r&&clearTimeout(r);g.value=b(a);c()},el:function(){return g},blur:function(a){return h(g).on("blur",a)},destroy:function(){r&&clearTimeout(r)}}};return g}({},v,x));m.register("$12",function(g,e,m){function l(b,a){this.$element=h(b);this.options=a;this.enabled=!0;this.fixTitle()}g.init=function(b,a){var f={fade:!0,offset:5,delayIn:d,delayOut:c,anchor:b.attr("data-anchor"),gravity:b.attr("data-gravity")||"s"};a&&(f=h.extend({},f,a));b.tipsy(f)};g.delays=function(b,a){d=b||150;c=a||100};g.kill=
|
36 |
+
function(){h("div.tipsy").remove()};g.text=function(b,a){a.data("tipsy").setTitle(b)};var d,c;g.delays();h(m.body).on("overlayOpened overlayClosing",function(b){g.kill();return!0});l.prototype={show:function(){var b=this.getTitle();if(b&&this.enabled){var a=this.tip();a.find(".tipsy-inner")[this.options.html?"html":"text"](b);a[0].className="tipsy";a.remove().css({top:0,left:0}).prependTo(m.body);var b=(b=this.options.anchor)?this.$element.find(b):this.$element,b=h.extend({},b.offset(),{width:b[0].offsetWidth,
|
37 |
+
height:b[0].offsetHeight}),f=a[0].offsetWidth,c=a[0].offsetHeight,d="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,k;switch(d.charAt(0)){case "n":k={top:b.top+b.height+this.options.offset,left:b.left+b.width/2-f/2};break;case "s":k={top:b.top-c-this.options.offset,left:b.left+b.width/2-f/2};break;case "e":k={top:b.top+b.height/2-c/2,left:b.left-f-this.options.offset};break;case "w":k={top:b.top+b.height/2-c/2,left:b.left+b.width+this.options.offset}}2==
|
38 |
+
d.length&&("w"==d.charAt(1)?k.left=b.left+b.width/2-15:k.left=b.left+b.width/2-f+15);a.css(k).addClass("tipsy-"+d);a.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+d.charAt(0);this.options.className&&a.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);a.addClass("in")}},hide:function(){this.tip().remove()},fixTitle:function(){var b=this.$element,a=b.attr("title")||"";(a||"string"!==typeof b.attr("original-title"))&&
|
39 |
+
b.attr("original-title",a).removeAttr("title")},getTitle:function(){var b,a=this.$element,f=this.options;this.fixTitle();"string"==typeof f.title?b=a.attr("title"==f.title?"original-title":f.title):"function"==typeof f.title&&(b=f.title.call(a[0]));return(b=(""+b).replace(/(^\s*|\s*$)/,""))||f.fallback},setTitle:function(b){var a=this.$element;a.attr("default-title")||a.attr("default-title",this.getTitle());null==b&&(b=a.attr("default-title")||this.getTitle());a.attr("original-title",b);if(this.$tip)this.$tip.find(".tipsy-inner")[this.options.html?
|
40 |
+
"html":"text"](b)},tip:function(){this.$tip||(this.$tip=h('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.hide();this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}};h.fn.tipsy=function(b){function a(a){var f=
|
41 |
+
h.data(a,"tipsy");f||(f=new l(a,h.fn.tipsy.elementOptions(a,b)),h.data(a,"tipsy",f));return f}function f(){var f=a(this),c=b.delayIn;f.hoverState="in";0==c?f.show():(f.fixTitle(),setTimeout(function(){"in"==f.hoverState&&f.show()},c))}function c(){var f=a(this),n=b.delayOut;f.hoverState="out";0==n?f.hide():(f.tip().removeClass("in"),setTimeout(function(){"out"==f.hoverState&&f.hide()},n))}b=h.extend({},h.fn.tipsy.defaults,b);b.live||this.each(function(){a(this)});if("manual"!=b.trigger){var d=b.live?
|
42 |
+
"live":"bind",k="hover"==b.trigger?"mouseleave":"blur";this[d]("hover"==b.trigger?"mouseenter":"focus",f)[d](k,c)}return this};h.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:0.8,title:"title",trigger:"hover",anchor:null};h.fn.tipsy.elementOptions=function(b,a){return h.metadata?h.extend({},a,h(b).metadata()):a};h.fn.tipsy.autoNS=function(){return h(this).offset().top>h(m).scrollTop()+h(e).height()/2?"s":"n"};h.fn.tipsy.autoWE=
|
43 |
+
function(){return h(this).offset().left>h(m).scrollLeft()+h(e).width()/2?"e":"w"};h.fn.tipsy.autoBounds=function(b,a){return function(){var f=a[0],c=1<a.length?a[1]:!1,d=h(m).scrollTop()+b,k=h(m).scrollLeft()+b,z=h(this);z.offset().top<d&&(f="n");z.offset().left<k&&(c="w");h(e).width()+h(m).scrollLeft()-z.offset().left<b&&(c="e");h(e).height()+h(m).scrollTop()-z.offset().top<b&&(f="s");return f+(c?c:"")}};return g}({},v,x));m.register("$36",function(g,e,h){"".localeCompare||(String.prototype.localeCompare=
|
44 |
+
function(){return 0});"".trim||(String.prototype.trim=function(){return m.require("$6","string.js").trim(this," \n\r\t")});g.html=function(){function e(){b=/[<>&]/g;a=/(\r\n|\n|\r)/g;f=/(?:https?):\/\/(\S+)/ig;n=location.hostname;e=null}function d(a){return"&#"+a.charCodeAt(0)+";"}function c(a,b){return'<a href="'+a+'" target="'+(b.indexOf(n)?"_blank":"_top")+'">'+b+"</a>"}var b,a,f,n;return function(n,k){e&&e();var z=n.replace(b,d);k&&(z=z.replace(f,c).replace(a,"<br />"));return z}}();return g}({},
|
45 |
+
v,x));m.register("$37",function(g,e,h){function l(){}var d,c,b=m.require("$22","rtl.json");g.init=function(){return new l};g.cast=function(a){return a instanceof l?a:"string"===typeof a?g.parse(a):g.clone(a)};g.clone=function(a){var b,c=new l;for(b in a)c[b]=a[b];return c};g.parse=function(a){d||(c=/[-_+]/,d=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(c).join("-");if(!d.exec(a))return null;var b=new l;b.lang=
|
46 |
+
RegExp.$1.toLowerCase();if(a=RegExp.$2)b.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)b.region=a.toUpperCase();if(a=RegExp.$4)b.variant=a.toLowerCase();if(a=RegExp.$5)b.extension=a;return b};e=l.prototype;e.isValid=function(){return!!this.lang};e.isKnown=function(){var a=this.lang;return!(!a||"zxx"===a)};e.toString=function(a){a=a||"-";var b,c=this.lang||"zxx";if(b=this.script)c+=a+b;if(b=this.region)c+=a+b;if(b=this.variant)c+=a+b;if(b=this.extension)c+=a+b;return c};
|
47 |
+
e.getIcon=function(){for(var a=4,b,c,d=["variant","region","script","lang"],k=[];0!==a--;)if(b=d[a],c=this[b])c.join&&(c=c.join("-")),1===a&&3===c.length?k.push("region-m49"):k=k.concat([b,b+"-"+c.toLowerCase()]);return k.join(" ")};e.isRTL=function(){return!!b[String(this.script||this.lang).toLowerCase()]};e=null;return g}({},v,x));m.register("$38",function(g,e,h){function l(a){e.console&&console.error&&console.error(a)}function d(){l("Method not implemented")}function c(){}function b(a){}c.prototype.toString=
|
48 |
+
function(){return"[Undefined]"};b.prototype._validate=function(a){var b,n,e=!0;for(b in this)n=this[b],n===d?(l(a+"."+b+"() must be implemented"),e=!1):n instanceof c&&(l(a+"."+b+" must be defined"),e=!1);return e};g.init=function(a,f){var n,e=new b;if(a)for(n=a.length;0!==n--;)e[a[n]]=d;if(f)for(n=f.length;0!==n--;)e[f[n]]=new c;return e};g.validate=function(a){var b=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(b||"Object")};return g}({},v,x));m.register("$49",function(g,
|
49 |
+
e,h){var l=e.requestAnimationFrame,d=e.cancelAnimationFrame,c=0;if(!l||!d)for(var b in{ms:1,moz:1,webkit:1,o:1})if(l=e[b+"RequestAnimationFrame"])if(d=e[b+"CancelAnimationFrame"]||e[b+"CancelRequestAnimationFrame"])break;l&&d||(l=function(b){var d=a();timeToCall=Math.max(0,16-(d-c));nextTime=d+timeToCall;timerId=e.setTimeout(function(){b(nextTime)},timeToCall);c=nextTime;return timerId},d=function(a){clearTimeout(a)});var a=Date.now||function(){return(new Date).getTime()};g.loop=function(a,b){function c(){e=
|
50 |
+
l(c,b);a(k++)}var k=0,e;c();return{stop:function(){e&&d(e);e=null}}};return g}({},v,x));m.register("$46",function(g,e,h){function l(a,c,f,d){if(b){var k=f;f=function(a){if((a.MSPOINTER_TYPE_TOUCH||"touch")===a.pointerType)return k(a)}}a.addEventListener(c,f,d);return{unbind:function(){a.removeEventListener(c,f,d)}}}function d(a){a.preventDefault();a.stopPropagation();return!1}var c,b=!!e.navigator.msPointerEnabled,a=b?"MSPointerDown":"touchstart",f=b?"MSPointerMove":"touchmove",n=b?"MSPointerUp":
|
51 |
+
"touchend";g.ok=function(a){null==c&&(c="function"===typeof h.body.addEventListener);c&&a&&a(g);return c};g.ms=function(){return b};g.dragger=function(b,c){function k(a){b.addEventListener(a,e[a],!1)}function s(a){b.removeEventListener(a,e[a],!1)}var e={};e[a]=function(b){r(b,function(f,d){d.type=a;c(b,d,g)});k(f);k(n);return!0};e[n]=function(a){s(f);s(n);r(a,function(b,f){f.type=n;c(a,f,g)});return!0};e[f]=function(a){r(a,function(b,d){d.type=f;c(a,d,g)});return d(a)};k(a);var g={kill:function(){s(a);
|
52 |
+
s(f);s(n);b=g=c=null}};return g};g.swiper=function(c,e,g){function s(a){c.addEventListener(a,u[a],!1)}function B(a){c.removeEventListener(a,u[a],!1)}function p(){y&&y.stop();y=null}var y,G,C,u={},w=[],F=[],h=[];u[a]=function(a){G=!1;p();var b=k();r(a,function(a,c){w[a]=b;F[a]=c.clientX;h[a]=c.clientY});C=c.scrollLeft;return!0};u[n]=function(a){r(a,function(a,b){var c=k()-w[a],f=F[a]-b.clientX,c=Math.abs(f)/c;e(c,f?0>f?-1:1:0)});C=null;return!0};u[f]=function(a){var b,f;null==C||r(a,function(a,c){b=
|
53 |
+
F[a]-c.clientX;f=h[a]-c.clientY});if(f&&Math.abs(f)>Math.abs(b))return G=!0;b&&(G=!0,c.scrollLeft=Math.max(0,C+b));return d(a)};if(!b||g)s(a),s(f),s(n),b&&(c.className+=" mstouch");return{kill:function(){B(a);B(f);B(n);p()},swiped:function(){return G},ms:function(){return b},snap:function(a){b&&!g&&(c.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+a+"px)",c.style["-ms-scroll-snap-type"]="mandatory",c.style["-ms-scroll-chaining"]="none")},scroll:function(a,b,f){p();var w=c.scrollLeft,d=a>w?
|
54 |
+
1:-1,k=Math[1===d?"min":"max"],e=Math.round(16*b*d);return y=m.require("$49","fps.js").loop(function(b){b&&(w=Math.max(0,k(a,w+e)),c.scrollLeft=w,a===w&&(p(),f&&f(w)))},c)}}};g.start=function(b,c){return l(b,a,c,!1)};g.move=function(a,b){return l(a,f,b,!1)};g.end=function(a,b){return l(a,n,b,!1)};var r=g.each=function(a,c){if(b)(a.MSPOINTER_TYPE_TOUCH||"touch")===a.pointerType&&c(0,a);else for(var f=-1,d=(a.originalEvent||a).changedTouches||[];++f<d.length;)c(f,d[f])},k=Date.now||function(){return(new Date).getTime()};
|
55 |
+
return g}({},v,x));m.register("$50",function(g,e,m){g.init=function(e){function d(){f.style.top=String(-e.scrollTop)+"px";return!0}function c(){var a=f;a.textContent=e.value;a.innerHTML=a.innerHTML.replace(/[ \t]/g,b).split(/(?:\n|\r\n?)/).join('<span class="eol crlf"></span>\r\n')+'<span class="eol eof"></span>';return!0}function b(a){return'<span class="x'+a.charCodeAt(0).toString(16)+'">'+a+"</span>"}var a=e.parentNode,f=a.insertBefore(m.createElement("div"),e);h(e).on("input",c).on("scroll",d);
|
56 |
+
h(a).addClass("has-mirror");f.className="ta-mirror";var n=e.offsetWidth-e.clientWidth;2<n&&(f.style.marginRight=String(n-2)+"px");c();d();return{kill:function(){h(e).off("input",c).off("scroll",d);a.removeChild(f);f=null;h(a).removeClass("has-mirror")}}};return g}({},v,x));m.register("$29",function(g,e,h){function l(b,a){for(var c=0,n=-1,r=a&&e[a],k=d[b]||[],g=k.length;++n<g;)callback=k[n],"function"===typeof callback&&(callback(r),c++);return c}var d={},c;g.load=function(b,a,c){function n(){g&&(clearTimeout(g),
|
57 |
+
g=null);A&&(A.onreadystatechange=null,A=A=A.onload=null);b&&(delete d[b],b=null)}function r(a,d){var k=A&&A.readyState;if(d||!k||"loaded"===k||"complete"===k)d||l(b,c),n()}function k(){if(0===l(b))throw Error('Failed to load "'+(c||b)+'"');n()}if(c&&e[c])"function"===typeof a&&a(e[c]);else if(null!=d[b])d[b].push(a);else{d[b]=[a];var g=setTimeout(k,4E3),A=h.createElement("script");A.setAttribute("src",b);A.setAttribute("async","true");A.onreadystatechange=r;A.onload=r;A.onerror=k;A.onabort=n;h.getElementsByTagName("head")[0].appendChild(A)}};
|
58 |
+
g.stat=function(b){var a;if(!(a=c)){for(var f,d,e=h.getElementsByTagName("script"),k=-1,g=e.length;++k<g;)if(a=e[k].getAttribute("src"))if(f=a.indexOf("/lib/vendor"),-1!==f){d=a.substr(0,f);break}a=c=d||"/static"}return a+b};return g}({},v,x));m.register("$16",function(g,e,E){function l(a,b){a.setReadOnly(!1);a.on("change",function(a,c){return b.val(c.getValue())});a.on("focus",function(){return b.focus()});a.on("blur",function(){return b.blur()})}function d(a){a.off("change");a.off("focus");a.off("blur")}
|
59 |
+
function c(a){d(a);a.setReadOnly(!0);a.setHighlightGutterLine(!1);a.setHighlightActiveLine(!1)}function b(b,c){function f(){this.HighlightRules=d}var d=a(c),e=b.require,n=e("ace/lib/oop");n.inherits(d,e("ace/mode/text_highlight_rules").TextHighlightRules);n.inherits(f,e("ace/mode/text").Mode);return new f}function a(a){return function(){var b={start:[{token:"empty_line",regex:/^$/},{token:"constant.language",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"constant.language",
|
60 |
+
regex:/<!\[CDATA\[/},{token:"constant.language",regex:/\]\]>/},{token:"locked",regex:/<(?:xliff:)?(?:g|ph)[^>]*>[^<]*<\/(?:xliff:)?(?:g|ph)>/},{token:"locked",regex:/<(?:xliff:)?(bx|ex|x)[^\/>]*\/>/},{token:"constant.language",regex:/<\/?[:a-z]+[^>]*>/}]},c=f(a);"icu"===a?b={start:b.start.concat([{token:"icu-quoted",regex:/'([{}][^']*)?'/},{token:"printf",regex:"{[^!-/:-@\\[-^{-~\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a9\u00ab\u00ac\u00ae\u00b0\u00b1\u00b6\u00bb\u00bf\u00d7\u00f7\\u2010-\\u2027\\u2030-\\u203E\\u2041-\\u2053\\u2055-\\u205E\\u2190-\\u245F\\u2500-\\u2775\\u2794-\\u2BFF\\u2E00-\\u2E7F\\u3001-\\u3003\\u3008-\\u3020\\u3030\\uFD3E\\uFD3F\\uFE45\\uFE46]+(,[\\s\\u0085\\u200E\\u200F\\u2028\\u2029]*(?:number|date|time|spellout|ordinal|duration)[\\s\\u0085\\u200E\\u200F\\u2028\\u2029]*(,[\\s\\u0085\\u200E\\u200F\\u2028\\u2029]*[^{}]+)?)?}"},
|
61 |
{token:"icu",regex:/{/,next:"icuName"},{token:"icu",regex:/}/,next:"icuType"}]),icuName:[{token:"icu",regex:"[\\s\\u0085\\u200E\\u200F\\u2028\\u2029]+"},{token:"icu.name",regex:"[^\\s\\u0085\\u200E\\u200F\\u2028\\u2029!-/:-@\\[-^{-~\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a9\u00ab\u00ac\u00ae\u00b0\u00b1\u00b6\u00bb\u00bf\u00d7\u00f7\\u2010-\\u2027\\u2030-\\u203E\\u2041-\\u2053\\u2055-\\u205E\\u2190-\\u245F\\u2500-\\u2775\\u2794-\\u2BFF\\u2E00-\\u2E7F\\u3001-\\u3003\\u3008-\\u3020\\u3030\\uFD3E\\uFD3F\\uFE45\\uFE46]+",
|
62 |
+
next:"icuType"},{defaultToken:"icu",next:"icuType"}],icuType:[{token:"icu",regex:/[{}]/,next:"start"},{defaultToken:"icu"}]}:c&&b.start.push({token:"printf",regex:c});this.$rules=b}}function f(a){switch(a){case "objc":return/%(?:\d+\$)?[-+'0# ]*\d*(?:\.\d+|\.\*(?:\d+\$)?)?(?:hh?|ll?|[qjzTL])?[sScCdDioOuUxXfFeEgGaAp%@]/;case "java":return/%(?:\d+\$)?[-+,(0# ]*\d*(?:\.\d+)?(?:[bBhHsScCdoxXeEfgGaA%n]|[tT][HIklMSLNpzZsQBbhAaCYyjmdeRTrDFc])/;case "php":return/%(?:\d+\$)?(?:'.|[-+0 ])*\d*(?:\.\d+)?[suxXbcdeEfFgGo%]/;
|
63 |
+
case "python":return/%(?:\([a-z]+\))?[-+0# ]*(?:\d+|\*)?(?:\.\d+|\.\*)?(?:[hlL])?[sdiouxXeEfFgGcra%]/;case "javascript":return/%(?:[1-9]\d*\$)?\+?(?:0|'[^$])?-?\d*(?:\.\d+)?[b-gijostTuvxX%]/;case "auto":return/%(?:\d+\$|\([a-z]+\))?(?:[-+0]?\d*(\.\d+)?[duxoefgaDUXOEFGA]|[@scSC%])/;case r:return n||"%%"}}var n,r="auto";g.init=function(a,f,n){var g,s=!1,B=n||r,p=a.parentNode,y=p.appendChild(E.createElement("div"));h(p).addClass("has-proxy has-ace");m.require("$29","remote.js").load("https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ace.js",
|
64 |
+
function(d){if(y){if(!d)throw Error("Failed to load code editor");g=d.edit(y);var e=g.session,n=g.renderer;g.$blockScrolling=Infinity;g.setShowInvisibles(s);g.setWrapBehavioursEnabled(!1);g.setBehavioursEnabled(!1);g.setHighlightActiveLine(!1);e.setUseSoftTabs(!1);n.setShowGutter(!0);n.setPadding(10);n.setScrollMargin(8);e.setMode(b(d,B));g.setValue(a.value,-1);e.setUseWrapMode(!0);f?l(g,f):c(g)}},"ace");return{kill:function(){g&&(d(g),g.destroy(),g=null);y&&(p.removeChild(y),h(p).removeClass("has-proxy has-ace"),
|
65 |
+
y=null);return this},disable:function(){g&&c(g);f=null;return this},enable:function(a){f=a;g&&l(g,a);return this},resize:function(){g&&g.resize();return this},val:function(a){g&&a!==g.getValue()&&g.setValue(a,-1);return this},invs:function(a){a=a||!1;s!==a&&(s=a,g&&g.setShowInvisibles(a));return this},strf:function(a){a=a||r;a!==B&&(B=a,g&&g.session.setMode(b(e.ace,a)));return this},focus:function(){return this}}};g.strf=function(a,b){r=a;n=b;return g};return g}({},v,x));m.register("$51",function(g,
|
66 |
+
e,E){function l(a,b){function c(){return b.val(a.getContent())}a.on("input",c);a.on("change",c);a.on("focus",function(){return b.focus()});a.on("blur",function(){return b.blur()});a.setMode("design")}function d(a){a.off("input");a.off("change");a.off("focus");a.off("blur")}function c(a){d(a);a.setMode("readonly")}var b=0;g.load=function(a){var b=m.require("$29","remote.js");b.load(b.stat("/lib/tinymce.min.js"),a,"tinymce");return g};g.init=function(a,f){function e(a){A=a;q="<p>"===a.substr(0,3)&&
|
67 |
+
"</p>"===a.substr(-4);return a.replace(/(<\/?)script/ig,"$1loco:script")}function r(a){k=a;a._getContent=a.getContent;a.getContent=function(a){a=this._getContent(a);a=a.replace(/(<\/?)loco:script/ig,"$1script");if(!q&&"<p>"===a.substr(0,3)&&"</p>"===a.substr(-4)){var b=a.substr(3,a.length-7);if(b===A||-1===b.indexOf("</p>"))a=b}return a};a._setContent=a.setContent;a.setContent=function(a,b){return this._setContent(e(a),b)};f?(l(a,f),f.reset()):c(a);h(p).removeClass("loading")}var k,z=!1,A="",q=!1,
|
68 |
+
s=a.parentNode,B=s.parentNode,p=s.appendChild(E.createElement("div")),y=B.insertBefore(E.createElement("nav"),s);y.id="_tb"+String(++b);h(s).addClass("has-proxy has-mce");h(p).addClass("mce-content-body loading").html(e(a.value));g.load(function(a){if(!a)throw Error("Failed to load HTML editor");p&&a.init({inline:!0,target:p,hidden_input:!1,theme:"modern",skin:!1,plugins:"link lists",browser_spellcheck:!0,menubar:!1,fixed_toolbar_container:"#"+y.id,toolbar:"formatselect | bold italic link unlink | bullist numlist outdent indent",
|
69 |
block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;",forced_root_block:"p",relative_urls:!1,convert_urls:!1,remove_script_host:!1,document_base_url:"",allow_script_urls:!1,formats:{alignleft:{classes:"alignleft"},alignright:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"alignright"},aligncenter:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"aligncenter"},strikethrough:{inline:"del"}},fix_list_elements:!0,extended_valid_elements:"span,b,i,u,loco:script",
|
70 |
+
entities:"38,amp,60,lt,62,gt,160,nbsp",entity_encoding:"named",keep_styles:!1,init_instance_callback:r})});return{val:function(b){b=e(b);null==k?(a.value=b,h(p).html(b)):k.getContent()!==b&&k.setContent(b);f&&f.val(b);return this},kill:function(){k&&(f&&f.val(k.getContent()),d(k),k.destroy(),k=null);p&&(s.removeChild(p),h(s).removeClass("has-proxy has-mce"),p=null);y&&(B.removeChild(y),y=null);return this},enable:function(a){f=a;k&&l(k,a);return this},disable:function(){k&&c(k);f=null;return this},
|
71 |
+
focus:function(){k&&f&&k.focus();return this},invs:function(a){a=a||!1;z!==a&&(z=a,h(s)[a?"addClass":"removeClass"]("show-invs"));return this}}};return g}({},v,x));m.register("$47",function(g,e,E){function l(b){function a(){g&&(l.off("input",f),g=!1)}function f(){var a=b.value;a!==s&&(l.trigger("changing",[a,s]),s=a)}function d(){f();g&&B!==s&&l.trigger("changed",[s])}function e(){c=b;B=s;g||(l.on("input",f),g=!0);l.trigger("editFocus");q.addClass("has-focus");return!0}function k(){c===b&&(c=null);
|
72 |
+
l.trigger("editBlur");q.removeClass("has-focus");g&&(d(),a());return!0}var g=!1,l=h(b),q=h(b.parentNode),s=b.value,B;l.blur(k).focus(e);return{val:function(a){s!==a&&(b.value=a,l.triggerHandler("input"),s=a);return!0},kill:function(){a();l.off("blur",k).off("focus",e)},fire:function(){s=null;f()},ping:d,blur:k,focus:e,reset:function(){B=s=b.value}}}function d(b){this.e=b}var c;g._new=function(b){return new d(b)};g.init=function(b){var a=new d(b);b.disabled?(b.removeAttribute("disabled"),a.disable()):
|
73 |
+
b.readOnly?a.disable():a.enable();return a};TextAreaPrototype=d.prototype;TextAreaPrototype.destroy=function(){this.unlisten();var b=this.p;b&&(b.kill(),this.p=null);this.e=null};TextAreaPrototype.reload=function(b,a){var c=this.l;c&&!a&&(this.disable(),c=null);this.val(b||"");a&&!c&&this.enable();return this};TextAreaPrototype.val=function(b){var a=this.e;if(null==b)return a.value;var c=this.l,d=this.p;d&&d.val(b);c&&c.val(b);c||a.value===b||(a.value=b,h(a).triggerHandler("input"));return this};
|
74 |
+
TextAreaPrototype.fire=function(){this.l&&this.l.fire();return this};TextAreaPrototype.ping=function(){this.l&&this.l.ping();return this};TextAreaPrototype.focus=function(){var b=this.p;b?b.focus():h(this.e).focus()};TextAreaPrototype.focused=function(){return c&&c===this.el};TextAreaPrototype.parent=function(){return this.e.parentNode};TextAreaPrototype.attr=function(b,a){var c=this.e;if(1===arguments.length)return c.getAttribute(b);null==a?c.removeAttribute(b):c.setAttribute(b,a);return this};TextAreaPrototype.editable=
|
75 |
+
function(){return!!this.l};TextAreaPrototype.enable=function(){var b=this.p;this.e.removeAttribute("readonly");this.listen();b&&b.enable&&b.enable(this.l);return this};TextAreaPrototype.disable=function(){var b=this.p;this.e.setAttribute("readonly",!0);this.unlisten();b&&b.disable&&b.disable();return this};TextAreaPrototype.listen=function(){var b=this.l;b&&b.kill();this.l=l(this.e);return this};TextAreaPrototype.unlisten=function(){var b=this.l;b&&(b.kill(),this.l=null);return this};TextAreaPrototype.setInvs=
|
76 |
+
function(b,a){var c=this.i||!1;if(a||c!==b)this._i&&(this._i.kill(),delete this._i),(c=this.p)?c.invs&&c.invs(b):b&&(this._i=m.require("$50","mirror.js").init(this.e)),this.i=b;return this};TextAreaPrototype.getInvs=function(){return this.i||!1};TextAreaPrototype.setMode=function(b){var a=this.p,f=this.i||!1;b!==(this.m||"")&&(this.m=b,a&&a.kill(),this.p=a="code"===b?m.require("$16","ace.js").init(this.e,this.l,this["%"]):"html"===b?m.require("$51","mce.js").init(this.e,this.l):null,this.setInvs(f,
|
77 |
+
!0),c&&this.focus());return this};TextAreaPrototype.setStrf=function(b){this["%"]=b;"code"===this.m&&this.p.strf(b);return this};TextAreaPrototype.name=function(b){this.e.setAttribute("name",b);return this};TextAreaPrototype.placeholder=function(b){this.e.setAttribute("placeholder",b);return this};TextAreaPrototype.redraw=function(){var b=this.p;b&&b.resize&&b.resize()};TextAreaPrototype=null;return g}({},v,x));m.register("$48",function(g,e,m){function l(a){var b=e.console;b&&b.error&&b.error(a)}
|
78 |
+
function d(a){var b=m.createElement("div");a&&b.setAttribute("class",a);return b}function c(a){return function(){a.resize();return this}}function b(a){return function(b){for(var c=b.target,f=c.$index;null==f&&"DIV"!==c.nodeName&&(c=c.parentElement);)f=c.$index;null!=f&&(b.stopImmediatePropagation(),a.select(f));return!0}}function a(a){return function(){a.redrawDirty()&&a.redraw();return!0}}function f(a){return function(b){var c;c=b.keyCode;if(40===c)c=1;else if(38===c)c=-1;else return!0;if(b.shiftKey||
|
79 |
+
b.ctrlKey||b.metaKey||b.altKey)return!0;a.selectNext(c);b.stopPropagation();b.preventDefault();return!1}}function n(a,b,c){function f(a){l("row["+a+"] disappeared");return{cellVal:function(){return""}}}return function(d){var e=b||0,k=c?-1:1,w=a.rows||[];d.sort(function(a,b){return k*(w[a]||f(a)).cellVal(e).localeCompare((w[b]||f(b)).cellVal(e))})}}function r(a){this.w=a}function k(a){this.t=a;this.length=0}function z(a,b,c){var f=m.createElement("div");f.className=c||"";this._=f;this.d=b||[];this.i=
|
80 |
+
a||0;this.length=b.length}function A(a){this.live=a;this.rows=[]}g.create=function(a){return new r(a)};var q=r.prototype;q.init=function(e){var k=this.w,n=k.id,g=k.splity(n+"-thead",n+"-tbody"),r=g[0],g=g[1],C=[],u=[],w=[],F=[];if(e)this.ds=e,this.idxs=u,this._idxs=null;else if(!(e=this.ds))throw Error("No datasource");r.css.push("wg-thead");g.css.push("wg-tbody");e.eachCol(function(a,b,c){w[a]=n+"-col-"+b;F[a]=c||b});for(var N=d(),q=-1,l=w.length,m=d("wg-cols"),A=r.splitx.apply(r,w);++q<l;)A[q].header(F[q]),
|
81 |
+
m.appendChild(N.cloneNode(!1)).setAttribute("for",w[q]);e.eachRow(function(a,b,c){C[a]=new z(a,b,c);u[a]=a});this.rows=C;this.cols=m;this.ww=null;this.root=N=g.body;this.head=r;r.redraw=c(this);r=g.fixed=A[0].bodyY()||20;k.lock().resize(r,g);k.css.push("is-table");k.restyle();this.sc?this._re_sort(l):e.sort&&e.sort(u);this.redrawDirty();this.render();h(N).attr("tabindex","-1").on("keydown",f(this)).on("mousedown",b(this)).on("scroll",a(this));return this};q.clear=function(){for(var a=this.pages||
|
82 |
+
[],b=a.length;0!==b--;)a[b].destroy();this.pages=[];this.sy=this.mx=this.mn=this.vh=null;void 0;return this};q.render=function(){for(var a,b,c=[],f=this.rows||[],d=-1,e,k=this.idxs,w=k.length,n=this.idxr={},g=this.r,r=this._r,h=this.root,z=this.cols;++d<w;){0===d%100&&(a=z.cloneNode(!0),b=new A(a),b.h=2200,b.insert(h),c.push(b));e=k[d];n[e]=d;a=f[e];if(null==a)throw Error("Render error, no data at ["+e+"]");a.page=b;b.rows.push(a)}b&&100!==b.size()&&b.sleepH(22);this.pages=c;this.mx=this.mn=null;
|
83 |
+
this.redrawDirty();this.redraw();null==g?null!=r&&(a=f[r])&&a.page&&(delete this._r,this.select(r,!0)):(a=f[g])&&a.page?this.select(g,!0):(this.deselect(),this._r=g);return this};q.resize=function(){var a=-1,b=this.ww||(this.ww=[]),c=this.w,f=c.cells[0],d=f.body.childNodes,e=d.length,k=this.pages||[],w=k.length;for(c.redraw.call(f);++a<e;)b[a]=d[a].style.width;if(w){c=this.mx;for(a=this.mn;a<=c;a++)k[a].widths(b);this.redrawDirty()&&this.redraw()}};q.redrawDirty=function(){var a=!1,b=this.root,c=
|
84 |
+
b.scrollTop,b=b.clientHeight;this.sy!==c&&(a=!0,this.sy=c);this.vh!==b&&(a=!0,this.vh=b);return a};q.redraw=function(){for(var a=0,b=-1,c=null,f=null,d=this.ww,e=this.sy,k=this.vh,w=this.mn,n=this.mx,g=Math.max(0,e-100),e=k+e+100,r=this.pages||[],h=r.length;++b<h&&!(a>e);)k=r[b],a+=k.height(),a<g||(null===c&&(c=b),f=b,k.rendered||k.render(d));if(w!==c){if(null!==w&&c>w)for(b=w;b<c;b++){k=r[b];if(!k)throw Error("Shit!");k.rendered&&k.sleep()}this.mn=c}if(n!==f){if(null!==n&&f<n)for(b=n;b>f;b--)k=r[b],
|
85 |
+
k.rendered&&k.sleep();this.mx=f}};q.selected=function(){return this.r};q.thead=function(){return this.w.cells[0]};q.tbody=function(){return this.w.cells[1]};q.tr=function(a){return(a=this.row(a))?a.cells():[]};q.row=function(a){return this.rows[a]};q.td=function(a,b){return this.tr(a)[b]};q.next=function(a,b,c){null==c&&(c=this.r||0);var f=this.idxs,d=f.length,e=(this.idxr||{})[c];for(c=e;c!==(e+=a)&&!(0<=e&&d>e);)if(b&&d)e=1===a?-1:d,b=!1;else return null;c=f[e];return null==c||null==this.rows[c]?
|
86 |
+
(l("Bad next: ["+e+"] does not map to data row"),null):c};q.selectNext=function(a,b,c){a=this.next(a,b);null!=a&&this.r!==a&&this.select(a,c);return this};q.deselect=function(a){var b=this.r;null!=b&&(this.r=null,h(this.tr(b)).removeClass("selected"),this.w.fire("wgRowDeselect",[b,a]));return this};q.selectRow=function(a,b){return this.select(this.idxs[a])};q.select=function(a,b){var c=this.rows[a],f=c&&c.page;if(!f)return this.deselect(!1),l("Row is filtered out"),this;this.deselect(!0);var d,e=
|
87 |
+
this.w.cells[1];f.rendered||(d=f.top(),e.scrollY(d),this.redrawDirty()&&this.redraw());if(!c.rendered)return f.rendered||l("Failed to render page"),l("Row ["+c.i+"] not rendered"),this;f=c.cells();h(f).addClass("selected");this.r=a;b||(d=e.scrollY(),h(this.root).focus(),d!==e.scrollY()&&e.scrollY(d));e.scrollTo(f[0],!0);this.w.fire("wgRowSelect",[a,c.data()]);return this};q.unfilter=function(){this._idxs&&(this.idxs=this._sort(this._idxs),this._idxs=null,this.clear().render());return this};q.filter=
|
88 |
+
function(a){this._idxs||(this._idxs=this.idxs);this.idxs=this._sort(a);return this.clear().render()};q.each=function(a){for(var b,c=-1,f=this.rows||[],d=this.idxs||[],e=d.length;++c<e;)b=d[c],a(f[b],c,b);return this};q.sortable=function(a){var b=this.sc||(this.sc=new k(this));b.has(a)||b.add(a);return this};q._re_sort=function(a){var b=-1,c=this.sc,f=c.active;for(this.sc=c=new k(this);++b<a;)c.add(b);f&&(b=this.head.indexOf(f.id),-1===b&&(b=Math.min(f.idx,a-1)),this.sort(b,f.desc));return this};q._sort=
|
89 |
+
function(a,b){b?(this.s=b,b(a)):(b=this.s)&&b(a);return a};q.sort=function(a,b){this._sort(this.idxs,n(this,a,b));this.sc.activate(a,b);return this};q=null;q=k.prototype;q.has=function(a){return null!=this[a]};q.add=function(a){var b=this,c=b.t.head.cells[a];b[a]={desc:null,idx:a,id:c.id};b.length++;c.addClass("wg-sortable").on("click",function(c){if("header"===c.target.nodeName.toLowerCase())return c.stopImmediatePropagation(),b.toggle(a),!1});return b};q.toggle=function(a){this.t.sort(a,!this[a].desc).clear().render();
|
90 |
+
return this};q.activate=function(a,b){var c,f;c=this.active;var d=this[a],e=this.t.head.cells;c&&(f=e[c.idx])&&(f.removeClass(c.css),c!==d&&f.restyle());(f=e[a])?(d.desc=b,this.active=d,c="wg-"+(b?"desc":"asc"),f.addClass(c).restyle(),d.css=c):this.active=null;return this};q=null;q=z.prototype;q.render=function(a){var b,c=[],f=this._,d=this.length;if(f){for(this.c=c;0!==d--;)b=f.cloneNode(!1),c[d]=this.update(d,b),b.$index=this.i,a[d].appendChild(b);this._=null}else for(c=this.c;0!==d--;)a[d].appendChild(c[d]);
|
91 |
+
this.rendered=!0;return this};q.update=function(a,b){var c=b||this.c[a]||{},f=(this.d[a]||function(){})()||"\u00a0";null==f.innerHTML?c.textContent=f:c.innerHTML=f.innerHTML;return c};q.cells=function(){return this.c||[this._]};q.data=function(){for(var a=-1,b=[],c=this.length;++a<c;)b[a]=this.cellVal(a);return b};q.destroy=function(){this.page=null;this.rendered=!1};q.cellVal=function(a){a=this.d[a]()||"";return String(a.textContent||a)};q=null;q=A.prototype;q.size=function(){return this.rows.length};
|
92 |
+
q.insert=function(a){var b=this.h,c=d("wg-dead");c.style.height=String(b)+"px";a.appendChild(c);return this.dead=c};q.top=function(){return(this.rendered?this.live:this.dead).offsetTop};q.height=function(){var a=this.h;null==a&&(this.h=a=this.rendered?this.live.firstChild.offsetHeight:this.dead.offsetHight);a||l("row has zero height");return a};q.render=function(a){for(var b,c=-1,f=this.rows,d=f.length,e=this.dead,k=this.live,w=k.childNodes;++c<d;)b=f[c],b.rendered||b.render(w);d=a.length;for(c=0;c<
|
93 |
+
d;c++)w[c].style.width=a[c];e.parentNode.replaceChild(k,e);this.rendered=!0;this.h=null;return this};q.sleep=function(){var a=this.height(),b=this.live,c=this.dead;c.style.height=String(a)+"px";b.parentNode.replaceChild(c,b);this.rendered=!1;this.h=a;return this};q.sleepH=function(a){a*=this.rows.length;var b=this.dead;b&&(b.style.height=String(a)+"px");this.rendered||(this.h=a);return this};q.widths=function(a){for(var b=this.live.childNodes,c=a.length;0!==c--;)b[c].style.width=a[c];return this};
|
94 |
+
q.destroy=function(){var a=this.rendered?this.live:this.dead,b=this.rows,c=b.length;for(a.parentNode.removeChild(a);0!==c--;)b[c].destroy()};q=null;return g}({},v,x));m.register("$39",function(g,e,E){function l(a,b){var c=a.id,f=c&&s[c],d=f&&f.parent();if(!f||!d)return null;var e=d.dir===q,c=e?"X":"Y",k="page"+c,e=e?A:z,n=e(d.el),c=b["offset"+c],g=d.el,r=g.className;null==c&&(c=b[k]-e(a));c&&(n+=c);g.className=r+" is-resizing";return{done:function(){g.className=r},move:function(a){d.resize(a[k]-n,
|
95 |
+
f);return!0}}}function d(a,c){function f(){h(E).off("mousemove",d);p&&(p.done(),p=null);return!0}function d(a){p?p.move(a):f();return!0}if(p)return!0;p=l(a.target,a);if(!p)return!0;h(E).one("mouseup",f).on("mousemove",d);return b(a)}function c(a,b){var c=b.type;"touchmove"===c?p&&p.move(b):"touchstart"===c?p=l(a.target,b):"touchend"===c&&p&&(p.done(),p=null)}function b(a){a.stopPropagation();a.preventDefault();return!1}function a(a){var b=B;b&&b.redraw();a&&a.redraw();return B=a}function f(b,c){var f=
|
96 |
+
h(c).on("editFocus",function(){f.trigger("wgFocus",[a(b)])}).on("editBlur",function(){f.trigger("wgBlur",[a(null)])})}function n(a){var b=a.id,c=a.className;this.id=b;this.el=a;this.pos=this.index=0;this.css=[c||"wg-root","wg-cell"];this._cn=c;s[b]=this;this.clear()}var r=m.include("$45","html.js")||m.include("$2","html.js",!0),k=m.require("$21","dom.js"),z=k.top,A=k.left,q=1,s={},B,p=!1;g.init=function(a){var b=new n(a);b.redraw();m.require("$46","touch.js").ok(function(b){b.dragger(a,c)});h(a).mousedown(d);
|
97 |
+
return b};e=n.prototype;e.fire=function(a,b){var c=h.Event(a);c.cell=this;h(this.el).trigger(c,b);return this};e.each=function(a){for(var b=-1,c=this.cells,f=c.length;++b<f;)a(c[b],b);return this};e.indexOf=function(a){return(a=s[a.id||String(a)])&&a.pid===this.id?a.index:-1};e.on=function(){return this.$("on",arguments)};e.off=function(){return this.$("off",arguments)};e.find=function(a){return h(this.el).find(a)};e.$=function(a,b){h.fn[a].apply(h(this.el),b);return this};e.addClass=function(a){this.css.push(a);
|
98 |
+
return this};e.removeClass=function(a){a=this.css.indexOf(a);-1!==a&&this.css.splice(a,1);return this};e.parent=function(){return this.pid&&s[this.pid]};e.splitx=function(){return this._split(q,arguments)};e.splity=function(){return this._split(2,arguments)};e._split=function(a,b){(this.length||this.field)&&this.clear();for(var c=-1,f,d=b.length,e=1/d,g=0;++c<d;){f=k.el();this.body.appendChild(f);for(var r=f,h=b[c],z=h,q=1;s[h];)h=z+"-"+ ++q;r.id=h;f=new n(f);f.index=c;f.pid=this.id;f._locale(this.lang,
|
99 |
+
this.rtl);f.pos=g;g+=e;this.cells.push(f);this.length++}this.dir=a;this.redraw();return this.cells};e.destroy=function(){this.clear();delete s[this.id];var a=this.el;a.innerHTML="";this.body=null;a.className=this._cn||"";h(a).off();return this};e.exists=function(){return this===s[this.id]};e.clear=function(){for(var a=this.el,b=this.cells,c=this.field,f=this.body,d=this.nav,e=this.length||0;0!==e--;)delete s[b[e].destroy().id];this.cells=[];this.length=0;d&&(a.removeChild(d),this.nav=null);f&&(c&&
|
100 |
+
(r.ie()&&h(f).triggerHandler("blur"),c.destroy(),this.field=null),this.table&&(this.table=null),a===f.parentNode&&a.removeChild(f));this.body=a.appendChild(k.el("","wg-body"));this._h=null;return this};e.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var c=b.index,f=this.cells,d=h(this.el)[this.dir===q?"width":"height"](),e=f[c+1],c=f[c-1];pad=(b.body||b.el.firstChild).offsetTop||0;max=(e?e.pos*d:d)-pad;min=c?c.pos*d:0;b.pos=Math.min(max,Math.max(min,a))/d;this.redraw();return this};e.distribute=
|
101 |
+
function(a){for(var b=-1,c=0,f,d=this.cells,e=a.length;++b<e&&(f=d[++c]);)f.pos=Math.max(0,Math.min(1,a[b]));this.redraw();return this};e.distribution=function(){for(var a=[],b=0,c=this.cells,f=c.length-1;b<f;)a[b]=c[++b].pos;return a};e.restyle=function(){var a=this.css.concat();0===this.index?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):a.push("wg-split-x"));this.t&&a.push("has-title");this.nav&&a.push("has-nav");this.field&&(a.push("is-field"),
|
102 |
+
this.field.editable()?a.push("is-editable"):a.push("is-readonly"));a=a.join(" ");a!==this._css&&(this._css=a,this.el.className=a);return this};e.redraw=function(a){this.restyle();var b=this.el,c=this.body,f=this.field;if(c){var d,e=b.clientWidth||0,k=b.clientHeight||0,n=c.offsetTop||0,k=n>k?0:k-n;this._h!==k&&(this._h=k,c.style.height=String(k)+"px",d=f);this._w!==e&&(this._w=e,d=f);d&&d.redraw()}c=this.length;e=1;k=this.nav;for(n=2===this.dir?"height":"width";0!==c--;)f=this.cells[c],k?d=1:(f.fixed&&
|
103 |
+
(f.pos=f.fixed/h(b)[n]()),d=e-f.pos,e=f.pos),f.el.style[n]=String(100*d)+"%",f.redraw(a);return this};e.contents=function(a,b){var c=this.el,f=this.body;if(null==a)return f.innerHTML;this.length?this.clear():f&&(c.removeChild(f),f=null);f||(this.body=f=c.appendChild(k.el("",b||"wg-content")),this._h=null,(c=this.lang)&&this._locale(c,this.rtl,!0));"string"===typeof a?h(f)._html(a):a&&this.append(a);this.redraw();return this};e.textarea=function(a,b){var c=this.field;if(c){var d=c.editable();c.reload(a,
|
104 |
+
b);d!==b&&this.restyle()}else this.length&&this.clear(),d=k.el("textarea"),d.setAttribute("wrap","virtual"),d.value=a,this.contents(d),c=m.require("$47","field.js")._new(d)[b?"enable":"disable"](),f(this,d),this.field=c,this.restyle();this.lang||this.locale("en");return c};e.locale=function(a){a=m.require("$37","locale.js").cast(a);return this._locale(String(a),a.isRTL())};e._locale=function(a,b,c){var f=this.body;if(c||a!==this.lang)this.lang=a,f&&f.setAttribute("lang",a);if(c||b!==this.rtl)this.rtl=
|
105 |
+
b,f&&f.setAttribute("dir",b?"RTL":"LTR");return this};e.editable=function(){var a=this.field;if(a)return a.editable()?a:null;var b=this.cells,c=b.length,f=this.navigated();if(null!=f)return b[f].editable();for(;++f<c;){for(f=0;f<c;c++);if(a=b[f].editable())return a}};e.eachTextarea=function(a){var b=this.field;b?a(b):this.each(function(b){b.eachTextarea(a)});return this};e.append=function(a){a&&(a.nodeType?r.init(this.body.appendChild(a)):r.init(h(a).appendTo(this.body)));return this};e.prepend=function(a){var b=
|
106 |
+
this.body;if(a.nodeType){var c=b.firstChild;r.init(c?b.insertBefore(a,c):b.appendChild(a))}else r.init(h(a).prependTo(b));return this};e.before=function(a){var b=this.body;a.nodeType?r.init(this.el.insertBefore(a,b)):r.init(h(a).insertBefore(b));return this};e.header=function(a,b){if(null==a&&null==b)return this.el.getElementsByTagName("header")[0];this.t=k.txt(a||"");this.el.insertBefore(k.el("header",b),this.body).appendChild(this.t);this.redraw();return this};e.title=function(a){var b=this.t;if(b)return b.nodeValue=
|
107 |
+
a||"",b;this.header(a);return this.t};e.titled=function(){var a=this.t;return a&&a.nodeValue};e.bodyY=function(){return z(this.body,this.el)};e.scrollY=function(a){if(J===a)return this.body.scrollTop;this.body.scrollTop=a};e.tabulate=function(a){var b=this.table;b?b.clear():b=m.require("$48","wgtable.js").create(this);b.init(a);return this.table=b};e.lock=function(){this.body.className+=" locked";return this};e.scrollTo=function(a,b){var c,f=this.body;c=f.scrollTop;var d=z(a,f);if(c>d)c=d;else{var e=
|
108 |
+
f.clientHeight,d=d+h(a).outerHeight();if(e+c<d)c=d-e;else return}b?f.scrollTop=c:h(f).stop(!0).animate({scrollTop:c},250)};e.navigize=function(a,c){function f(a){var b=e[a],c=r[a],d=h(b.el).show();c.addClass("active");g=a;z.data("idx",a);b.fire("wgTabSelect",[a]);return d}var d=this,e=d.cells,n=d.nav,g,r=[];n&&d.el.removeChild(n);var n=d.nav=d.el.insertBefore(k.el("nav","wg-tabs"),d.body),z=h(n).on("click",function(a){var c=h(a.target).data("idx");if(null==c)return!0;if(null!=g){var k=r[g];h(e[g].el).hide();
|
109 |
+
k.removeClass("active")}f(c);d.redraw();return b(a)});null==c&&(c=z.data("idx")||0);d.each(function(b,c){r[c]=h('<a href="#'+b.id+'"></a>').data("idx",c).text(a[c]).appendTo(z);b.pos=0;h(b.el).hide()});f(e[c]?c:0);d.lock();d.redraw();return d};e.navigated=function(){var a=this.nav;if(a)return h(a).data("idx")};e=null;return g}({},v,x));m.register("$24",function(g,e,E){function l(a){var b=[];a&&(a.saved()||b.push("po-unsaved"),a.fuzzy()?b.push("po-fuzzy"):a.flagged()&&b.push("po-flagged"),a.translation()||
|
110 |
+
b.push("po-empty"),a.comment()&&b.push("po-comment"));return b.join(" ")}function d(a,b,c){b=h(a.title(b).parentNode);var f=b.find("span.lang");c?(c=m.require("$37","locale.js").cast(c),f.length||(f=h("<span></span>").prependTo(b)),f.attr("lang",c.lang).attr("class",c.getIcon()||"lang region region-"+(c.region||"zz").toLowerCase())):(f.remove(),c="en");a.locale(c);return b}function c(a,b,c){b.click(function(b){var f=a.fire(c,[b.target]);f||b.preventDefault();return f})}function b(){this.dirty=0}m.require("$3",
|
111 |
+
"number.js");var a="poUpdate",f="changing",n="changed",r=0,k=1,z=2,A=3,q=4,s=5,B,p,y=m.require("$36","string.js").html,v=m.require("$6","string.js").sprintf;g.extend=function(a){return a.prototype=new b};g.localise=function(a){p=a;return g};var C=function(){var a=E.createElement("p");return function(b){a.innerHTML=b.replace("src=","x=");return a.textContent.trim()||b.trim()}}(),u=b.prototype=m.require("$38","abstract.js").init(["getListColumns","getListHeadings","getListEntry"],["editable","t"]);
|
112 |
+
u.init=function(){this.localise();this.editable={source:!0,target:!0};this.mode="";this.html=!1;return this};u.localise=function(a){a||(a=p||m.require("$1","t.js").init());var b=[];b[r]=a._x("Source text","Editor")+":";b[A]=a._x("%s translation","Editor")+":";b[q]=a._x("Context","Editor")+":";b[s]=a._x("Comments","Editor")+":";b[k]=a._x("Single","Editor")+":";b[z]=a._x("Plural","Editor")+":";b[6]=a._x("Untranslated","Editor");b[7]=a._x("Translated","Editor");b[8]=a._x("Toggle Fuzzy","Editor");b[9]=
|
113 |
+
a._x("Suggest translation","Editor");this.labels=b;this.t=a;return this};u.setRootCell=function(a){function b(a){c.redraw(!0,a);return!0}var c=m.require("$39","wingrid.js").init(a);h(e).on("resize",b);this.redraw=b;h(a).on("wgFocus wgBlur",function(a,b){a.stopPropagation();B=b});this.destroy=function(){c.destroy();h(e).off("resize",b)};this.rootDiv=a;return c};u.$=function(){return h(this.rootDiv)};u.setListCell=function(a){var b=this;b.listCell=a;a.on("wgRowSelect",function(a,c){b.loadMessage(b.po.row(c));
|
114 |
+
return!0}).on("wgRowDeselect",function(a,c,f){f||b.loadNothing();return!0})};u.setSourceCell=function(a){this.sourceCell=a};u.setTargetCell=function(a){this.targetCell=a};u.next=function(a,b,c){for(var f=this.listTable,d=f.selected(),e=d,k,n=this.po;null!=(d=f.next(a,c,d));){if(e===d){d=null;break}if(b&&(k=n.row(d),k.translated(0)))continue;break}null!=d&&f.select(d,!0);return d};u.current=function(a){var b=this.active;if(null==a)return b;a?a.is(b)?this.reloadMessage(a):this.loadMessage(a):this.unloadActive();
|
115 |
+
return this};u.getTargetOffset=function(){if(this.active)return this.targetCell&&this.targetCell.navigated()||0};u.getTargetEditable=function(){return this.editable.target&&this.targetCell&&this.targetCell.editable()};u.getSourceEditable=function(){return this.editable.source&&this.sourceCell&&this.sourceCell.editable()};u.getContextEditable=function(){return this.editable.context&&this.contextCell&&this.contextCell.editable()};u.getFirstEditable=function(){return this.getTargetEditable()||this.getSourceEditable()||
|
116 |
+
this.getContextEditable()};u.searchable=function(a){a&&(this.dict=a,this.po&&this.rebuildSearch());return this.dict&&!0};u.rebuildSearch=function(){var a=-1,b=this.po.rows,c=b.length,f=this.dict;for(f.clear();++a<c;)f.add(a,b[a].toText())};u.filtered=function(){return this.lastSearch||""};u.filter=function(a,b){var c,f=this.listTable,d=this.lastFound,e=this.lastSearch;if(a){if(e===a)return d||0;if(e&&!d&&0===a.indexOf(e))return 0;c=this.dict.find(a)}this.lastSearch=e=a;this.lastFound=d=c?c.length:
|
117 |
+
this.po.length;c?f.filter(c):f.unfilter();b||this.fire("poFilter",[e,d]);return d};u.countFiltered=function(){return this.lastSearch?this.lastFound:this.po.length};u.unsave=function(a,b){var c=!1;if(a){if(c=a.saved(b))this.dirty++,a.unsave(b),this.fire("poUnsaved",[a,b]);this.markUnsaved(a)}return c};u.markUnsaved=function(a){var b=this.po.indexOf(a);if((b=this.listTable.tr(b))&&b.length){var c=b[0].className;a=c.replace(/(?:^| +)po-[a-z]+/g,"")+" "+l(a);a!==c&&h(b).attr("class",a)}};u.save=function(a){var b=
|
118 |
+
this.po;if(this.dirty||a)b.each(function(a,b){b.save()}),this.listCell.find("div.po-unsaved").removeClass("po-unsaved"),this.dirty=0,this.fire("poSave");return b};u.fire=function(a,b){var c=this.handle;if(c&&c[a]&&(c=c[a].apply(this,b||[]),!1===c))return!1;c=h.Event(a);this.$().trigger(c,b);return!c.isDefaultPrevented()};u.on=function(a,b){this.$().on(a,b);return this};u.getSorter=function(){return null};u.reload=function(){var a=this,b,c=a.listCell,f=a.listTable,d=a.po,e=d&&d.locale(),k=e&&e.isRTL(),
|
119 |
+
n=d&&d.length||0;if(!d||!d.row)return c&&c.clear().header("Error").contents("Invalid messages list"),!1;a.targetLocale=e;a.lastSearch&&(a.lastSearch="",a.lastFound=n,a.fire("poFilter",["",n]));f&&(b=f.thead().distribution());a.listTable=f=c.tabulate({eachCol:function(b){var c,f,d=a.getListColumns(),e=a.getListHeadings();for(f in d)c=d[f],b(c,f,e[c])},eachRow:function(b){d.each(function(c,f){b(f.idx,a.getListEntry(f),l(f))})},sort:a.getSorter()});var g,c=a.getListColumns();for(g in c)f.sortable(c[g]);
|
120 |
+
b&&f.thead().distribute(b);f.tbody().$(k?"addClass":"removeClass",["is-rtl"]);a.fire("poLoad");return!!n};u.load=function(a,b){this.po=a;this.dict&&this.rebuildSearch();this.reload()&&(-1!==b?this.listTable.selectRow(b||0):this.active&&this.unloadActive())};u.pasteMessage=function(a){var b,c=0;this.active===a&&((b=this.sourceCell)&&b.eachTextarea(function(b){b.val(a.source(null,c++))}),(b=this.contextCell)&&b.eachTextarea(function(b){b.val(a.context())}),b=this.targetCell)&&(c=0,b.eachTextarea(function(b){b.val(a.translation(c++))}));
|
121 |
+
this.updateListCell(a,"source");this.updateListCell(a,"target");return this};u.reloadMessage=function(a){var b=this.sourceCell,c=this.targetCell,f;this.pasteMessage(a);b&&this.setSrcMeta(a,b)&&b.redraw();c&&(f=c.navigated()||0,f=this.setTrgMeta(a,f,c),!b&&this.setSrcMeta(a,c)&&(f=!0),f&&c.redraw());return this};u.setStatus=function(){return null};u.setSrcMeta=function(a,b){var f=[],d,e=!1,k=this.$smeta,n=this.labels,g=[],r=a.tags(),z=r&&r.length;if(d=a.context())g.push("<span>"+y(n[q])+"</span>"),
|
122 |
+
g.push("<mark>"+y(d)+"</mark>");if(z&&this.getTag)for(g.push("<span>Tagged:</span>");0<=--z;)(d=this.getTag(r[z]))&&g.push('<mark class="tag">'+y(d.mod_name)+"</mark>");g.length&&f.push(g.join(" "));if(this.getMono()&&(d=a.refs())&&(r=d.split(/\s/),z=r.length)){for(g=[];0<=--z;)d=r[z],g.push("<code>"+y(d)+"</code>");f.push('<p class="has-icon icon-file">'+g.join(" ")+"</p>")}(d=a.notes())&&f.push('<p class="has-icon icon-info">'+y(d,!0)+"</p>");f.length?(k||(k=b.find("div.meta"),k.length||(k=h('<div class="meta"></div>').insertAfter(b.header())),
|
123 |
+
c(this,k,"poMeta"),this.$smeta=k),k.html(f.join("\n")).show(),e=!0):k&&k.text()&&(k.text("").hide(),e=!0);return e};u.setTrgMeta=function(a,b,c){var f=[],d=!1,e=this.$tmeta;b=(a=a.errors(b))&&a.length;var k;if(b)for(k=0;k<b;k++)f.push('<p class="has-icon icon-warn">'+y(a[k],!0)+".</p>");f.length?(e||(e=c.find("div.meta"),e.length||(e=h('<div class="meta"></div>').insertAfter(c.header())),this.$tmeta=e),e.html(f.join("\n")).show(),d=!0):e&&e.text()&&(e.text("").hide(),d=!0);return d};u.loadMessage=
|
124 |
+
function(b){function c(a,b){var f=b?a.split(" "):a.split(" ",1);a=f[0];"="===a.charAt(0)&&(a=a.substr(1),a=["zero","one","two"][Number(a)]||a);f[0]=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();return f.join(" ")}function e(a,f){var n=J,h=L[r];a.off();a.titled()!==h&&d(a,h,f||"en");h=!1;p.setSrcMeta(b,a)&&(h=!0);if(b.plural()){var h=-1,q=[],l=[],s=a.id+"-",m=b.sourceForms()||f&&f.plurals||["One","Other"],A=m.length;if(2!==A||"="===m[0].charAt(0)&&"=1"!==m[0])for(;++h<A;)q[h]=s+String(h),l[h]=
|
125 |
+
c(m[h])+":";else q=[s+"-0",s+"-1"],l=[L[k],L[z]];a.splity.apply(a,q);a.each(function(a,c){a.header(l[c]).textarea(b.source(null,c),n).setStrf(D).setMode(y).setInvs(C)});a.lock();n&&a.each(function(a,b){g(a,b)})}else h&&a.redraw(),a.textarea(b.source(),n).setStrf(D).setMode(y).setInvs(C),n&&g(a,0)}function g(c,d){c.on(f,function(a,c){b.source(c,d);0===d&&p.updateListCell(b,"source");p.unsave(b,d)}).on(n,function(){0===d&&p.po.reIndex(b);p.dict&&p.rebuildSearch();p.fire(a,[b])})}function h(a,f,e){M&&
|
126 |
+
a.eachTextarea(function(a){a.ping()});a.off();var k=f.isKnown()&&f.label||"Target",k=v(L[A],k);a.titled()!==k&&d(a,k,f);k=!1;!this.sourceCell&&p.setSrcMeta(b,a)&&(k=!0);p.setTrgMeta(b,e,a)&&(k=!0);p.setStatus(b,e);if(b.pluralized()){var n=[],g=[],r=a.id+"-",z=b.targetForms()||f.plurals||["One","Other"],k=z.length,q=function(a){var b=z[a];g.push(b?c(b,!0):"Form "+a);n.push(r+String(a))};for(b.each(q);(f=n.length)<k;)q(f);a.splitx.apply(a,n);a.each(function(a,c){var f=M&&!b.disabled(c);a.textarea(b.translation(c),
|
127 |
+
f).setStrf(D).setMode(y).setInvs(C);M&&l(a,c)});a.navigize(g,e||null).on("wgTabSelect",function(c,f){var d=M&&c.cell.editable();d&&d.focus();p.setTrgMeta(b,f,a);p.setStatus(b,f);p.fire("poTab",[f])})}else k&&a.redraw(),a.textarea(b.translation(),M&&!b.disabled(0)).setStrf(D).setMode(y).setInvs(C),M&&l(a,0)}function l(c,d){c.on(f,function(a,c,f){b.translate(c,d);0===d&&p.updateListCell(b,"target");b.fuzzy(d)?p.fuzzy(!1,b,d):p.unsave(b,d);""===c?(p.fire("poEmpty",[!0,b,d]),p.setStatus(b,d)):""===f&&
|
128 |
+
(p.fire("poEmpty",[!1,b,d]),p.setStatus(b,d))}).on(n,function(){p.dict&&p.rebuildSearch();p.fire(a,[b])})}function m(c){c.off();var e=L[q];c.titled()!==e&&(d(c,e),p.setStatus(null));c.textarea(b.context(),!0).setMode(y).setInvs(C);X&&c.on(f,function(a,c){b.context(c);p.updateListCell(b,"source");p.unsave(b,O)}).on(n,function(){p.po.reIndex(b);p.dict&&p.rebuildSearch();p.fire(a,[b])})}function u(a){var c=L[s];a.titled()!==c&&d(a,c);a.off().on(f,function(a,c){b.comment(c);p.fire("poComment",[b,c]);
|
129 |
+
p.unsave(b,O)}).textarea(b.comment(),!0)}var p=this,y=p.mode,E=b.isHTML(),C=p.inv||!1,x=this.fmt||null,D=b.format()||null,I=b.is(p.active),O=0,T=p.sourceCell,S=p.targetCell,U=p.contextCell,V=p.commentCell,M=p.editable.target,J=p.editable.source,X=p.editable.context,P=B,Y=p.sourceLocale,W=p.targetLocale,L=p.labels;p.html!==E&&(p.html=E,"code"!==p.mode&&(y=E?"html":"",p.setMode(y)));p.active=b;T&&e(T,Y);U&&m(U);S&&W&&(O=S.navigated()||0,h(S,W,O));V&&u(V);P&&(P.exists()||(P=P.parent()),(E=P.editable())&&
|
130 |
+
E.focus());x!==D&&(this.fmt=D);I||p.fire("poSelected",[b,O])};u.unloadActive=function(){function a(b){b&&b.text("").hide()}function b(a){a&&a.off().clear()}a(this.$smeta);a(this.$tmeta);b(this.sourceCell);b(this.contextCell);b(this.targetCell);this.commentCell&&this.commentCell.off();this.active&&(this.fire("poDeselected",[this.active]),this.active=null);return this};u.loadNothing=function(){var a,b=this.t,c=this.mode||"",f=this.inv||!1,d=this.fmt;this.unloadActive();this.setStatus(null);(a=this.commentCell)&&
|
131 |
+
a.textarea("",!1);if(a=this.sourceCell)a.textarea("",!1).setStrf(d).setMode(c).setInvs(f),a.title(b._x("Source text not loaded","Editor")+":");if(a=this.contextCell)a.textarea("",!1).setMode(c).setInvs(f),a.title(b._x("Context not loaded","Editor")+":");if(a=this.targetCell)a.textarea("",!1).setStrf(d).setMode(c).setInvs(f),a.title(b._x("Translation not loaded","Editor")+":");this.fire("poSelected",[null])};u.updateListCell=function(a,b){var c=this.getListColumns()[b],f=this.po.indexOf(a);(f=this.listTable.row(f))&&
|
132 |
+
f.rendered&&f.update(c)};u.cellText=function(a){return(a=-1!==a.indexOf("<")||-1!==a.indexOf("&")?C(a):a.trim())||"\u00a0"};u.fuzzy=function(a,b,c){b=b||this.active;var f=b.fuzzy(c);!0!==a||f?!1===a&&f&&this.flag(0,b,c)&&this.fire("poFuzzy",[b,!1,c]):this.flag(4,b,c)&&this.fire("poFuzzy",[b,!0,c]);return f};u.flag=function(b,c,f){if(!c){c=this.active;f=this.getTargetOffset();if(null==f)return null;f&&c.targetForms()&&(f=0)}var d=c.flagged(f);if(null==b)return d;if(d===b||b&&!c.translated(f)||!this.fire("poFlag",
|
133 |
+
[b,d,c,f]))return!1;c.flag(b,f);this.fire(a,[c])&&this.unsave(c,f);this.setStatus(c,f);return!0};u.add=function(b,c){var f,d=this.po.get(b,c);d?f=this.po.indexOf(d):(f=this.po.length,d=this.po.add(b,c),this.load(this.po,-1),this.fire("poAdd",[d]),this.fire(a,[d]));this.lastSearch&&this.filter("");this.listTable.select(f);return d};u.del=function(b){if(b=b||this.active){var c=this.lastSearch,f=this.po.del(b);null!=f&&(this.unsave(b),this.fire("poDel",[b]),this.fire(a,[b]),this.reload(),this.dict&&
|
134 |
+
this.rebuildSearch(),this.active&&this.active.equals(b)&&this.unloadActive(),this.po.length&&(c&&this.filter(c),this.active||(f=Math.min(f,this.po.length-1),this.listTable.select(f))))}};u.setMono=function(a){return this.setMode(a?"code":this.html?"html":"")};u.setMode=function(a){if(this.mode!==a){this.mode=a;this.callTextareas(function(b){b.setMode(a)});var b=this.active,c=this.sourceCell;b&&b.refs()&&c&&this.setSrcMeta(b,c)&&c.redraw()}return this};u.getMono=function(){return"code"===this.mode};
|
135 |
+
u.setInvs=function(a){(this.inv||!1)!==a&&(this.inv=a,this.callTextareas(function(b){b.setInvs(a)}),this.fire("poInvs",[a]));return this};u.getInvs=function(){return this.inv||!1};u.callTextareas=function(a){var b=this.targetCell;b&&b.eachTextarea(a);(b=this.contextCell)&&b.eachTextarea(a);(b=this.sourceCell)&&b.eachTextarea(a);return this};u.focus=function(){var a=this.getTargetEditable();a&&a.focus();return this};u=null;return g}({},v,x));m.register("$13",function(g,e,E){function l(){this.init()._validate();
|
136 |
+
this.sourceLocale={lang:"en",label:"English",plurals:["One","Other"]}}function d(a){a=h('<button type="button" class="button button-small icon icon-'+a+' hastip"></button>');m.require("$12","tooltip.js").init(a);return a}function c(a){return d("cloud").attr("title",a.labels[8]+" (Ctrl-U)").click(function(b){b.preventDefault();a.focus().fuzzy(!a.fuzzy())})}function b(a){return d("robot").attr("title",a.labels[9]+" (Ctrl-J)").click(function(b){b.preventDefault();a.fire("poHint")})}e=m.require("$24",
|
137 |
+
"base.js");g.init=function(a){var b=new l;a=b.setRootCell(a);var c=a.splity("po-list","po-edit"),d=c[0],e=c[1],c=e.splitx("po-trans","po-comment"),g=c[0],h=c[1].header("Loading.."),c=g.splity("po-source","po-target"),g=c[0].header("Loading.."),c=c[1].header("Loading..");a.distribute([0.34]);e.distribute([0.8]);b.setListCell(d);b.setSourceCell(g);b.setTargetCell(c);b.commentCell=h;b.editable.source=!1;return b};e=l.prototype=e.extend(l);e.getListHeadings=function(){var a=this.t||{_x:function(a){return a}},
|
138 |
+
b=[a._x("Source text","Editor")];this.targetLocale&&(b[1]=a._x("Translation","Editor"));return b};e.getListColumns=function(){var a={source:0};this.targetLocale&&(a.target=1);return a};e.getListEntry=function(a){var b=this.cellText,c=[function(){var c,d=b(a.source()||""),e=a.context();return e?(c=E.createElement("p"),c.appendChild(E.createElement("mark")).innerText=e,c.appendChild(E.createTextNode("\u00a0"+d)),c):d}];this.targetLocale&&(c[1]=function(){return b(a.translation()||"")});return c};e.stats=
|
139 |
+
function(){var a=this.po,b=a.length,c=0,d=0,e=0;a.each(function(a,b){b.fuzzy()?e++:b.translated()?c++:d++});return{t:b,p:c.percent(b)+"%",f:e,u:d}};e.unlock=function(){var a=this.targetLocale;this._unlocked||(this.editable={source:!0,context:!0,target:!1},this.po&&this.po.unlock(),this.contextCell=this.targetCell,delete this.targetCell,a&&(this._unlocked=a,delete this.targetLocale,this.reload(),this.fire("poLock",[!1])),this.active&&this.loadMessage(this.active))};e.lock=function(){var a=this._unlocked;
|
140 |
+
a&&(this.targetLocale=a,delete this._unlocked,this.po&&this.po.lock(a),this.editable={source:!1,context:!1,target:!0},this.targetCell=this.contextCell,delete this.contextCell,this.reload(),this.fire("poLock",[!0,a]),this.active&&this.loadMessage(this.active))};e.locked=function(){return!this._unlocked};e.setStatus=function(a){var f=this.$tnav;if(null==a)f&&(f.remove(),this.$tnav=null);else{f||(this.$tnav=f=h("<nav></nav>").append(c(this)).append(b(this)).appendTo(this.targetCell.header()));var d=
|
141 |
+
[];a.translated()?a.fuzzy()&&d.push("po-fuzzy"):d.push("po-empty");f.attr("class",d.join(" "))}};e.getSorter=function(){function a(a,c){var d=a.weight(),e=c.weight();return d===e?b(a,c):d>e?-1:1}function b(a,c){return a.hash().localeCompare(c.hash())}var c=this;return function(d){var e=c.po,g=c.locked()?a:b;d.sort(function(a,b){return g(e.row(a),e.row(b))})}};return g}({},v,x));m.register("$14",function(g,e,m){var l={copy:66,clear:75,save:83,fuzzy:85,next:40,prev:38,enter:13,invis:73,hint:74},d={38:!0,
|
142 |
+
40:!0,73:!0},c={66:function(b,a){var c=a.current();c&&(c.normalize(),a.focus().pasteMessage(c))},75:function(b,a){var c=a.current();c&&(c.untranslate(),a.focus().pasteMessage(c))},85:function(b,a){a.focus().fuzzy(!a.fuzzy())},13:function(b,a){a.getFirstEditable()&&a.next(1,!0,!0)},40:function(b,a){var c=b.shiftKey;a.next(1,c,c)},38:function(b,a){var c=b.shiftKey;a.next(-1,c,c)},73:function(b,a){if(!b.shiftKey)return!1;a.setInvs(!a.getInvs())}};g.init=function(b,a){function f(a){if(a.isDefaultPrevented()||
|
143 |
+
!a.metaKey&&!a.ctrlKey)return!0;var f=a.which;if(!g[f])return!0;var e=c[f];if(!e)throw Error("command undefined #"+f);if(a.altKey||a.shiftKey&&!d[f]||!1===e(a,b))return!0;a.stopPropagation();a.preventDefault();return!1}var g={};h(a||e).on("keydown",f);return{add:function(a,b){c[l[a]]=b;return this},enable:function(){var a,b;for(b in arguments)a=l[arguments[b]],g[a]=!0;return this},disable:function(){h(a||e).off("keydown",f);b=a=g=null}}};return g}({},v,x));m.register("$25",function(g,e,h){function l(){this.reIndex([])}
|
144 |
+
g.init=function(){return new l};e=l.prototype;e.reIndex=function(d){for(var c={},b=-1,a=d.length;++b<a;)c[d[b]]=b;this.keys=d;this.length=b;this.ords=c};e.key=function(d,c){if(null==c)return this.keys[d];var b=this.keys[d],a=this.ords[c];if(c!==b){if(null!=a)throw Error("Clash with item at ["+a+"]");this.keys[d]=c;delete this.ords[b];this.ords[c]=d}return d};e.indexOf=function(d){d=this.ords[d];return null==d?-1:d};e.add=function(d,c){var b=this.ords[d];null==b&&(this.keys[this.length]=d,b=this.ords[d]=
|
145 |
+
this.length++);this[b]=c;return b};e.get=function(d){return this[this.ords[d]]};e.has=function(d){return null!=this.ords[d]};e.del=function(d){this.cut(this.ords[d],1)};e.cut=function(d,c){c=c||1;var b=[].splice.call(this,d,c);this.keys.splice(d,c);this.reIndex(this.keys);return b};e.each=function(d){for(var c=-1,b=this.keys,a=this.length;++c<a;)d(b[c],this[c],c);return this};e.sort=function(d){for(var c=-1,b=this.length,a,f=this.keys,e=this.ords,g=[];++c<b;)g[c]=[this[c],f[c]];g.sort(function(a,
|
146 |
+
b){return d(a[0],b[0])});for(c=0;c<b;c++)a=g[c],this[c]=a[0],a=a[1],f[c]=a,e[a]=c;return this};e.join=function(d){return[].join.call(this,d)};e=null;return g}({},v,x));m.register("$26",function(g,e,h){function l(d,c){var b=RegExp("^.{0,"+(d-1)+"}["+c+"]"),a=RegExp("^[^"+c+"]+");return function(c,e){for(var g=c.length,k;g>d;){k=b.exec(c)||a.exec(c);if(null==k)break;k=k[0];e.push(k);k=k.length;g-=k;c=c.substr(k)}0!==g&&e.push(c);return e}}g.create=function(d){function c(a){return k[a]||"\\"+a}var b,
|
147 |
+
a,f=/(?:\r\n|[\r\n\v\f\u2028\u2029])/g,e=/[ \r\n]+/g,g=/[\t\v\f\x07\x08\\\"]/g,k={"\t":"\\t","\v":"\\v","\f":"\\f","\u0007":"\\a","\b":"\\b"};if(null==d||isNaN(d=Number(d)))d=79;0<d&&(b=l(d-3," "),a=l(d-2,"-\u2013 \\.,:;\\?!\\)\\]\\}\\>"));return{pair:function(b,e){if(!e)return b+' ""';e=e.replace(g,c);var k=0;e=e.replace(f,function(){k++;return"\\n\n"});if(!(k||d&&d<e.length+b.length+3))return b+' "'+e+'"';var n=[b+' "'],h=e.split("\n");if(a)for(var l=-1,m=h.length;++l<m;)a(h[l],n);else n=n.concat(h);
|
148 |
+
return n.join('"\n"')+'"'},prefix:function(a,b){var c=a.split(f);return b+c.join("\n"+b)},refs:function(a){a=a.replace(e," ",a);b&&(a=b(a,[]).join("\n#: "));return"#: "+a}}};return g}({},v,x));m.register("$40",function(g,e,h){function l(){this.length=0}g.init=function(){return new l};e=l.prototype;e.push=function(d){this[this.length++]=d;return this};e.sort=function(d){[].sort.call(this,d);return this};e.each=function(d){for(var c=-1,b=this.length;++c<b;)d(c,this[c]);return this};return g}({},v,x));
|
149 |
+
m.register("$27",function(g,e,h){function l(){}g.extend=function(d){return d.prototype=new l};e=l.prototype=m.require("$38","abstract.js").init(["add","load"]);e.row=function(d){return this.rows[d]};e.lock=function(d){return this.locale(d||{lang:"zxx",label:"Unknown",nplurals:1,pluraleq:"n!=1"})};e.unlock=function(){var d=this.loc;this.loc=null;return d};e.locale=function(d){null==d?d=this.loc:this.loc=d=m.require("$37","locale.js").cast(d);return d};e.each=function(d){this.rows.each(d);return this};
|
150 |
+
e.indexOf=function(d){"object"!==typeof d&&(d=this.get(d));if(!d)return-1;null==d.idx&&(d.idx=this.rows.indexOf(d.hash()));return d.idx};e.get=function(d){return this.rows&&this.rows.get(d)};e.has=function(d){return this.rows&&this.rows.has(d)};e.del=function(d){d=this.indexOf(d);if(-1!==d){var c=this.rows.cut(d,1);if(c&&c.length)return this.length=this.rows.length,this.rows.each(function(b,a,c){a.idx=c}),d}};e.reIndex=function(d,c){var b=this.indexOf(d),a=d.hash(),f=this.rows.indexOf(a);return f===
|
151 |
+
b?b:-1!==f?(c=(c||0)+1,d.source("Error, duplicate "+String(c)+": "+d.source()),this.reIndex(d,c)):this.rows.key(b,a)};e.sort=function(d){this.rows.sort(d);return this};e["export"]=function(){for(var d=-1,c=this.rows,b=c.length,a=m.require("$40","list.js").init();++d<b;)a.push(c[d]);return a};e=null;return g}({},v,x));m.register("$28",function(g,e,h){function l(c,b,a){if(null==a)return c[b]||"";c[b]=a||"";return c}function d(){this._id=this.id=""}g.extend=function(c){return c.prototype=new d};e=d.prototype;
|
152 |
+
e.flag=function(c,b){var a=this.flg||(this.flg=[]);if(null!=b)a[b]=c;else for(var f=Math.max(a.length,this.src.length,this.msg.length);0!==f--;)a[f]=c;return this};e.flagged=function(c){var b=this.flg||[];if(null!=c)return b[c]||0;for(c=b.length;0!==c--;)if(b[c])return!0;return!1};e.flags=function(){for(var c,b={},a=[],f=this.flg||[],d=f.length;0!==d--;)c=f[d],b[c]||(b[c]=!0,a.push(c));return a};e.flaggedAs=function(c,b){var a=this.flg||[];if(null!=b)return c===a[b]||0;for(var f=a.length;0!==f--;)if(a[f]===
|
153 |
+
c)return!0;return!1};e.fuzzy=function(c,b){var a=this.flaggedAs(4,c);null!=b&&this.flag(b?4:0,c);return a};e.source=function(c,b){if(null==c)return this.src[b||0]||"";this.src[b||0]=c;return this};e.plural=function(c,b){if(null==c)return this.src[b||1]||"";this.src[b||1]=c||"";return this};e.sourceForms=function(){return this.srcF};e.targetForms=function(){return this.msgF};e.each=function(c){for(var b=-1,a=this.src,f=this.msg,d=Math.max(a.length,f.length);++b<d;)c(b,a[b],f[b]);return this};e.count=
|
154 |
+
function(){return Math.max(this.src.length,this.msg.length)};e.pluralized=function(){return 1<this.src.length||1<this.msg.length};e.translate=function(c,b){this.msg[b||0]=c||"";return this};e.untranslate=function(c){if(null!=c)this.msg[c]="";else{var b=this.msg,a=b.length;for(c=0;c<a;c++)b[c]=""}return this};e.translation=function(c){return this.msg[c||0]||""};e.errors=function(c){return this.err&&this.err[c||0]||[]};e.translated=function(c){if(null!=c)return!!this.msg[c];var b=this.msg,a=b.length;
|
155 |
+
for(c=0;c<a;c++)if(!b[c])return!1;return!0};e.untranslated=function(c){if(null!=c)return!this.msg[c];var b=this.msg,a=b.length;for(c=0;c<a;c++)if(b[c])return!1;return!0};e.comment=function(c){return l(this,"cmt",c)};e.notes=function(c){return l(this,"xcmt",c)};e.refs=function(c){return l(this,"rf",c)};e.format=function(c){return l(this,"fmt",c)};e.context=function(c){return l(this,"ctx",c)};e.tags=function(){return this.tg};e.toString=e.toText=function(){return this.src.concat(this.msg,this.id,this.ctx).join(" ")};
|
156 |
+
e.weight=function(){var c=0;this.translation()||(c+=2);this.fuzzy()&&(c+=1);return c};e.equals=function(c){return this===c||this.hash()===c.hash()};e.hash=function(){return this.id};e.normalize=function(){for(var c=this.msg.length;0!==c--;)this.msg[c]=this.src[c]||""};e.disabled=function(c){return!!(this.lck||[])[c||0]};e.disable=function(c){(this.lck||(this.lck=[]))[c||0]=!0;return this};e.saved=function(c){var b=this.drt;if(null==b)return!0;if(null!=c)return!b[c];for(c=b.length;0!==c--;)if(b[c])return!1;
|
157 |
+
return!0};e.unsave=function(c){(this.drt||(this.drt=[]))[c||0]=!0;return this};e.save=function(c){null==c?this.drt=null:(this.drt||(this.drt=[]))[c]=!1;return this};e.is=function(c){return c&&(c===this||c.idx===this.idx)};e.isHTML=function(c){if(null==c)return this.htm||!1;this.htm=c};e=null;return g}({},v,x));m.register("$15",function(g,e,h){function l(a){return{"Project-Id-Version":"PACKAGE VERSION","Report-Msgid-Bugs-To":"","POT-Creation-Date":a||"","PO-Revision-Date":a||"","Last-Translator":"",
|
158 |
+
"Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit"}}function d(a,b){var c=a||"";b&&(c+="\x00"+b);return c}function c(a){var b=e.console;b&&b.error&&b.error(a.message||String(a))}function b(a){return m.require("$26","format.js").create(a)}function a(a){this.locale(a);this.clear();this.head=l(this.now())}function f(a,b){this.src=[a||""];this.msg=[b||""]}g.create=function(b){return new a(b)};h=m.require("$27",
|
159 |
+
"messages.js").extend(a);h.clear=function(){this.rows=m.require("$25","collection.js").init();this.length=0;return this};h.now=function(){function a(b,c){for(var f=String(b);f.length<c;)f="0"+f;return f}var b=new Date,c=b.getUTCFullYear(),f=b.getUTCMonth()+1,d=b.getUTCDate(),e=b.getUTCHours(),b=b.getUTCMinutes();return a(c,4)+"-"+a(f,2)+"-"+a(d,2)+" "+a(e,2)+":"+a(b,2)+"+0000"};h.header=function(a,b){var c=this.head||(this.head={});if(null==b)return this.headers()[a]||"";c[a]=b||"";return this};h.headers=
|
160 |
+
function(a){var b,c=this.now(),f=this.head||(this.head=l(c));if(null!=a){for(b in a)f[b]=a[b];return this}var d=this.locale();a={};for(b in f)a[b]=String(f[b]);d?(a.Language=String(d)||"zxx",a["Language-Team"]=d.label||a.Language,a["Plural-Forms"]="nplurals="+(d.nplurals||"2")+"; plural="+(d.pluraleq||"n!=1")+";",b="PO-Revision-Date"):(a.Language="",a["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION;",a["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE",b="POT-Creation-Date");a[b]||(a[b]=c);a["X-Generator"]=
|
161 |
+
"Loco https://localise.biz/";return a};h.get=function(a,b){var c=d(a,b);return this.rows.get(c)};h.add=function(a,b){a instanceof f||(a=new f(a));b&&a.context(b);var d=a.hash();this.rows.get(d)?c("Duplicate message at index "+this.indexOf(a)):(a.idx=this.rows.add(d,a),this.length=this.rows.length);return a};h.load=function(a){for(var b=-1,d,e,g,h,l,m,p=(g=this.locale())&&g.nplurals||2,y=[];++b<a.length;)d=a[b],null==d.parent?(e=d.source||d.id,g=d.target||"",h=d.context,e||h?(l=new f(e,g),l._id=d._id,
|
162 |
+
h&&l.context(h),d.flag&&l.flag(d.flag,0),d.comment&&l.comment(d.comment),d.notes&&l.notes(d.notes),d.refs&&l.refs(d.refs),l.format(d.format),d.message=l,this.add(l),d.prev&&d.prev[0]&&(l.prev(d.prev[0].source,d.prev[0].context),d.prev[1]&&l._src.push(d.prev[1].source||""))):0===b&&"object"===typeof g&&(this.head=g,this.headcmt=d.comment)):y.push(d);for(b=-1;++b<y.length;)try{d=y[b];e=d.source||d.id;l=a[d.parent]&&a[d.parent].message;if(!l)throw Error("parent missing for plural "+e);m=d.plural;1===
|
163 |
+
m&&l.plural(e);m>=p||(d.flag&&l.flag(d.flag,m),l.translate(d.target||"",m),d.format&&!l.format()&&l.format(d.format))}catch(v){c(v)}return this};h.wrap=function(a){this.fmtr=b(a);return this};h.toString=function(){var a,c=this.locale(),d=[],e=[],g=this.headers(),h=!c,l=c&&c.nplurals||2,m=this.fmtr||b();g[c?"PO-Revision-Date":"POT-Creation-Date"]=this.now();for(a in g)e.push(a+": "+g[a]);e=new f("",e.join("\n"));e.comment(this.headcmt||"");h&&e.fuzzy(0,!0);d.push(e.toString());d.push("");this.rows.each(function(a,
|
164 |
+
b){a&&(d.push(b.cat(m,h,l)),d.push(""))});return d.join("\n")};h=m.require("$28","message.js").extend(f);h.prev=function(a,b){this._src=[a||""];this._ctx=b};h.hash=function(){return d(this.source(),this.context())};h.toString=function(){return this.cat(b())};h.cat=function(a,b,c){var d,f=[],e;(e=this.cmt)&&f.push(a.prefix(e,"# "));(e=this.xcmt)&&f.push(a.prefix(e,"#. "));d=this.rf;if(e=this._id)d+=(d?" ":"")+"loco:"+e;d&&/\S/.test(d)&&f.push(a.refs(d));!b&&this.fuzzy()&&f.push("#, fuzzy");(e=this.fmt)&&
|
165 |
+
f.push("#, "+e+"-format");(e=this._ctx)&&f.push(a.prefix(a.pair("msgctxt",e),"#| "));if(e=this._src)e[0]&&f.push(a.prefix(a.pair("msgid",e[0]),"#| ")),e[1]&&f.push(a.prefix(a.pair("msgid_plural",e[1]),"#| "));(e=this.ctx)&&f.push(a.pair("msgctxt",e));f.push(a.pair("msgid",this.src[0]));if(null==this.src[1])f.push(a.pair("msgstr",b?"":this.msg[0]));else for(d=-1,f.push(a.pair("msgid_plural",this.src[1])),e=this.msg||["",""],c=c||e.length;++d<c;)f.push(a.pair("msgstr["+d+"]",b?"":e[d]||""));return f.join("\n")};
|
166 |
+
h.compare=function(a,b){var c=this.weight(),d=a.weight();if(c>d)return 1;if(c<d)return-1;if(b){c=this.hash().toLowerCase();d=a.hash().toLowerCase();if(c<d)return 1;if(c>d)return-1}return 0};h.copy=function(){var a=new f,b,c;for(b in this)this.hasOwnProperty(b)&&((c=this[b])&&c.concat&&(c=c.concat()),a[b]=c);return a};h=h=null;return g}({},v,x));m.register("$17",function(g,e,m){g.init=function(e,d){function c(){return g||(g=h('<div id="loco-po-ref"></div>').dialog({dialogClass:"loco-modal loco-modal-wide",
|
167 |
+
modal:!0,autoOpen:!1,closeOnEscape:!0,resizable:!1,height:500}))}function b(a,b,d){a=h("<p></p>").text(d);c().dialog("close").html("").dialog("option","title","Error").append(a).dialog("open")}function a(a){var b=a&&a.code;if(b){for(var d=-1,f=b.length,e=h("<ol></ol>").attr("class",a.type);++d<f;)h("<li></li>").html(b[d]).appendTo(e);e.find("li").eq(a.line-1).attr("class","highlighted");c().dialog("close").html("").dialog("option","title",a.path+":"+a.line).append(e).dialog("open")}}function f(a){a=
|
168 |
+
a.target;var b=h(a).find("li.highlighted")[0],b=Math.max(0,(b&&b.offsetTop||0)-Math.floor(a.clientHeight/2));a.scrollTop=b}var g;return{load:function(g){c().html('<div class="loco-loading"></div>').dialog("option","title","Loading..").off("dialogopen").dialog("open").on("dialogopen",f);g=h.extend({ref:g,path:d.popath},d.project||{});e.ajax.post("fsReference",g,a,b)}}};return g}({},v,x));m.register("$30",function(g,e,h){function l(d){this.api=d;this.chars=0}g.create=function(d){return new l(d)};e=
|
169 |
+
l.prototype;e.init=function(d,c){function b(a){var b={length:0,html:a.html,sources:[]};m.push(b);return s[a.html?1:0]=b}function a(a,d){var m=a.source(null,d);if(m&&(a.untranslated(d)||c)){var q=l[m];if(q)q.push(a);else{var q=m.length,v=f.isHtml(m),v=s[v?1:0],u=v.sources;if(v.length+q>h||u.length===k)v=b(v),u=v.sources;u.push(m);l[m]=[a];v.length+=q;e+=q;g+=1}}}var f=this.api,e=0,g=0,k=50,h=5E3,l={},m=[],s=[];b({html:!1});b({html:!0});d.each(function(b,c){a(c,0);a(c,1)});s=null;this.map=l;this.chars=
|
170 |
+
e;this.length=g;this.batches=m;this.locale=d.locale()};e.abort=function(){this.state="abort";return this};e.dispatch=function(){function d(a,b){function d(c,e,g){b!==g&&(a===e||1<c&&f.source(null,1)===a)&&(f.translate(b,c),n++,y++);return n}if(!c())return!1;if(!b)return!0;var f,e=l[a]||[],k=e.length,h=-1,n;for(v++;++h<k;)if(f=e[h])n=0,f.each(d),n&&g("each",[f]);return!0}function c(){return"abort"===k.state?(h&&(h.abort(),e()),!1):!0}function b(){var b=m.shift(),c;b?(c=b.sources)&&c.length?h.batch(c,
|
171 |
+
s,b.html,d).fail(a).always(f):f():e()}function a(){k.abort();e()}function f(){p++;g("prog",[p,C]);c()&&b()}function e(){h=m=null;g("done")}function g(a,b){for(var c=u[a]||[],d=c.length;0<=--d;)c[d].apply(null,b)}var k=this,h=k.api,l=k.map,m=k.batches||[],s=k.locale,v=0,p=0,y=0,x=k.length,C=m.length,u={done:[],each:[],prog:[]};k.state="";b();return{done:function(a){u.done.push(a);return this},each:function(a){u.each.push(a);return this},prog:function(a){u.prog.push(a);return this},stat:function(){return{todo:function(){return Math.max(x-
|
172 |
+
v,0)},did:function(){return v}}}}};return g}({},v,x));m.register("$41",{nn:["no"]});m.register("$31",function(g,e,h){function l(){}g.create=function(d){d=l.prototype=new d;d.toString=function(){return"Yandex.Translate"};d.getId=function(){return"yandex"};d.getUrl=function(){return"https://translate.yandex.com/"};d.parseError=function(c){return c&&c.code&&200!==c.code&&c.message?"Error "+c.code+": "+c.message:""};d.batch=function(c,b,a,d){function e(a){for(var g=c.length,k=-1;++k<g&&!1!==d(c[k],a[k]||
|
173 |
+
"",b););}var g=this;a=a?"html":"plain";var k=this.mapLang(b,m.require("$41","yandex.json"));return g._call({url:"https://translate.yandex.net/api/v1.5/tr.json/translate?format="+a+"&lang=en-"+k,method:"POST",traditional:!0,data:{key:g.key(),text:c}}).done(function(a,b,c){a&&200===a.code?e(a.text||[]):(g.stderr(g.parseError(a)||g.httpError(c)),e([]))}).fail(function(){e([])})};return new l};return g}({},v,x));m.register("$42",{zh:["zh","zh-CN","zh-TW"],he:["iw"],jv:["jw"]});m.register("$32",function(g,
|
174 |
+
e,h){function l(){}g.create=function(d){d=l.prototype=new d;d.toString=function(){return"Google Translate"};d.getId=function(){return"google"};d.getUrl=function(){return"https://translate.google.com/"};d.parseError=function(c){if(c.error){for(var b=[],a=c.error.errors||[],d=a.length,e=-1;++e<d;)b.push(a[e].message||"");return"Error "+c.error.code+": "+b.join(";")}return""};d.batch=function(c,b,a,d){function e(a){for(var g=c.length,k=-1,h;++k<g&&(h=a[k]||{},!1!==d(c[k],h.translatedText||"",b)););}
|
175 |
+
var g=this;a=a?"html":"text";var k=g.mapLang(b,m.require("$42","google.json"));return g._call({url:"https://translation.googleapis.com/language/translate/v2?source=en&target="+k+"&format="+a,method:"POST",traditional:!0,data:{key:g.key(),q:c}}).done(function(a,b,c){a.data?e(a.data.translations||[]):(g.stderr(g.parseError(a)||g.httpError(c)),e([]))}).fail(function(){e([])})};return new l};return g}({},v,x));m.register("$43",{nn:["no"],pt:["pt","pt-pt"],sr:["sr-Cyrl","sr-Latn"],sr_RS:["sr-Cyrl"],tlh:["tlh-Latn",
|
176 |
+
"tlh-Piqd"],zh:["zh-Hans","zh-Hant"],zh_CN:["zh-Hans"],zh_HK:["zh-Hans"],zh_SG:["zh-Hans"],zh_TW:["zh-Hant"]});m.register("$33",function(g,e,h){function l(){}g.create=function(d){d=l.prototype=new d;d.toString=function(){return"Microsoft Translator text API"};d.getId=function(){return"microsoft"};d.getUrl=function(){return"https://aka.ms/MicrosoftTranslatorAttribution"};d.parseError=function(c){return c&&c.error?c.error.message:""};d.batch=function(c,b,a,d){function e(a){for(var g=-1,k;++g<h&&(k=
|
177 |
+
a[g]||{},k=k.translations||[],k=k[0]||{},!1!==d(c[g],k.text||"",b)););}var g=this,k=[],h=c.length,l=-1;a=a?"html":"plain";for(var q=g.mapLang(b,m.require("$43","ms.json"));++l<h;)k.push({text:c[l]});return g._call({url:"https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to="+q+"&textType="+a,method:"POST",data:JSON.stringify(k),headers:{"Content-Type":"application/json; charset=UTF-8","Ocp-Apim-Subscription-Key":this.key(),"Ocp-Apim-Subscription-Region":g.param("region")||
|
178 |
+
"global"}}).done(function(a,b,c){a&&a.length?e(a):(g.stderr(g.parseError(a)||g.httpError(c)),e([]))}).fail(function(){e([])})};return new l};return g}({},v,x));m.register("$44",{pt:["pt-PT","pt-BR"]});m.register("$34",function(g,e,h){function l(){}g.create=function(d){d=l.prototype=new d;d.toString=function(){return"DeepL Translator"};d.getId=function(){return"deepl"};d.getUrl=function(){return"https://www.deepl.com/translator"};d.parseError=function(c){return c.message};d.batch=function(c,b,a,d){function e(a){for(var g=
|
179 |
+
c.length,h=-1,l;++h<g&&(l=a[h]||{},!1!==d(c[h],l.text||"",b)););}var g=this;a=g.mapLang(b,m.require("$44","deepl.json"));return g._call({url:"https://api.deepl.com/v2/translate",method:"POST",traditional:!0,data:{source_lang:"EN",target_lang:a.toUpperCase(),preserve_formatting:"1",auth_key:g.key(),text:c}}).done(function(a,b,c){a.translations?e(a.translations):(g.stderr(g.parseError(a)||g.httpError(c)),e([]))}).fail(function(){e([])})};return new l};return g}({},v,x));m.register("$35",function(g,
|
180 |
+
e,m){function l(){}g.create=function(d){(l.prototype=new d).batch=function(c,b,a,d){function g(a){for(var e=c.length,k=-1;++k<e&&!1!==d(c[k],a[k],b););}var l=e.loco.ajax;a={hook:this.getId(),type:a?"html":"text",locale:String(b),sources:c};var k=h.Deferred();this.abortable(l.post("apis",a,function(a){g(a&&a.targets||[]);k.resolve()},function(){g([]);k.reject()}));return k.promise()};return new l};return g}({},v,x));m.register("$18",function(g,e,v){function l(){this.inf={}}function d(){var a=v.createElement("p"),
|
181 |
+
b=/&(#\d+|#x[0-9a-f]|[a-z]+);/i,c=/<[a-z]+\s/i,d,e;return{sniff:function(g){if(g===d)return e;d=g;if(b.test(g)||c.test(g))if(a.innerHTML=g,a.textContent!==g)return e=!0;return e=!1}}}var c=l.prototype;c.init=function(a){this.inf=a||{}};c.param=function(a){return this.inf[a]||""};c.key=function(){return this.param("key")};c.getId=function(){return this.param("id")||"none"};c.getUrl=function(){return this.param("url")||"#"};c.toString=function(){return this.param("name")||this.getId()};c.stderr=function(a){var b=
|
182 |
+
(e.loco||{}).notices||e.console;b&&b.error&&b.error(String(this)+": "+String(a))};c.httpError=function(a){return(a=a&&a.status)&&200!==a?"Responded status "+a:"Unknown error"};c.parseError=function(){return""};c.mapLang=function(a,b){var c=String(a).replace("-","_"),d=a.lang,e=b[c]||b[d]||[],g=e.length;if(0===g)return d;if(1<g)for(var c=c.toLowerCase(),d=-1,h;++d<g;)if(h=e[d],h.toLowerCase().replace("-","_")===c)return h;return e[0]};c.translate=function(a,b,c){return this.batch([a],b,this.isHtml(a),
|
183 |
+
c)};c.batch=function(){return{always:function(a){a()}}};c._call=function(a){var b=this;b.state=null;a.cache=!0;a.dataType="json";a.error=function(a,c,d){try{var e=a.responseText,g=e&&m.require("$5","json.js").parse(e);d=g&&b.parseError(g)||d}catch(h){}b.stderr(d||b.httpError(a))};return b.abortable(h.ajax(a))};c.abortable=function(a){var b=this;a.always(function(){b.$r===a&&(b.$r=null)});return b.$r=a};c.abort=function(){var a=this.$r;a&&a.abort()};c.isHtml=function(a){return(b||(b=d())).sniff(a)};
|
184 |
+
c.createJob=function(){return m.require("$30","job.js").create(this)};g.create=function(a){var b;b=a.id;b="yandex"===b?m.require("$31","yandex.js").create(l):"google"===b?m.require("$32","google.js").create(l):"microsoft"===b?m.require("$33","ms.js").create(l):"deepl"===b?m.require("$34","deepl.js").create(l):m.require("$35","custom.js").create(l);b.init(a);return b};g.suggest=function(a,b,c,d){var e,g,h=a.length;for(e=0;e<h;e++)g=a[e],g.translate(b,c,d)};var b;return g}({},v,x));m.register("$19",
|
185 |
+
function(g,e,m){g.init=function(g){function d(){H||(I.click(k),H=h('<div id="loco-fs-creds"></div>').dialog({dialogClass:"request-filesystem-credentials-dialog loco-modal",minWidth:580,modal:!0,autoOpen:!1,closeOnEscape:!0}).on("change",'input[name="connection_type"]',function(){this.checked&&h("#ssh-keys").toggleClass("hidden","ssh"!==h(this).val())}));return H}function c(){R&&(b(h(p)),R=!1);if(C&&J){var a=J,c=h(Q);c.find("span.loco-msg").text(a);K||(c.removeClass("jshide").hide().fadeIn(500),K=
|
186 |
+
!0)}else K&&(b(h(Q)),K=!1)}function b(a){a.slideUp(250).fadeOut(250,function(){h(this).addClass("jshide")})}function a(){if(C)return H&&H.dialog("close"),c(),h(g).find('button[type="submit"]').attr("disabled",!1),h(e).triggerHandler("resize"),B&&B(!0),!0;w&&H?(R||(h(p).removeClass("jshide").hide().fadeIn(500),R=!0),K&&(b(h(Q)),K=!1)):c();h(g).find('input[type="submit"]').attr("disabled",!0);B&&B(!1);return!1}function f(a){var b,c,d=s||{};for(b in d)d.hasOwnProperty(b)&&(c=d[b],a[b]?a[b].value=c:h('<input type="hidden" />').attr("name",
|
187 |
+
b).appendTo(a).val(c))}function n(a){a.preventDefault();a=h(a.target).serializeArray();q(a);D=!0;return!1}function r(a){a.preventDefault();H.dialog("close");return!1}function k(a){a.preventDefault();H.dialog("open").find('input[name="connection_type"]').change();return!1}function v(b){C=b.authed;y=b.method;h(p).find("span.loco-msg").text(b.message||"Something went wrong.");J=b.warning||"";b.notice&&u.notices.info(b.notice);if(C)"direct"!==y&&(s=b.creds,f(g),D&&b.success&&u.notices.success(b.success)),
|
188 |
+
a();else if(b.reason)u.notices.info(b.reason);else if(b=b.prompt){var c=d();c.html(b).find("form").submit(n);c.dialog("option","title",c.find("h2").remove().text());c.find("button.cancel-button").show().click(r);c.find('input[type="submit"]').addClass("button-primary");a();h(e).triggerHandler("resize")}else u.notices.error("Server didn't return credentials, nor a prompt for credentials")}function x(){a()}function q(a){D=!1;u.ajax.setNonce("fsConnect",N).post("fsConnect",a,v,x);return a}var s,B,p=
|
189 |
+
g,y=null,D=!1,C=!1,u=e.loco,w=g.path.value,F=g.auth.value,N=g["loco-nonce"].value,I=h(p).find("button.button-primary"),Q=m.getElementById(p.id+"-warn"),R=!1,K=!1,J="",H;u.notices.convert(Q).stick();g.connection_type?(s={},s.connection_type=g.connection_type.value,C=!0):w&&F&&q({path:w,auth:F});a();return{applyCreds:function(a){if(a.nodeType)f(a);else{var b,c=s||{};for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b])}return this},setForm:function(b){g=b;a();f(b);return this},connect:function(){w=g.path.value;
|
190 |
+
F=g.auth.value;q(h(g).serializeArray());return this},listen:function(a){B=a;C&&a(!0);return this},authed:function(){return C}}};return g}({},v,x));m.register("$20",function(g,e,v){function l(e,g,h,k){g="n"===h?c(g):b(g);k&&(g=a(g));return d([].sort,[g])(e)}function d(a,b){return function(c){a.apply(c,b);return c}}function c(a){return function(b,c){var d=b&&b[a]||0,e=c&&c[a]||0;return d===e?0:d>e?1:-1}}function b(a){return function(b,c){return(b&&b[a]||"").localeCompare(c&&c[a]||"")}}function a(a){return function(b,
|
191 |
+
c){return-1*a(b,c)}}g.init=function(a){function b(a){var c=-1,d=a.length;for(h("tr",p).remove();++c<d;)p.appendChild(a[c].$)}function c(a){q=a?x.find(a,d):d.slice(0);v&&(a=e[v],q=l(q,v,a.type,a.desc));b(q)}var d=[],e=[],g=0,q,s,v,p=a.getElementsByTagName("tbody")[0],y=a.getElementsByTagName("thead")[0],x=m.require("$10","fulltext.js").init();y&&p&&(h("th",y).each(function(a,c){var f=c.getAttribute("data-sort-type");f&&(a=g,h(c).addClass("loco-sort").click(function(c){c.preventDefault();c=a;var f=
|
192 |
+
e[c],g=f.type,m=!(f.desc=!f.desc);q=l(q||d.slice(0),c,g,m);b(q);s&&s.removeClass("loco-desc loco-asc");s=h(f.$).addClass(m?"loco-desc":"loco-asc").removeClass(m?"loco-asc":"loco-desc");v=c;return!1}),e[g]={$:c,type:f});c.hasAttribute("colspan")?g+=Number(c.getAttribute("colspan")):g++}),h("tr",p).each(function(a,b){var c,f,g,h=[],l={_:a,$:b},m=b.getElementsByTagName("td");for(f in e){c=m[f];(g=c.textContent.replace(/(^\s+|\s+$)/g,""))&&h.push(g);c.hasAttribute("data-sort-value")&&(g=c.getAttribute("data-sort-value"));
|
193 |
+
switch(e[f].type){case "n":g=Number(g)}l[f]=g}d[a]=l;x.index(a,h)}),a=h('form.loco-filter input[type="text"]',a.parentNode),a.length&&(a=a[0],y=h(a.form),1<d.length?m.require("$11","LocoTextListener.js").listen(a,c):y.hide(),y.on("submit",function(a){a.preventDefault();return!1})))};return g}({},v,x));var D=v.loco||{},I=D.conf||{$v:[0,0]};v=m.require("$1","t.js").init();x=I.wplang;D.version=function(g){return I.$v[g||0]};m.require("$2","html.js");m.require("$3","number.js");m.require("$4","array.js");
|
194 |
+
m.require("$5","json.js");D.l10n=v;v.load(I.wpl10n);x&&v.pluraleq(x.pluraleq);D.string=m.require("$6","string.js");D.notices=m.require("$7","notices.js").init(v);D.ajax=m.require("$8","ajax.js").init(I).localise(v);D.locale=m.require("$9","wplocale.js");D.fulltext=m.require("$10","fulltext.js");D.watchtext=m.require("$11","LocoTextListener.js").listen;D.tooltip=m.require("$12","tooltip.js");D.po={ed:m.require("$13","poedit.js"),kbd:m.require("$14","hotkeys.js"),init:m.require("$15","po.js").create,
|
195 |
+
ace:m.require("$16","ace.js").strf("php"),ref:m.require("$17","refs.js")};D.apis=m.require("$18","apis.js");D.fs=m.require("$19","fsconn.js");h("#loco-admin.wrap table.wp-list-table").each(function(g,e){m.require("$20","tables.js").init(e)});D.validate=function(g){return"2.4.5"!==(/^\d+\.\d+\.\d+/.exec(g&&g[0]||"")&&RegExp.lastMatch)?(D.notices.warn("admin.js is the wrong version (2.4.5). Please empty all relevant caches and reload this page."),!1):!0}})(window,document,window.jQuery);
|
|
|
|
|
|
|
|
pub/js/min/editor.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(S,C){var _=S.loco,i=_&&_.conf,p=document.getElementById("loco-editor-inner");if(_&&i&&p){var D,r,t,z,h,l,f=!!i.WP_DEBUG,s=_.po.ref&&_.po.ref.init(_,i),c=null,a=null,o=i.multipart,T=_.l10n,b=_.string.sprintf,I=i.locale,y=_.po.init(I).wrap(i.powrap),u=!I,n=document.getElementById("loco-actions"),d=i.popath,g=i.potpath,e=document.getElementById("loco-fs"),v=e&&_.fs.init(e),m=i.readonly,w=!m,j={},x=0,k={my:"top",at:"top",of:"#loco-content"};!o||S.FormData&&S.Blob||(o=!1,_.notices.warn("Your browser doesn't support Ajax file uploads. Falling back to standard postdata")),s||_.notices.warn("admin.js is out of date. Please empty your browser cache and reload the page.");var M,L,E=(L=parseInt(C(p).css("min-height")||0),function(){var t=function(t,n){for(var o=t.offsetTop||0;(t=t.offsetParent)&&t!==n;)o+=t.offsetTop||0;return o}(p,document.body),n=S.innerHeight,o=Math.max(L,n-t-20);M!==o&&(p.style.height=String(o)+"px",M=o)});E(),C(S).resize(E),p.innerHTML="",D=_.po.ed.init(p).localise(T),_.po.kbd.init(D).add("save",w?function(){D.dirty&&R()}:W).add("hint",I&&w&&A||W).enable("copy","clear","enter","next","prev","fuzzy","save","invis","hint");var U={save:w&&function(n){function o(){n.disabled=!0}function t(){n.disabled=!1}function e(){t(),C(n).removeClass("loco-loading")}return n,D.on("poUnsaved",function(){t(),C(n).addClass("button-primary")}).on("poSave",function(){o(),C(n).removeClass("button-primary")}),a=C.extend({path:d},i.project||{}),C(n).click(function(t){return t.preventDefault(),o(),C(n).addClass("loco-loading"),R(e),!1}),!0},sync:w&&function(n){var t=i.project;if(t){function o(){n.disabled=!0}function e(){n.disabled=!1}function a(){e(),C(n).removeClass("loco-loading")}D.on("poUnsaved",function(){o()}).on("poSave",function(){e()}),c={bundle:t.bundle,domain:t.domain,type:u?"pot":"po",sync:g||"",strip:"pot"===String(i.syncmode).toLowerCase()?"1":""},C(n).click(function(t){return t.preventDefault(),o(),C(n).addClass("loco-loading"),P(a),!1}),e()}return!0},revert:function(t){return D.on("poUnsaved",function(){t.disabled=!1}).on("poSave",function(){t.disabled=!0}),C(t).click(function(t){return t.preventDefault(),location.reload(),!1}),!0},invs:function(t){var o=C(t);return t.disabled=!1,D.on("poInvs",function(t,n){o[n?"addClass":"removeClass"]("inverted")}),o.click(function(t){return t.preventDefault(),D.setInvs(!D.getInvs()),!1}),_.tooltip.init(o),!0},code:function(t){var o=C(t);return t.disabled=!1,o.click(function(t){t.preventDefault();var n=!D.getMono();return o[n?"addClass":"removeClass"]("inverted"),D.setMono(n),!1}),_.tooltip.init(o),!0},source:$,binary:u?null:$};u?(U.add=w&&function(t){return t.disabled=!1,C(t).click(function(t){t.preventDefault();var n,o=1,e=/(\d+)$/;for(n="New message";y.get(n);)o=e.exec(n)?Math.max(o,RegExp.$1):o,n="New message "+ ++o;return D.add(n),!1}),!0},U.del=w&&function(t){return t.disabled=!1,C(t).click(function(t){return t.preventDefault(),D.del(),!1}),!0}):U.auto=function(t){function n(){t.disabled=!1}return D.on("poUnsaved",function(){t.disabled=!0}).on("poSave poAuto",function(){n()}),C(t).click(F),n(),!0},C("#loco-editor > nav .button").each(function(t,n){var o=n.getAttribute("data-loco"),e=U[o];e&&e(n,o)||C(n).addClass("loco-noop")}),C(n).submit(W),function(n){function e(t){C(n.parentNode)[t||null==t?"removeClass":"addClass"]("invalid")}D.searchable(_.fulltext.init()),n.disabled=!1,n.value="";var a=_.watchtext(n,function(t){e(D.filter(t,!0))});D.on("poFilter",function(t,n,o){a.val(n||""),e(o)}).on("poMerge",function(t,n){var o=a.val();o&&D.filter(o)})}(document.getElementById("loco-search")),D.on("poUnsaved",function(){S.onbeforeunload=H}).on("poSave",function(){Y(),S.onbeforeunload=null}).on("poHint",A).on("poUpdate",Y).on("poMeta",function(t,n){var o,e,a=(e="CODE",(o=n).tagName===e?o:o.getElementsByTagName(e)[0]);return!a||!s||(s.load(a.textContent),t.preventDefault(),!1)}),y.load(i.podata),D.load(y),(I=D.targetLocale)?I.isRTL()&&C(p).addClass("trg-rtl"):D.unlock(),Y(),delete _.conf,i=U=null}function P(d){_.ajax.post("sync",c,function(t){var n=[],o=y,e=t.po,a=t.pot,i=_.po.init().load(e),r=o.merge(i),l=r.add.length,s=r.del.length,c=r.fuz.length,u=T;D.load(o),l||s||c?(a?n.push(b(u._("Merged from %s"),a)):n.push(u._("Merged from source code")),l&&n.push(b(u._n("1 new string added","%s new strings added",l),l)),s&&n.push(b(u._n("1 obsolete string removed","%s obsolete strings removed",s),s)),c&&n.push(b(u._n("1 string marked Fuzzy","%s strings marked Fuzzy",c),c)),C(p).trigger("poUnsaved",[]),Y(),f&&S.console&&function(t,n){function o(t){var n=t.source(),o=t.context();return o?"["+o+"] "+n:n}var e=-1,a=n.add.length;for(;++e<a;)t.log(" + "+o(n.add[e]));for(a=n.del.length,e=0;e<a;e++)t.log(" - "+o(n.del[e]));for(a=n.fuz.length,e=0;e<a;e++)t.log(" ~ "+o(n.fuz[e]))}(console,r)):a?n.push(b(u._("Strings up to date with %s"),a)):n.push(u._("Strings up to date with source code")),_.notices.success(n.join(". ")),C(p).trigger("poMerge",[t]),d&&d()},d)}function q(){return t=t||function(){for(var t,n=-1,o=[],e=r,a=e.length;++n<a;)try{t=e[n],o.push(_.apis.create(t))}catch(t){_.notices.error(String(t))}return o}()}function B(e){var a;function i(){return(new Date).getTime()}u||m?_.notices.error("Logic error. APIs not available in current mode"):null==r||0===r.length||10<Math.round((i()-x)/1e3)?(l&&l.remove(),l=null,h&&h.remove(),h=null,z&&z.remove(),r=z=null,a=C('<div><div class="loco-loading"></div></div>').dialog({dialogClass:"loco-modal loco-modal-no-close",appendTo:"#loco-admin.wrap",title:"Loading..",modal:!0,autoOpen:!0,closeOnEscape:!1,resizable:!1,draggable:!1,position:k,height:200}),_.ajax.get("apis",{locale:String(I)},function(t,n,o){x=i(),0===(r=t&&t.apis||[]).length?l=O("loco-apis-empty",t.html):h=O("loco-apis-batch",t.html),a.remove(),e(r)})):(x=i(),e(r))}function O(t,n){var o=C(n);return o.attr("id",t),o.dialog({dialogClass:"loco-modal",appendTo:"#loco-admin.wrap",title:o.attr("title"),modal:!0,autoOpen:!1,closeOnEscape:!0,resizable:!1,draggable:!1,position:k}),o}function A(){B(function(t){t.length?function(){var p=T,t=D.current(),n=D.getTargetOffset(),o=t&&t.source(null,n),f='lang="'+String(I)+'" dir="'+(I.isRTL()?"RTL":"LTR")+'"',g=99;if(!o)return;function e(t){return!t.isDefaultPrevented()&&(!(0<=(n=t.which-49)&&n<10&&(o=m&&m.find("button.button-primary").eq(n))&&1===o.length)||(t.preventDefault(),t.stopPropagation(),o.click(),!1));var n,o}function a(t,n,o,e){var a=e.getId(),i=x[a],r=String(i+1),l=e.getUrl(),s=p._("Use this translation"),c=String(e),u=y&&y[a],d=C('<button class="button button-primary"></button>').attr("tabindex",String(1+g+i)).on("click",function(e,a){return function(t){t.preventDefault(),t.stopPropagation(),v();var n=D.current(),o=D.getTargetOffset();n&&n.source(null,o)===e?(n.translate(a,o),D.focus().reloadMessage(n)):_.notices.warn("Source changed since suggestion")}}(t,n));d.attr("accesskey",r),1<h.length&&(s+=" ("+r+")"),d.text(s),u&&u.replaceWith(C('<div class="loco-api loco-api-'+a+'"></div>').append(C('<a class="loco-api-credit" target="_blank" tabindex="-1"></a>').attr("href",l).text(c)).append(C("<blockquote "+f+"></blockquote>").text(n||"FAILED")).append(d)),++w===b&&(m&&m.dialog("option","title",p._("Suggested translations")+" — "+o.label),g+=w),0===i&&d.focus()}function v(t){m&&null==t&&m.dialog("close"),y=m=null,C(S).off("keydown",e)}function i(e){return function(t,n,o){a(t,u[e.getId()]=n,o,e)}}var m=(z=z||O("loco-apis-hint","<div></div>")).html("").append(C('<div class="loco-api"><p>Source text:</p></div>').append(C('<blockquote lang="en"></blockquote>').text(o))).dialog("option","title",p._("Loading suggestions")+"...").off("dialogclose").on("dialogclose",v).dialog("open"),r=t.translation(n);r&&C('<div class="loco-api"><p>Current translation:</p></div>').append(C("<blockquote "+f+"></blockquote>").text(r)).append(C('<button class="button"></button>').attr("tabindex",String(++g)).text(p._("Keep this translation")).on("click",function(t){t.preventDefault(),v()})).appendTo(m);var l,s,h=q(),b=h.length,c=-1,u=j[o]||(j[o]={}),y={},w=0,x={};for(;++c<b;)l=h[c],m.append((d=l,void 0,k=C('<div class="loco-api loco-api-loading"></div>').text("Calling "+d+" ..."),y[d.getId()]=k)),s=l.getId(),x[s]=c,u[s]?a(o,u[s],I,l):l.translate(o,I,i(l));var d,k;C(S).on("keydown",e)}():N()})}function F(t){return t.preventDefault(),B(function(t){t.length?function(){var e,a,i,r=0,l=T,n=!1,s=h.dialog("open"),t=s.find("form"),c=t.find("button.button-primary"),o=C("#loco-job-progress");function u(){c[0].disabled=!0}function d(){c.removeClass("loco-loading")}function p(t){o.text(t)}function f(t){var n=function(t){for(var n,o=q(),e=o.length,a=-1;++a<e;)if((n=o[a]).getId()===t)return n;_.notices.error("No "+t+" client")}(C(t.api).val()),o=t.existing.checked;p("Calculating...."),(e=n.createJob()).init(y,o),a=n.toString(),p(b(l._("%s unique source strings."),e.length.format(0))+" "+b(l._("%s characters will be sent for translation."),e.chars.format(0))),e.length?c[0].disabled=!1:u(),i=null}function g(t){e&&(n&&t.fuzzy(0,!0),D.pasteMessage(t),t===D.active&&D.setStatus(t),D.unsave(t,0),r++)}function v(t,n){var o=n?100*t/n:0;p(b(l._("Translation progress %s%%"),o.format(0)))}function m(){if(d(),e&&i){var t=i.todo();t&&_.notices.warn(b(l._n("Translation job aborted with one string remaining","Translation job aborted with %s strings remaining",t),t.format(0))).slow();var n=[],o=i.did();o&&n.push(b(l._n("%s string translated via %s","%s strings translated via %s",o),o.format(0),a)),r?n.push(b(l._n("%s string updated","%s strings updated",r),r.format(0))):n.push(l._("Nothing needed updating")),_.notices.success(n.join(". ")).slow(),i=e=null}r&&(Y(),D.rebuildSearch()),s&&(s.off("dialogclose").dialog("close"),s=null),D.fire("poAuto")}d(),u(),_.notices.clear(),t.off("submit change"),f(t[0]),t.on("change",function(t){var n=t.target,o=n.name;return"api"!==o&&"existing"!==o||f(n.form),!0}).on("submit",function(t){t.preventDefault(),c.addClass("loco-loading"),u(),v(r=0),n=t.target.fuzzy.checked,i=e.dispatch().done(m).each(g).prog(v).stat()}),s.off("dialogclose").on("dialogclose",function(){e.abort(),s=null,m()})}():N()}),!1}function N(){l?l.dialog("open"):_.notices.error("Logic error. Unconfigured API modal missing")}function R(n){var t=C.extend({locale:String(y.locale()||"")},a||{});v&&v.applyCreds(t),o?(t=function(t){var n,o=new FormData;for(n in t)t.hasOwnProperty(n)&&o.append(n,t[n]);return o}(t)).append("po",new Blob([String(y)],{type:"application/x-gettext"}),String(t.path).split("/").pop()||"untitled.po"):t.data=String(y),_.ajax.post("save",t,function(t){n&&n(),D.save(!0),C("#loco-po-modified").text(t.datetime||"[datetime error]")},n)}function H(){return T._("Your changes will be lost if you continue without saving")}function $(e,a){return e.disabled=!1,C(e).click(function(t){var n=e.form,o=d;return"binary"===a&&(o=o.replace(/\.po$/,".mo")),n.path.value=o,n.source.value=y.toString(),!0}),!0}function W(t){return t.preventDefault(),!1}function Y(){var t=T,n=D.stats(),o=n.t,e=n.f,a=n.u,i=b(t._n("1 string","%s strings",o),o.format(0)),r=[];I&&(i=b(t._("%s%% translated"),n.p.replace("%",""))+", "+i,e&&r.push(b(t._("%s fuzzy"),e.format(0))),a&&r.push(b(t._("%s untranslated"),a.format(0))),r.length&&(i+=" ("+r.join(", ")+")")),C("#loco-po-status").text(i)}}(window,window.jQuery);
|
1 |
+
!function(k,C){var _=k.loco,i=_&&_.conf,u=document.getElementById("loco-editor-inner");if(_&&i&&u){var D,r,t,z,m,l,d=!!i.WP_DEBUG,s=_.po.ref&&_.po.ref.init(_,i),p=null,a=null,o=i.multipart,T=_.l10n,b=_.string.sprintf,I=i.locale,y=_.po.init(I).wrap(i.powrap),c=!I,n=document.getElementById("loco-actions"),f=i.popath,g=i.potpath,v=String(i.syncmode).toLowerCase(),e=document.getElementById("loco-fs"),h=e&&_.fs.init(e),w=i.readonly,x=!w,j={},S=0,M={my:"top",at:"top",of:"#loco-content"};!o||k.FormData&&k.Blob||(o=!1,_.notices.warn("Your browser doesn't support Ajax file uploads. Falling back to standard postdata")),s||_.notices.warn("admin.js is out of date. Please empty your browser cache and reload the page.");var L,E,U=(E=parseInt(C(u).css("min-height")||0),function(){var t=function(t,n){for(var o=t.offsetTop||0;(t=t.offsetParent)&&t!==n;)o+=t.offsetTop||0;return o}(u,document.body),n=k.innerHeight,o=Math.max(E,n-t-20);L!==o&&(u.style.height=String(o)+"px",L=o)});U(),C(k).resize(U),u.innerHTML="",D=_.po.ed.init(u).localise(T),_.po.kbd.init(D).add("save",x?function(){D.dirty&&H()}:Y).add("hint",I&&x&&F||Y).enable("copy","clear","enter","next","prev","fuzzy","save","invis","hint");var P={save:x&&function(n){function o(){n.disabled=!0}function t(){n.disabled=!1}function e(){t(),C(n).removeClass("loco-loading")}return n,D.on("poUnsaved",function(){t(),C(n).addClass("button-primary")}).on("poSave",function(){o(),C(n).removeClass("button-primary")}),a=C.extend({path:f},i.project||{}),C(n).click(function(t){return t.preventDefault(),o(),C(n).addClass("loco-loading"),H(e),!1}),!0},sync:x&&function(n){var t=i.project;if(t){function o(){n.disabled=!0}function e(){n.disabled=!1}function a(){e(),C(n).removeClass("loco-loading")}D.on("poUnsaved",function(){o()}).on("poSave",function(){e()}),p={bundle:t.bundle,domain:t.domain,type:c?"pot":"po",path:f||"",sync:g||"",strip:"pot"===v?"1":""},C(n).click(function(t){return t.preventDefault(),o(),C(n).addClass("loco-loading"),q(a),!1}),e()}return!0},revert:function(t){return D.on("poUnsaved",function(){t.disabled=!1}).on("poSave",function(){t.disabled=!0}),C(t).click(function(t){return t.preventDefault(),location.reload(),!1}),!0},invs:function(t){var o=C(t);return t.disabled=!1,D.on("poInvs",function(t,n){o[n?"addClass":"removeClass"]("inverted")}),o.click(function(t){return t.preventDefault(),D.setInvs(!D.getInvs()),!1}),_.tooltip.init(o),!0},code:function(t){var o=C(t);return t.disabled=!1,o.click(function(t){t.preventDefault();var n=!D.getMono();return o[n?"addClass":"removeClass"]("inverted"),D.setMono(n),!1}),_.tooltip.init(o),!0},source:W,binary:c?null:W};c?(P.add=x&&function(t){return t.disabled=!1,C(t).click(function(t){t.preventDefault();var n,o=1,e=/(\d+)$/;for(n="New message";y.get(n);)o=e.exec(n)?Math.max(o,RegExp.$1):o,n="New message "+ ++o;return D.add(n),!1}),!0},P.del=x&&function(t){return t.disabled=!1,C(t).click(function(t){return t.preventDefault(),D.del(),!1}),!0}):P.auto=function(t){function n(){t.disabled=!1}return D.on("poUnsaved",function(){t.disabled=!0}).on("poSave poAuto",function(){n()}),C(t).click(N),n(),!0},C("#loco-editor > nav .button").each(function(t,n){var o=n.getAttribute("data-loco"),e=P[o];e&&e(n,o)||C(n).addClass("loco-noop")}),C(n).submit(Y),function(n){function e(t){C(n.parentNode)[t||null==t?"removeClass":"addClass"]("invalid")}D.searchable(_.fulltext.init()),n.disabled=!1,n.value="";var a=_.watchtext(n,function(t){e(D.filter(t,!0))});D.on("poFilter",function(t,n,o){a.val(n||""),e(o)}).on("poMerge",function(t,n){var o=a.val();o&&D.filter(o)})}(document.getElementById("loco-search")),D.on("poUnsaved",function(){k.onbeforeunload=$}).on("poSave",function(){G(),k.onbeforeunload=null}).on("poHint",F).on("poUpdate",G).on("poMeta",function(t,n){var o,e,a=(e="CODE",(o=n).tagName===e?o:o.getElementsByTagName(e)[0]);return!a||!s||(s.load(a.textContent),t.preventDefault(),!1)}),y.load(i.podata),D.load(y),(I=D.targetLocale)?I.isRTL()&&C(u).addClass("trg-rtl"):D.unlock(),G(),delete _.conf,i=P=null}function q(c){_.ajax.post("sync",p,function(t){var n=[],o=t.pot,e=t.po,a=t.done||{add:[],del:[],fuz:[]},i=a.add.length,r=a.del.length,l=a.fuz.length,s=T;y.clear().load(e),D.load(y),i||r||l?(o?n.push(b(s._("Merged from %s"),o)):n.push(s._("Merged from source code")),i&&n.push(b(s._n("1 new string added","%s new strings added",i),i)),r&&n.push(b(s._n("1 obsolete string removed","%s obsolete strings removed",r),r)),l&&n.push(b(s._n("1 string marked Fuzzy","%s strings marked Fuzzy",l),l)),C(u).trigger("poUnsaved",[]),G(),d&&k.console&&function(t,n){var o=-1,e=n.add.length;for(;++o<e;)t.log(" + "+String(n.add[o]));for(e=n.del.length,o=0;o<e;o++)t.log(" - "+String(n.del[o]));for(e=n.fuz.length,o=0;o<e;o++)t.log(" ~ "+String(n.fuz[o]))}(console,a)):o?n.push(b(s._("Strings up to date with %s"),o)):n.push(s._("Strings up to date with source code")),_.notices.success(n.join(". ")),C(u).trigger("poMerge",[t]),c&&c()},c)}function B(){return t=t||function(){for(var t,n=-1,o=[],e=r,a=e.length;++n<a;)try{t=e[n],o.push(_.apis.create(t))}catch(t){_.notices.error(String(t))}return o}()}function O(e){var a;function i(){return(new Date).getTime()}c||w?_.notices.error("Logic error. APIs not available in current mode"):null==r||0===r.length||10<Math.round((i()-S)/1e3)?(l&&l.remove(),l=null,m&&m.remove(),m=null,z&&z.remove(),r=z=null,a=C('<div><div class="loco-loading"></div></div>').dialog({dialogClass:"loco-modal loco-modal-no-close",appendTo:"#loco-admin.wrap",title:"Loading..",modal:!0,autoOpen:!0,closeOnEscape:!1,resizable:!1,draggable:!1,position:M,height:200}),_.ajax.get("apis",{locale:String(I)},function(t,n,o){S=i(),0===(r=t&&t.apis||[]).length?l=A("loco-apis-empty",t.html):m=A("loco-apis-batch",t.html),a.remove(),e(r)})):(S=i(),e(r))}function A(t,n){var o=C(n);return o.attr("id",t),o.dialog({dialogClass:"loco-modal",appendTo:"#loco-admin.wrap",title:o.attr("title"),modal:!0,autoOpen:!1,closeOnEscape:!0,resizable:!1,draggable:!1,position:M}),o}function F(){O(function(t){t.length?function(){var p=T,t=D.current(),n=D.getTargetOffset(),o=t&&t.source(null,n),f='lang="'+String(I)+'" dir="'+(I.isRTL()?"RTL":"LTR")+'"',g=99;if(!o)return;function e(t){return!t.isDefaultPrevented()&&(!(0<=(n=t.which-49)&&n<10&&(o=h&&h.find("button.button-primary").eq(n))&&1===o.length)||(t.preventDefault(),t.stopPropagation(),o.click(),!1));var n,o}function a(t,n,o,e){var a=e.getId(),i=x[a],r=String(i+1),l=e.getUrl(),s=p._("Use this translation"),c=String(e),u=y&&y[a],d=C('<button class="button button-primary"></button>').attr("tabindex",String(1+g+i)).on("click",function(e,a){return function(t){t.preventDefault(),t.stopPropagation(),v();var n=D.current(),o=D.getTargetOffset();n&&n.source(null,o)===e?(n.translate(a,o),D.focus().reloadMessage(n)):_.notices.warn("Source changed since suggestion")}}(t,n));d.attr("accesskey",r),1<m.length&&(s+=" ("+r+")"),d.text(s),u&&u.replaceWith(C('<div class="loco-api loco-api-'+a+'"></div>').append(C('<a class="loco-api-credit" target="_blank" tabindex="-1"></a>').attr("href",l).text(c)).append(C("<blockquote "+f+"></blockquote>").text(n||"FAILED")).append(d)),++w===b&&(h&&h.dialog("option","title",p._("Suggested translations")+" — "+o.label),g+=w),0===i&&d.focus()}function v(t){h&&null==t&&h.dialog("close"),y=h=null,C(k).off("keydown",e)}function i(e){return function(t,n,o){a(t,u[e.getId()]=n,o,e)}}var h=(z=z||A("loco-apis-hint","<div></div>")).html("").append(C('<div class="loco-api"><p>Source text:</p></div>').append(C('<blockquote lang="en"></blockquote>').text(o))).dialog("option","title",p._("Loading suggestions")+"...").off("dialogclose").on("dialogclose",v).dialog("open"),r=t.translation(n);r&&C('<div class="loco-api"><p>Current translation:</p></div>').append(C("<blockquote "+f+"></blockquote>").text(r)).append(C('<button class="button"></button>').attr("tabindex",String(++g)).text(p._("Keep this translation")).on("click",function(t){t.preventDefault(),v()})).appendTo(h);var l,s,m=B(),b=m.length,c=-1,u=j[o]||(j[o]={}),y={},w=0,x={};for(;++c<b;)l=m[c],h.append((d=l,void 0,S=C('<div class="loco-api loco-api-loading"></div>').text("Calling "+d+" ..."),y[d.getId()]=S)),s=l.getId(),x[s]=c,u[s]?a(o,u[s],I,l):l.translate(o,I,i(l));var d,S;C(k).on("keydown",e)}():R()})}function N(t){return t.preventDefault(),O(function(t){t.length?function(){var e,a,i,r=0,l=T,n=!1,s=m.dialog("open"),t=s.find("form"),c=t.find("button.button-primary"),o=C("#loco-job-progress");function u(){c[0].disabled=!0}function d(){c.removeClass("loco-loading")}function p(t){o.text(t)}function f(t){var n=function(t){for(var n,o=B(),e=o.length,a=-1;++a<e;)if((n=o[a]).getId()===t)return n;_.notices.error("No "+t+" client")}(C(t.api).val()),o=t.existing.checked;p("Calculating...."),(e=n.createJob()).init(y,o),a=n.toString(),p(b(l._("%s unique source strings."),e.length.format(0))+" "+b(l._("%s characters will be sent for translation."),e.chars.format(0))),e.length?c[0].disabled=!1:u(),i=null}function g(t){e&&(n&&t.fuzzy(0,!0),D.pasteMessage(t),t===D.active&&D.setStatus(t),D.unsave(t,0),r++)}function v(t,n){var o=n?100*t/n:0;p(b(l._("Translation progress %s%%"),o.format(0)))}function h(){if(d(),e&&i){var t=i.todo();t&&_.notices.warn(b(l._n("Translation job aborted with one string remaining","Translation job aborted with %s strings remaining",t),t.format(0))).slow();var n=[],o=i.did();o&&n.push(b(l._n("%s string translated via %s","%s strings translated via %s",o),o.format(0),a)),r?n.push(b(l._n("%s string updated","%s strings updated",r),r.format(0))):n.push(l._("Nothing needed updating")),_.notices.success(n.join(". ")).slow(),i=e=null}r&&(G(),D.rebuildSearch()),s&&(s.off("dialogclose").dialog("close"),s=null),D.fire("poAuto")}d(),u(),_.notices.clear(),t.off("submit change"),f(t[0]),t.on("change",function(t){var n=t.target,o=n.name;return"api"!==o&&"existing"!==o||f(n.form),!0}).on("submit",function(t){t.preventDefault(),c.addClass("loco-loading"),u(),v(r=0),n=t.target.fuzzy.checked,i=e.dispatch().done(h).each(g).prog(v).stat()}),s.off("dialogclose").on("dialogclose",function(){e.abort(),s=null,h()})}():R()}),!1}function R(){l?l.dialog("open"):_.notices.error("Logic error. Unconfigured API modal missing")}function H(n){var t=C.extend({locale:String(y.locale()||"")},a||{});h&&h.applyCreds(t),o?(t=function(t){var n,o=new FormData;for(n in t)t.hasOwnProperty(n)&&o.append(n,t[n]);return o}(t)).append("po",new Blob([String(y)],{type:"application/x-gettext"}),String(t.path).split("/").pop()||"untitled.po"):t.data=String(y),_.ajax.post("save",t,function(t){n&&n(),D.save(!0),C("#loco-po-modified").text(t.datetime||"[datetime error]")},n)}function $(){return T._("Your changes will be lost if you continue without saving")}function W(e,a){return e.disabled=!1,C(e).click(function(t){var n=e.form,o=f;return"binary"===a&&(o=o.replace(/\.po$/,".mo")),n.path.value=o,n.source.value=y.toString(),!0}),!0}function Y(t){return t.preventDefault(),!1}function G(){var t=T,n=D.stats(),o=n.t,e=n.f,a=n.u,i=b(t._n("1 string","%s strings",o),o.format(0)),r=[];I&&(i=b(t._("%s%% translated"),n.p.replace("%",""))+", "+i,e&&r.push(b(t._("%s fuzzy"),e.format(0))),a&&r.push(b(t._("%s untranslated"),a.format(0))),r.length&&(i+=" ("+r.join(", ")+")")),C("#loco-po-status").text(i)}}(window,window.jQuery);
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: timwhitlock
|
|
3 |
Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity, multilingual, internationalization
|
4 |
Requires at least: 4.1
|
5 |
Requires PHP: 5.2.4
|
6 |
-
Tested up to: 5.5.
|
7 |
-
Stable tag: 2.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -100,6 +100,14 @@ We don't collect your data or snoop on you. See the [plugin privacy notice](http
|
|
100 |
|
101 |
== Changelog ==
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
= 2.4.4 =
|
104 |
* Added PO file upload feature
|
105 |
* Added download button to file info page
|
@@ -377,7 +385,7 @@ We don't collect your data or snoop on you. See the [plugin privacy notice](http
|
|
377 |
|
378 |
== Upgrade Notice ==
|
379 |
|
380 |
-
= 2.4.
|
381 |
* Various improvements and bugfixes
|
382 |
|
383 |
|
3 |
Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity, multilingual, internationalization
|
4 |
Requires at least: 4.1
|
5 |
Requires PHP: 5.2.4
|
6 |
+
Tested up to: 5.5.3
|
7 |
+
Stable tag: 2.4.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
100 |
|
101 |
== Changelog ==
|
102 |
|
103 |
+
= 2.4.5 =
|
104 |
+
* Added WP-CLI sync and extract commands
|
105 |
+
* Fixed {locale} placeholder bug introduced in 2.4.4
|
106 |
+
* Improved handling of invalid character encodings
|
107 |
+
* Sync (msgmerge) moved to back end
|
108 |
+
* New fuzzy matching with fuzziness setting
|
109 |
+
* Bumped WordPress version to 5.5.3
|
110 |
+
|
111 |
= 2.4.4 =
|
112 |
* Added PO file upload feature
|
113 |
* Added download button to file info page
|
385 |
|
386 |
== Upgrade Notice ==
|
387 |
|
388 |
+
= 2.4.5 =
|
389 |
* Various improvements and bugfixes
|
390 |
|
391 |
|
src/admin/bundle/LocaleController.php
CHANGED
@@ -66,7 +66,7 @@ class Loco_admin_bundle_LocaleController extends Loco_mvc_AdminController {
|
|
66 |
$files = $package->findTemplateFiles()->augment($files);
|
67 |
}
|
68 |
|
69 |
-
/* @var Loco_fs_File */
|
70 |
foreach( $files as $file ){
|
71 |
$nfiles++;
|
72 |
if( 'pot' !== $file->extension() ){
|
66 |
$files = $package->findTemplateFiles()->augment($files);
|
67 |
}
|
68 |
|
69 |
+
/* @var Loco_fs_File $file */
|
70 |
foreach( $files as $file ){
|
71 |
$nfiles++;
|
72 |
if( 'pot' !== $file->extension() ){
|
src/admin/file/EditController.php
CHANGED
@@ -70,10 +70,12 @@ class Loco_admin_file_EditController extends Loco_admin_file_BaseController {
|
|
70 |
|
71 |
// default is to permit editing of any file
|
72 |
$readonly = false;
|
|
|
|
|
|
|
73 |
|
74 |
// Establish if file belongs to a configured project
|
75 |
try {
|
76 |
-
$bundle = $this->getBundle();
|
77 |
$project = $this->getProject();
|
78 |
}
|
79 |
// Fine if not, this just means sync isn't possible.
|
70 |
|
71 |
// default is to permit editing of any file
|
72 |
$readonly = false;
|
73 |
+
|
74 |
+
// All files must belong to a bundle.
|
75 |
+
$bundle = $this->getBundle();
|
76 |
|
77 |
// Establish if file belongs to a configured project
|
78 |
try {
|
|
|
79 |
$project = $this->getProject();
|
80 |
}
|
81 |
// Fine if not, this just means sync isn't possible.
|
src/admin/init/InitPoController.php
CHANGED
@@ -272,7 +272,7 @@ class Loco_admin_init_InitPoController extends Loco_admin_bundle_BaseController
|
|
272 |
$writable = false;
|
273 |
$disabled = true;
|
274 |
}
|
275 |
-
$suffix =
|
276 |
$choice = new Loco_mvc_ViewParams( array (
|
277 |
'checked' => '',
|
278 |
'writable' => $writable,
|
@@ -280,7 +280,7 @@ class Loco_admin_init_InitPoController extends Loco_admin_bundle_BaseController
|
|
280 |
'systype' => $systype,
|
281 |
'parent' => Loco_mvc_FileParams::create( $parent ),
|
282 |
'hidden' => $pofile->getRelativePath($content_dir),
|
283 |
-
'holder' => str_replace( $suffix, '
|
284 |
) );
|
285 |
$sortable[] = $choice;
|
286 |
$locations[$typeId]['paths'][] = $choice;
|
272 |
$writable = false;
|
273 |
$disabled = true;
|
274 |
}
|
275 |
+
$suffix = $pofile->getSuffix().'.po';
|
276 |
$choice = new Loco_mvc_ViewParams( array (
|
277 |
'checked' => '',
|
278 |
'writable' => $writable,
|
280 |
'systype' => $systype,
|
281 |
'parent' => Loco_mvc_FileParams::create( $parent ),
|
282 |
'hidden' => $pofile->getRelativePath($content_dir),
|
283 |
+
'holder' => str_replace( $suffix, '<span>{locale}</span>.po', $pofile->basename() ),
|
284 |
) );
|
285 |
$sortable[] = $choice;
|
286 |
$locations[$typeId]['paths'][] = $choice;
|
src/admin/init/InitPotController.php
CHANGED
@@ -51,17 +51,6 @@ class Loco_admin_init_InitPotController extends Loco_admin_bundle_BaseController
|
|
51 |
|
52 |
// Establish default POT path whether it exists or not
|
53 |
$pot = $project->getPot();
|
54 |
-
while( ! $pot ){
|
55 |
-
$name = ( $slug ? $slug : $domain ).'.pot';
|
56 |
-
/* @var $dir Loco_fs_Directory */
|
57 |
-
foreach( $project->getConfiguredTargets() as $dir ){
|
58 |
-
$pot = new Loco_fs_File( $dir->getPath().'/'.$name );
|
59 |
-
break 2;
|
60 |
-
}
|
61 |
-
// unlikely to have no configured targets, but possible ... so default to standard
|
62 |
-
$pot = new Loco_fs_File( $bundle->getDirectoryPath().'/languages/'.$name );
|
63 |
-
break;
|
64 |
-
}
|
65 |
|
66 |
// POT should actually not exist at this stage. It should be edited instead.
|
67 |
if( $pot->exists() ){
|
51 |
|
52 |
// Establish default POT path whether it exists or not
|
53 |
$pot = $project->getPot();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
// POT should actually not exist at this stage. It should be edited instead.
|
56 |
if( $pot->exists() ){
|
src/admin/init/UploadController.php
CHANGED
@@ -69,7 +69,7 @@ class Loco_admin_init_UploadController extends Loco_admin_bundle_BaseController
|
|
69 |
}
|
70 |
$locations[$typeId]['paths'][] = new Loco_mvc_ViewParams( array(
|
71 |
'parent' => Loco_mvc_FileParams::create($parent),
|
72 |
-
'holder' => str_replace('
|
73 |
) );
|
74 |
}
|
75 |
// we don't know what the specifics will be until a location is chosen and a file is presented.
|
69 |
}
|
70 |
$locations[$typeId]['paths'][] = new Loco_mvc_ViewParams( array(
|
71 |
'parent' => Loco_mvc_FileParams::create($parent),
|
72 |
+
'holder' => str_replace('zxx.po','{locale}</span>.po', $pofile->basename() ),
|
73 |
) );
|
74 |
}
|
75 |
// we don't know what the specifics will be until a location is chosen and a file is presented.
|
src/admin/list/ThemesController.php
CHANGED
@@ -13,9 +13,7 @@ class Loco_admin_list_ThemesController extends Loco_admin_list_BaseController {
|
|
13 |
$this->set('type', 'theme' );
|
14 |
$this->set('title', __( 'Translate themes', 'loco-translate' ) );
|
15 |
|
16 |
-
|
17 |
-
foreach( wp_get_themes() as $theme ){
|
18 |
-
$bundle = Loco_package_Theme::create( $theme->get_stylesheet() );
|
19 |
$this->addBundle( $bundle );
|
20 |
}
|
21 |
|
13 |
$this->set('type', 'theme' );
|
14 |
$this->set('title', __( 'Translate themes', 'loco-translate' ) );
|
15 |
|
16 |
+
foreach( Loco_package_Theme::getAll() as $bundle ){
|
|
|
|
|
17 |
$this->addBundle( $bundle );
|
18 |
}
|
19 |
|
src/ajax/DownloadController.php
CHANGED
@@ -40,7 +40,7 @@ class Loco_ajax_DownloadController extends Loco_mvc_AjaxController {
|
|
40 |
$has_bom = "\xEF\xBB\xBF" === substr($raw,0,3);
|
41 |
$use_bom = (bool) Loco_data_Settings::get()->po_utf8_bom;
|
42 |
// only alter file if valid UTF-8. Deferring detection overhead until required
|
43 |
-
if( $has_bom !== $use_bom && '
|
44 |
if( $use_bom ){
|
45 |
$raw = "\xEF\xBB\xBF".$raw; // prepend
|
46 |
}
|
@@ -52,6 +52,5 @@ class Loco_ajax_DownloadController extends Loco_mvc_AjaxController {
|
|
52 |
|
53 |
return $raw;
|
54 |
}
|
55 |
-
|
56 |
-
|
57 |
-
}
|
40 |
$has_bom = "\xEF\xBB\xBF" === substr($raw,0,3);
|
41 |
$use_bom = (bool) Loco_data_Settings::get()->po_utf8_bom;
|
42 |
// only alter file if valid UTF-8. Deferring detection overhead until required
|
43 |
+
if( $has_bom !== $use_bom && preg_match('//u',$raw) ){
|
44 |
if( $use_bom ){
|
45 |
$raw = "\xEF\xBB\xBF".$raw; // prepend
|
46 |
}
|
52 |
|
53 |
return $raw;
|
54 |
}
|
55 |
+
|
56 |
+
}
|
|
src/ajax/MsginitController.php
CHANGED
@@ -77,14 +77,17 @@ class Loco_ajax_MsginitController extends Loco_ajax_common_BundleController {
|
|
77 |
}
|
78 |
}
|
79 |
// else parse POT file if project defines one that exists
|
80 |
-
else if( ( $potfile = $project->getPot() ) && $potfile->exists() ){
|
81 |
-
$data = Loco_gettext_Data::load($potfile);
|
82 |
-
}
|
83 |
-
// else extract directly from source code, assuming domain passed though from front end
|
84 |
else {
|
85 |
-
$
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
// Let template define Project-Id-Version, else set header to current project name
|
77 |
}
|
78 |
}
|
79 |
// else parse POT file if project defines one that exists
|
|
|
|
|
|
|
|
|
80 |
else {
|
81 |
+
$potfile = $project->getPot();
|
82 |
+
if( $potfile->exists() ){
|
83 |
+
$data = Loco_gettext_Data::load($potfile);
|
84 |
+
}
|
85 |
+
// else extract directly from source code, assuming domain passed though from front end
|
86 |
+
else {
|
87 |
+
$extr = new Loco_gettext_Extraction( $bundle );
|
88 |
+
$data = $extr->addProject($project)->includeMeta()->getTemplate($domain);
|
89 |
+
$potfile = null;
|
90 |
+
}
|
91 |
}
|
92 |
|
93 |
// Let template define Project-Id-Version, else set header to current project name
|
src/ajax/SyncController.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
<?php
|
|
|
2 |
/**
|
3 |
* Ajax "sync" route.
|
4 |
* Extracts strings from source (POT or code) and returns to the browser for in-editor merge.
|
@@ -17,21 +18,28 @@ class Loco_ajax_SyncController extends Loco_mvc_AjaxController {
|
|
17 |
if( ! $project instanceof Loco_package_Project ){
|
18 |
throw new Loco_error_Exception('No such project '.$post->domain);
|
19 |
}
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
$file = new Loco_fs_File( $post->path );
|
22 |
$base = loco_constant('WP_CONTENT_DIR');
|
23 |
$file->normalize($base);
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
$potfile = null;
|
28 |
}
|
29 |
-
// allow
|
30 |
-
else if( $
|
31 |
-
$potfile = new Loco_fs_File($
|
32 |
$potfile->normalize($base);
|
33 |
}
|
34 |
-
// else use project-configured template
|
35 |
else {
|
36 |
$potfile = $project->getPot();
|
37 |
}
|
@@ -43,22 +51,21 @@ class Loco_ajax_SyncController extends Loco_mvc_AjaxController {
|
|
43 |
$potfile = null;
|
44 |
}
|
45 |
|
46 |
-
//
|
47 |
if( $potfile ){
|
48 |
$this->set('pot', $potfile->basename() );
|
49 |
try {
|
50 |
-
$
|
51 |
}
|
52 |
catch( Exception $e ){
|
53 |
// translators: Where %s is the name of the invalid POT file
|
54 |
throw new Loco_error_ParseException( sprintf( __('Translation template is invalid (%s)','loco-translate'), $potfile->basename() ) );
|
55 |
}
|
56 |
-
//
|
57 |
-
|
58 |
-
|
59 |
-
}
|
60 |
}
|
61 |
-
// else
|
62 |
else {
|
63 |
$this->set('pot', '' );
|
64 |
$domain = (string) $project->getDomain();
|
@@ -75,11 +82,79 @@ class Loco_ajax_SyncController extends Loco_mvc_AjaxController {
|
|
75 |
// not failing, just warning. Nothing will be saved until user saves editor state
|
76 |
Loco_error_AdminNotices::warn( $text );
|
77 |
}
|
78 |
-
//
|
79 |
-
$
|
|
|
|
|
80 |
}
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
return parent::render();
|
85 |
}
|
1 |
+
<?php /** @noinspection DuplicatedCode */
|
2 |
+
|
3 |
/**
|
4 |
* Ajax "sync" route.
|
5 |
* Extracts strings from source (POT or code) and returns to the browser for in-editor merge.
|
18 |
if( ! $project instanceof Loco_package_Project ){
|
19 |
throw new Loco_error_Exception('No such project '.$post->domain);
|
20 |
}
|
21 |
+
|
22 |
+
// Merging on back end is only required if existing target file exists.
|
23 |
+
// Currently it always will and the editor is not permitted to contain unsaved changes when syncing.
|
24 |
+
if( ! $post->has('path') ){
|
25 |
+
throw new Loco_error_Exception('path argument required');
|
26 |
+
}
|
27 |
$file = new Loco_fs_File( $post->path );
|
28 |
$base = loco_constant('WP_CONTENT_DIR');
|
29 |
$file->normalize($base);
|
30 |
+
$target = Loco_gettext_Data::load($file);
|
31 |
+
|
32 |
+
// POT file always synced with source code
|
33 |
+
$type = $post->type;
|
34 |
+
if( 'pot' === $type ){
|
35 |
$potfile = null;
|
36 |
}
|
37 |
+
// allow front end to configure source file. (will have come from $target headers)
|
38 |
+
else if( $post->has('sync') ){
|
39 |
+
$potfile = new Loco_fs_File( $post->sync );
|
40 |
$potfile->normalize($base);
|
41 |
}
|
42 |
+
// else use project-configured template path
|
43 |
else {
|
44 |
$potfile = $project->getPot();
|
45 |
}
|
51 |
$potfile = null;
|
52 |
}
|
53 |
|
54 |
+
// Parse existing POT for source
|
55 |
if( $potfile ){
|
56 |
$this->set('pot', $potfile->basename() );
|
57 |
try {
|
58 |
+
$source = Loco_gettext_Data::load($potfile);
|
59 |
}
|
60 |
catch( Exception $e ){
|
61 |
// translators: Where %s is the name of the invalid POT file
|
62 |
throw new Loco_error_ParseException( sprintf( __('Translation template is invalid (%s)','loco-translate'), $potfile->basename() ) );
|
63 |
}
|
64 |
+
// Only copy msgstr fields from source if it's a user-defined PO template and "copy translations" was selected.
|
65 |
+
$strip = (bool) $post->strip;
|
66 |
+
$translate = 'pot' !== $potfile->extension() && ! $strip;
|
|
|
67 |
}
|
68 |
+
// else extract POT from source code
|
69 |
else {
|
70 |
$this->set('pot', '' );
|
71 |
$domain = (string) $project->getDomain();
|
82 |
// not failing, just warning. Nothing will be saved until user saves editor state
|
83 |
Loco_error_AdminNotices::warn( $text );
|
84 |
}
|
85 |
+
// Have source strings. These cannot contain any translations.
|
86 |
+
$source = $extr->includeMeta()->getTemplate($domain);
|
87 |
+
$translate = false;
|
88 |
+
$strip = false;
|
89 |
}
|
90 |
+
|
91 |
+
// establish on back end what strings will be added, removed, and which could be fuzzy-matches
|
92 |
+
$ntotal = 0;
|
93 |
+
$nmatched = 0;
|
94 |
+
$added = array();
|
95 |
+
$dropped = array();
|
96 |
+
$fuzzy = array();
|
97 |
+
// add latest valid sources to matching instance
|
98 |
+
$matcher = new LocoFuzzyMatcher;
|
99 |
+
/* @var LocoPoMessage $new */
|
100 |
+
foreach( $source as $new ){
|
101 |
+
$matcher->add($new);
|
102 |
+
$ntotal++;
|
103 |
+
}
|
104 |
+
// Fuzzy matching only applies to syncing PO files. POT files will always do hard sync (add/remove)
|
105 |
+
if( 'po' === $type ){
|
106 |
+
$fuzziness = Loco_data_Settings::get()->fuzziness;
|
107 |
+
$matcher->setFuzziness( (string) $fuzziness );
|
108 |
+
}
|
109 |
+
else {
|
110 |
+
$matcher->setFuzziness('0');
|
111 |
+
}
|
112 |
+
// update matches sources, deferring unmatched for deferred fuzzy match
|
113 |
+
$merged = clone $target;
|
114 |
+
$merged->clear();
|
115 |
+
/* @var LocoPoMessage $old */
|
116 |
+
foreach( $target as $old ){
|
117 |
+
$new = $matcher->match($old);
|
118 |
+
// if existing source is still valid, merge any changes
|
119 |
+
if( $new instanceof LocoPoMessage ){
|
120 |
+
$p = clone $old;
|
121 |
+
$p->merge($new,$translate);
|
122 |
+
$merged->push($p);
|
123 |
+
$nmatched++;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
// Attempt fuzzy matching after all exact matches have been processed
|
127 |
+
if( $nmatched !== $ntotal ){
|
128 |
+
foreach( $matcher->getFuzzyMatches() as $pair ){
|
129 |
+
list($old,$new) = $pair;
|
130 |
+
$p = clone $old;
|
131 |
+
$p->merge($new);
|
132 |
+
$merged->push($p);
|
133 |
+
$fuzzy[] = $p->getKey();
|
134 |
+
}
|
135 |
+
// Any unmatched strings remaining are NEW
|
136 |
+
/* @var LocoPoMessage $new */
|
137 |
+
foreach( $matcher->unmatched() as $new ){
|
138 |
+
$p = clone $new;
|
139 |
+
$strip and $p->strip();
|
140 |
+
$merged->push($p);
|
141 |
+
$added[] = $p->getKey();
|
142 |
+
}
|
143 |
+
// any deferred matches not resolved are dropped
|
144 |
+
/* @var LocoPoMessage $old */
|
145 |
+
foreach( $matcher->redundant() as $old ){
|
146 |
+
$dropped[] = $old->getKey();
|
147 |
+
}
|
148 |
+
}
|
149 |
+
// return to JavaScript with stats in the same form as old front end merge
|
150 |
+
$this->set( 'done', array (
|
151 |
+
'add' => $added,
|
152 |
+
'fuz' => $fuzzy,
|
153 |
+
'del' => $dropped,
|
154 |
+
) );
|
155 |
+
|
156 |
+
$merged->sort();
|
157 |
+
$this->set( 'po', $merged->jsonSerialize() );
|
158 |
|
159 |
return parent::render();
|
160 |
}
|
src/cli/Commands.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Loco Translate commands
|
4 |
+
*/
|
5 |
+
class Loco_cli_Commands {
|
6 |
+
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Sync translation files with the available source strings
|
10 |
+
*
|
11 |
+
* ## OPTIONS
|
12 |
+
*
|
13 |
+
* [<filter>]
|
14 |
+
* : Restrict to a type of bundle (plugins|themes|core) or a specific Text Domain
|
15 |
+
*
|
16 |
+
* [--locale=<code>]
|
17 |
+
* : Restrict to one or more locales. Separate multiple codes with commas.
|
18 |
+
*
|
19 |
+
* [--fuzziness=<percent>]
|
20 |
+
* : Override plugin settings for fuzzy matching tolerance (0-100).
|
21 |
+
*
|
22 |
+
* [--noop]
|
23 |
+
* : Specify dry run. Makes no changes on disk.
|
24 |
+
*
|
25 |
+
* ## EXAMPLES
|
26 |
+
*
|
27 |
+
* wp loco sync plugins
|
28 |
+
*
|
29 |
+
*
|
30 |
+
* @param string[]
|
31 |
+
* @param string[]
|
32 |
+
* @codeCoverageIgnore
|
33 |
+
*/
|
34 |
+
public function sync( $args, $opts ){
|
35 |
+
if( array_key_exists('fuzziness',$opts) ){
|
36 |
+
Loco_data_Settings::get()->fuzziness = (int) $opts['fuzziness'];
|
37 |
+
}
|
38 |
+
try {
|
39 |
+
Loco_cli_SyncCommand::run (
|
40 |
+
Loco_cli_Utils::collectProjects( isset($args[0]) ? $args[0] : '' ),
|
41 |
+
Loco_cli_Utils::collectLocales( isset($opts['locale']) ? $opts['locale'] : '' ),
|
42 |
+
Loco_cli_Utils::bool($opts,'noop')
|
43 |
+
);
|
44 |
+
}
|
45 |
+
catch( Loco_error_Exception $e ){
|
46 |
+
WP_CLI::error( $e->getMessage() );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Extract available source strings
|
53 |
+
*
|
54 |
+
* ## OPTIONS
|
55 |
+
*
|
56 |
+
* [<filter>]
|
57 |
+
* : Restrict to a type of bundle (plugins|themes|core) or a specific Text Domain
|
58 |
+
*
|
59 |
+
* [--maxsize=<size>]
|
60 |
+
* : Override plugin settings for maximum PHP file size
|
61 |
+
*
|
62 |
+
* [--noop]
|
63 |
+
* : Specify dry run. Makes no changes on disk.
|
64 |
+
*
|
65 |
+
* ## EXAMPLES
|
66 |
+
*
|
67 |
+
* wp loco extract core --maxsize=400K
|
68 |
+
*
|
69 |
+
* @param string[]
|
70 |
+
* @param string[]
|
71 |
+
* @codeCoverageIgnore
|
72 |
+
*/
|
73 |
+
public function extract( $args, $opts ){
|
74 |
+
try {
|
75 |
+
if( array_key_exists('maxsize',$opts) ){
|
76 |
+
Loco_data_Settings::get()->max_php_size = $opts['maxsize'];
|
77 |
+
}
|
78 |
+
Loco_cli_ExtractCommand::run (
|
79 |
+
Loco_cli_Utils::collectProjects( isset($args[0]) ? $args[0] : '' ),
|
80 |
+
Loco_cli_Utils::bool($opts,'noop')
|
81 |
+
);
|
82 |
+
}
|
83 |
+
catch( Loco_error_Exception $e ){
|
84 |
+
WP_CLI::error( $e->getMessage() );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
}
|
90 |
+
|
src/cli/ExtractCommand.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Called from Loco_cli_Commands::extract
|
4 |
+
*/
|
5 |
+
abstract class Loco_cli_ExtractCommand {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @param Loco_package_Project[] project filter
|
9 |
+
* @param bool whether dry run
|
10 |
+
*/
|
11 |
+
public static function run( array $projects, $noop = true ){
|
12 |
+
|
13 |
+
// track total number of POT files synced
|
14 |
+
$updated = 0;
|
15 |
+
$content_dir = loco_constant('WP_CONTENT_DIR');
|
16 |
+
|
17 |
+
/* @var Loco_package_Project $project */
|
18 |
+
foreach( $projects as $project ){
|
19 |
+
$id = rtrim( $project->getId(), '.' );
|
20 |
+
WP_CLI::log( sprintf('Extracting "%s" (%s)',$project->getName(),$id) );
|
21 |
+
// POT file may or may not exist currently
|
22 |
+
$potfile = $project->getPot();
|
23 |
+
if( ! $potfile ){
|
24 |
+
WP_CLI::warning('Skipping undefined POT');
|
25 |
+
continue;
|
26 |
+
}
|
27 |
+
if( $potfile->locked() ){
|
28 |
+
WP_CLI::warning('Skipping unwritable POT');
|
29 |
+
Loco_cli_Utils::tabulateFiles( $potfile->getParent(), $potfile );
|
30 |
+
continue;
|
31 |
+
}
|
32 |
+
// Do extraction and grab only given domain's strings
|
33 |
+
$ext = new Loco_gettext_Extraction( $project->getBundle() );
|
34 |
+
$domain = $project->getDomain()->getName();
|
35 |
+
$data = $ext->addProject($project)->includeMeta()->getTemplate( $domain );
|
36 |
+
Loco_cli_Utils::debug('Extraction OK, %u strings', count($data) );
|
37 |
+
$list = $ext->getSkipped();
|
38 |
+
if( $list ){
|
39 |
+
$current = Loco_data_Settings::get()->max_php_size;
|
40 |
+
$suggest = ceil( $ext->getMaxPhpSize() / 1024 );
|
41 |
+
WP_CLI::warning(sprintf('%u source files skipped over %s. Consider running with --maxsize=%uK',count($list),$current,$suggest) );
|
42 |
+
foreach( $list as $file ) {
|
43 |
+
$f = new Loco_mvc_FileParams(array(),$file);
|
44 |
+
Loco_cli_Utils::debug('%s (%s)', $f->relpath, $f->size );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
// if POT exists check if update is necessary.
|
48 |
+
$data->sort();
|
49 |
+
if( $potfile->exists() ){
|
50 |
+
try {
|
51 |
+
Loco_cli_Utils::debug('Checking if sources have changed since '.date('c',$potfile->modified()) );
|
52 |
+
$prev = Loco_gettext_Data::fromSource( $potfile->getContents() );
|
53 |
+
if( $prev->equal($data) ){
|
54 |
+
WP_CLI::log('No update required for '.$potfile->basename() );
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
catch( Loco_error_ParseException $e ){
|
59 |
+
Loco_cli_Utils::debug( $e->getMessage().' in '.$potfile->basename() );
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
if( $noop ){
|
64 |
+
WP_CLI::success( sprintf('**DRY RUN** would update %s', $potfile->basename() ) );
|
65 |
+
continue;
|
66 |
+
}
|
67 |
+
|
68 |
+
// additional headers to set in new POT file
|
69 |
+
$head = $data->getHeaders();
|
70 |
+
$head['Project-Id-Version'] = $project->getName();
|
71 |
+
|
72 |
+
// write POT file to disk returning byte length
|
73 |
+
Loco_cli_Utils::debug('Writing POT file...');
|
74 |
+
$bytes = $potfile->putContents( $data->msgcat(false) );
|
75 |
+
Loco_cli_Utils::debug(' %u bytes written to %s',$bytes, $potfile->getRelativePath($content_dir) );
|
76 |
+
WP_CLI::success( sprintf('Updated %s', $potfile->basename() ) );
|
77 |
+
$updated++;
|
78 |
+
}
|
79 |
+
|
80 |
+
// sync summary
|
81 |
+
if( 0 === $updated ){
|
82 |
+
WP_CLI::log('Nothing updated');
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
WP_CLI::success( sprintf('%u POT files written',$updated) );
|
86 |
+
}
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
}
|
src/cli/SyncCommand.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php /** @noinspection DuplicatedCode */
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Called from Loco_cli_Commands::sync
|
5 |
+
*/
|
6 |
+
abstract class Loco_cli_SyncCommand {
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @param Loco_package_Project[] project filter
|
11 |
+
* @param Loco_Locale[] locale filter
|
12 |
+
* @param bool whether dry run
|
13 |
+
*/
|
14 |
+
public static function run( array $projects, array $locales, $noop = true ){
|
15 |
+
|
16 |
+
// CLI runs all disk operations directly. No remote authorization here currently.
|
17 |
+
$fs = new Loco_api_WordPressFileSystem;
|
18 |
+
$content_dir = loco_constant('WP_CONTENT_DIR');
|
19 |
+
|
20 |
+
// track total number of PO files synced
|
21 |
+
$updated = 0;
|
22 |
+
|
23 |
+
/* @var Loco_package_Project $project */
|
24 |
+
foreach( $projects as $project ){
|
25 |
+
$id = rtrim( $project->getId(), '.' );
|
26 |
+
WP_CLI::log( sprintf('Syncing "%s" (%s)',$project->getName(),$id) );
|
27 |
+
// Check if project has POT, which will be used as default template unless PO overrides
|
28 |
+
$pot = null;
|
29 |
+
$potfile = $project->getPot();
|
30 |
+
if( $potfile && $potfile->exists() ){
|
31 |
+
Loco_cli_Utils::debug('Parsing template: %s',$potfile->getRelativePath($content_dir));
|
32 |
+
try {
|
33 |
+
$pot = Loco_gettext_Data::fromSource( $potfile->getContents() );
|
34 |
+
}
|
35 |
+
catch( Loco_error_ParseException $e ){
|
36 |
+
WP_CLI::error( $e->getMessage().' in '.$potfile->getRelativePath($content_dir), false );
|
37 |
+
$potfile = null;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
/* @var Loco_fs_LocaleFile $pofile */
|
41 |
+
$pofiles = $project->findLocaleFiles('po');
|
42 |
+
foreach( $pofiles as $pofile ){
|
43 |
+
$locale = $pofile->getLocale();
|
44 |
+
$tag = (string) $locale;
|
45 |
+
if( $locales && ! array_key_exists($tag,$locales) ){
|
46 |
+
continue;
|
47 |
+
}
|
48 |
+
// Preempt write errors and print useful file mode info
|
49 |
+
$mofile = $pofile->cloneExtension('mo');
|
50 |
+
if( ! $pofile->writable() || $mofile->locked() ){
|
51 |
+
WP_CLI::warning('Skipping unwritable: '.$pofile->filename() );
|
52 |
+
Loco_cli_Utils::tabulateFiles( $pofile->getParent(), $pofile, $mofile );
|
53 |
+
continue;
|
54 |
+
}
|
55 |
+
// Parsing candidate PO file (definitions)
|
56 |
+
Loco_cli_Utils::debug('Parsing PO: %s',$pofile->getRelativePath($content_dir));
|
57 |
+
try {
|
58 |
+
$def = Loco_gettext_Data::fromSource( $pofile->getContents() );
|
59 |
+
}
|
60 |
+
catch( Loco_error_ParseException $e ){
|
61 |
+
WP_CLI::error( $e->getMessage().' in '.$pofile->getRelativePath($content_dir), false );
|
62 |
+
continue;
|
63 |
+
}
|
64 |
+
// Check if PO defines alternative template (reference)
|
65 |
+
$ref = $pot;
|
66 |
+
$translate = true;
|
67 |
+
$head = $def->getHeaders();
|
68 |
+
if( $head->has('X-Loco-Template') ){
|
69 |
+
$ref = null;
|
70 |
+
$potfile = new Loco_fs_File( $head['X-Loco-Template'] );
|
71 |
+
$potfile->normalize( $project->getBundle()->getDirectoryPath() );
|
72 |
+
if( $potfile->exists() ){
|
73 |
+
try {
|
74 |
+
Loco_cli_Utils::debug('> Parsing alternative template: %s',$potfile->getRelativePath($content_dir) );
|
75 |
+
$ref = Loco_gettext_Data::fromSource( $potfile->getContents() );
|
76 |
+
// Default sync behaviour is to copy msgstr fields unless in POT mode
|
77 |
+
if( $head->has('X-Loco-Template-Mode') && 'POT' === $head['X-Loco-Template-Mode'] ){
|
78 |
+
$translate = false;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
catch( Loco_error_ParseException $e ){
|
82 |
+
WP_CLI::error( $e->getMessage().' in '.$potfile->getRelativePath($content_dir), false );
|
83 |
+
}
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
Loco_cli_Utils::debug('Template not found (%s)', $potfile->basename() );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
// Perform merge if we have a reference file
|
90 |
+
if( $ref ){
|
91 |
+
Loco_cli_Utils::debug('Merging %s <- %s', $pofile->basename(), $potfile->basename() );
|
92 |
+
$po = self::msgmerge( $def, $ref, $translate );
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
WP_CLI::warning( sprintf('Skipping %s; no valid translation template',$pofile->getRelativePath($content_dir) ) );
|
96 |
+
continue;
|
97 |
+
}
|
98 |
+
// File is synced, but may be identical
|
99 |
+
$po->sort();
|
100 |
+
if( $po->equal($def) ){
|
101 |
+
WP_CLI::log( sprintf('No update required for %s', $pofile->filename() ) );
|
102 |
+
continue;
|
103 |
+
}
|
104 |
+
if( $noop ){
|
105 |
+
WP_CLI::success( sprintf('**DRY RUN** would update %s', $pofile->filename() ) );
|
106 |
+
continue;
|
107 |
+
}
|
108 |
+
try {
|
109 |
+
// file is different so make a backup before overwriting
|
110 |
+
$backups = new Loco_fs_Revisions($pofile);
|
111 |
+
if( $backups->rotate($fs) ){
|
112 |
+
Loco_cli_Utils::debug('+ saved backup file of %s',$pofile->basename() );
|
113 |
+
}
|
114 |
+
// write new PO
|
115 |
+
$po->localize($locale);
|
116 |
+
$bytes = $pofile->putContents( $po->msgcat() );
|
117 |
+
Loco_cli_Utils::debug('+ %u bytes written to %s',$bytes, $pofile->basename());
|
118 |
+
$updated++;
|
119 |
+
// compile MO
|
120 |
+
$bytes = $mofile->putContents( $po->msgfmt() );
|
121 |
+
Loco_cli_Utils::debug('+ %u bytes written to %s',$bytes, $mofile->basename());
|
122 |
+
// Done PO/MO pair
|
123 |
+
WP_CLI::success( sprintf('Updated %s', $pofile->filename() ) );
|
124 |
+
}
|
125 |
+
catch( Loco_error_WriteException $e ){
|
126 |
+
WP_CLI::error( $e->getMessage(), false );
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
// sync summary
|
131 |
+
if( 0 === $updated ){
|
132 |
+
WP_CLI::log('Nothing updated');
|
133 |
+
}
|
134 |
+
else {
|
135 |
+
WP_CLI::success( sprintf('%u PO files synced',$updated) );
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
* @param Loco_gettext_Data Existing PO file to MODIFY (definitions)
|
142 |
+
* @param Loco_gettext_Data Latest POT file, being synced in (reference)
|
143 |
+
* @param bool whether to merge translations in addition to sources
|
144 |
+
* @return Loco_gettext_Data Merged file replacing $po
|
145 |
+
*/
|
146 |
+
private static function msgmerge( Loco_gettext_Data $po, Loco_gettext_Data $pot, $translate = false ){
|
147 |
+
$ntotal = 0;
|
148 |
+
$nmatched = 0;
|
149 |
+
$nfuzzy = 0;
|
150 |
+
$nadded = 0;
|
151 |
+
// add latest valid sources to matching instance
|
152 |
+
$matcher = new LocoFuzzyMatcher;
|
153 |
+
/* @var LocoPoMessage $new */
|
154 |
+
foreach( $pot as $new ){
|
155 |
+
$ntotal++;
|
156 |
+
$matcher->add($new);
|
157 |
+
}
|
158 |
+
// Get fuzzy matching tolerance from plugin settings, can be set temporarily in command line
|
159 |
+
$fuzziness = Loco_data_Settings::get()->fuzziness;
|
160 |
+
$matcher->setFuzziness( (string) $fuzziness );
|
161 |
+
// update matches sources, deferring unmatched for deferred fuzzy match
|
162 |
+
$merged = clone $po;
|
163 |
+
$merged->clear();
|
164 |
+
/* @var LocoPoMessage $old */
|
165 |
+
foreach( $po as $old ){
|
166 |
+
$new = $matcher->match($old);
|
167 |
+
// if existing source is still valid, merge any changes
|
168 |
+
if( $new instanceof LocoPoMessage ){
|
169 |
+
$p = clone $old;
|
170 |
+
$p->merge($new,$translate);
|
171 |
+
$merged->push($p);
|
172 |
+
$nmatched += $p->countForms();
|
173 |
+
}
|
174 |
+
}
|
175 |
+
// We can quit early if all strings were matched
|
176 |
+
if( $nmatched === $ntotal ){
|
177 |
+
Loco_cli_Utils::debug('> %u identical sources',$ntotal);
|
178 |
+
return $merged;
|
179 |
+
}
|
180 |
+
// Attempt fuzzy matching after all exact matches have been processed
|
181 |
+
foreach( $matcher->getFuzzyMatches() as $pair ){
|
182 |
+
list($old,$new) = $pair;
|
183 |
+
$p = clone $old;
|
184 |
+
$p->merge($new);
|
185 |
+
$merged->push($p);
|
186 |
+
$nfuzzy += $p->countForms();
|
187 |
+
Loco_cli_Utils::debug('~ %s', $p['source'] );
|
188 |
+
}
|
189 |
+
// Any unmatched strings remaining are NEW
|
190 |
+
/* @var LocoPoMessage $new */
|
191 |
+
foreach( $matcher->unmatched() as $new ){
|
192 |
+
$p = clone $new;
|
193 |
+
$translate or $p->strip();
|
194 |
+
$merged->push($p);
|
195 |
+
$nadded += $p->countForms();
|
196 |
+
Loco_cli_Utils::debug('+ %s', $p['source'] );
|
197 |
+
}
|
198 |
+
// TODO Support --previous to keep old strings, or at least comment them out as #| msgid.....
|
199 |
+
// number of strings dropped is previous total minus those matched
|
200 |
+
$ndropped = $po->count() - ( $nmatched + $nfuzzy );
|
201 |
+
Loco_cli_Utils::debug('> unchanged:%u added:%u fuzzy:%u dropped:%u', $nmatched, $nadded, $nfuzzy, $ndropped );
|
202 |
+
return $merged;
|
203 |
+
}
|
204 |
+
|
205 |
+
}
|
src/cli/Utils.php
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Utility functions for wp cli commands
|
4 |
+
*/
|
5 |
+
abstract class Loco_cli_Utils {
|
6 |
+
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Collect translation sets according to type/domain filter
|
10 |
+
* @param string Type of bundle (plugins|themes|core) or a specific Text Domain
|
11 |
+
* @return Loco_package_Project[]
|
12 |
+
*/
|
13 |
+
public static function collectProjects( $filter ){
|
14 |
+
$projects = array();
|
15 |
+
$filter = strtolower($filter);
|
16 |
+
// bundle type filter
|
17 |
+
if( 'plugins' === $filter ){
|
18 |
+
$bundles = Loco_package_Plugin::getAll();
|
19 |
+
$filter = null;
|
20 |
+
}
|
21 |
+
else if( 'themes' === $filter ){
|
22 |
+
$bundles = Loco_package_Theme::getAll();
|
23 |
+
$filter = null;
|
24 |
+
}
|
25 |
+
else if( 'core' === $filter ) {
|
26 |
+
$bundles = array( Loco_package_Core::create() );
|
27 |
+
$filter = null;
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
$bundles = array( Loco_package_Core::create() );
|
31 |
+
$bundles = array_merge( $bundles, Loco_package_Plugin::getAll() );
|
32 |
+
$bundles = array_merge( $bundles, Loco_package_Theme::getAll() );
|
33 |
+
}
|
34 |
+
/* @var Loco_package_Project $project */
|
35 |
+
foreach( $bundles as $bundle ){
|
36 |
+
foreach( $bundle as $project ){
|
37 |
+
if( $filter && strtolower( $project->getDomain() ) !== $filter ){
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
$projects[] = $project;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
if( ! $projects ){
|
44 |
+
throw new Loco_error_Exception('No translation sets found');
|
45 |
+
}
|
46 |
+
return $projects;
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Collect locales from one or more language tags
|
52 |
+
* @param string zero or more language tags
|
53 |
+
* @return Loco_Locale[]
|
54 |
+
*/
|
55 |
+
public static function collectLocales( $tags ){
|
56 |
+
$locales = array();
|
57 |
+
if( '' !== $tags ){
|
58 |
+
$api = new Loco_api_WordPressTranslations;
|
59 |
+
foreach( preg_split('/[\\s,;]+/i',$tags,-1,PREG_SPLIT_NO_EMPTY) as $tag ){
|
60 |
+
$locale = Loco_Locale::parse($tag);
|
61 |
+
if( ! $locale->isValid() ){
|
62 |
+
throw new Loco_error_Exception('Invalid locale: '.json_encode($tag) );
|
63 |
+
}
|
64 |
+
// TODO could expand language-only tags to known WordPress locales e.g. fr -> fr_FR
|
65 |
+
$locales[ (string) $locale ] = $locale;
|
66 |
+
$locale->ensureName($api);
|
67 |
+
}
|
68 |
+
// empty locales means ALL locales, so refuse to return ALL when filter was non-empty
|
69 |
+
if( 0 === count($locales) ){
|
70 |
+
throw new Loco_error_Exception('No valid locales in: '.json_encode($tags) );
|
71 |
+
}
|
72 |
+
}
|
73 |
+
return $locales;
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Simple space-padded table
|
79 |
+
* @param string[][] data rows to print
|
80 |
+
*/
|
81 |
+
public static function tabulate( array $t ){
|
82 |
+
$w = array();
|
83 |
+
foreach( $t as $y => $row ){
|
84 |
+
foreach( $row as $x => $value ){
|
85 |
+
$width = mb_strlen($value,'UTF-8');
|
86 |
+
$w[$x] = isset($w[$x]) ? max($w[$x],$width) : $width;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
foreach( $t as $y => $row ){
|
90 |
+
$line = array();
|
91 |
+
foreach( $w as $x => $width ){
|
92 |
+
$value = isset($row[$x]) ? $row[$x] : '';
|
93 |
+
$value = str_pad($value,$width,' ',STR_PAD_RIGHT);
|
94 |
+
$line[] = $value;
|
95 |
+
}
|
96 |
+
self::debug( implode(' ',$line) );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Prints file listing to stdout
|
103 |
+
*/
|
104 |
+
public static function tabulateFiles(){
|
105 |
+
$t = array();
|
106 |
+
/* @var Loco_fs_File $file */
|
107 |
+
foreach( func_get_args() as $file ){
|
108 |
+
if( $file instanceof Loco_fs_File && $file->exists() ){
|
109 |
+
$f = new Loco_mvc_FileParams(array(),$file);
|
110 |
+
$t[] = array( $f->owner, $f->group, $f->smode, $f->relpath );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
self::tabulate($t);
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* WP_CLI debug logger
|
119 |
+
*/
|
120 |
+
public static function debug(){
|
121 |
+
$args = func_get_args();
|
122 |
+
$message = array_shift($args);
|
123 |
+
if( $args ){
|
124 |
+
$message = vsprintf($message,$args);
|
125 |
+
}
|
126 |
+
WP_CLI::debug( $message,'loco' );
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Parse boolean command line option. Absence is equal to false
|
132 |
+
*
|
133 |
+
*/
|
134 |
+
public static function bool( array $opts, $key ){
|
135 |
+
$value = isset($opts[$key]) ? $opts[$key] : false;
|
136 |
+
if( ! is_bool($value) ){
|
137 |
+
$value = $value && 'false' !== $value & 'no' !== $value;
|
138 |
+
}
|
139 |
+
return $value;
|
140 |
+
}
|
141 |
+
|
142 |
+
}
|
src/compat/MbstringExtension.php
CHANGED
@@ -8,8 +8,7 @@
|
|
8 |
abstract class Loco_compat_MbstringExtension {
|
9 |
|
10 |
public static function mb_detect_encoding( $str, array $encoding_list = null, $strict = null ){
|
11 |
-
|
12 |
-
return ! $str || preg_match('/./u',$str)
|
13 |
? 'UTF-8'
|
14 |
: 'ISO-8859-1'
|
15 |
;
|
@@ -20,13 +19,28 @@ abstract class Loco_compat_MbstringExtension {
|
|
20 |
}
|
21 |
|
22 |
public static function mb_strlen( $str, $encoding = null ){
|
|
|
|
|
|
|
|
|
|
|
23 |
return strlen($str);
|
24 |
}
|
25 |
|
26 |
public static function mb_convert_encoding( $str, $to_encoding, $from_encoding ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
return $str;
|
28 |
}
|
29 |
-
|
30 |
}
|
31 |
|
32 |
|
8 |
abstract class Loco_compat_MbstringExtension {
|
9 |
|
10 |
public static function mb_detect_encoding( $str, array $encoding_list = null, $strict = null ){
|
11 |
+
return ! $str || preg_match('//u',$str)
|
|
|
12 |
? 'UTF-8'
|
13 |
: 'ISO-8859-1'
|
14 |
;
|
19 |
}
|
20 |
|
21 |
public static function mb_strlen( $str, $encoding = null ){
|
22 |
+
static $warned = false;
|
23 |
+
if( ! $warned && preg_match('/[\\x80-\\xFF]/',$str) ){
|
24 |
+
trigger_error('Character counts will be wrong without mbstring extension',E_USER_WARNING);
|
25 |
+
$warned = true;
|
26 |
+
}
|
27 |
return strlen($str);
|
28 |
}
|
29 |
|
30 |
public static function mb_convert_encoding( $str, $to_encoding, $from_encoding ){
|
31 |
+
if( $to_encoding !== $from_encoding && '' !== $str ){
|
32 |
+
// loco_convert_utf8 no longer uses mb_convert_encoding for UTF8->latin1
|
33 |
+
if( '' === $from_encoding || 'ISO-8859-1' === $from_encoding || 'cp1252' === $from_encoding ){
|
34 |
+
if( '' === $to_encoding || 'UTF-8' === $to_encoding || 'US-ASCII' === $to_encoding ){
|
35 |
+
if( function_exists('loco_fix_utf8') ) {
|
36 |
+
return loco_fix_utf8( $str );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
trigger_error('Unable to convert from '.$from_encoding.' to '.$to_encoding.' without mbstring', E_USER_NOTICE );
|
41 |
+
}
|
42 |
return $str;
|
43 |
}
|
|
|
44 |
}
|
45 |
|
46 |
|
src/config/BundleWriter.php
CHANGED
@@ -135,7 +135,7 @@ class Loco_config_BundleWriter implements JsonSerializable {
|
|
135 |
if( $file = $proj->getPot() ){
|
136 |
$templateElement = $projElement->appendChild( $dom->createElement('template') );
|
137 |
$templateElement->appendChild( $model->createFileElement($file) );
|
138 |
-
// template may be
|
139 |
if( $proj->isPotLocked() ){
|
140 |
$templateElement->setAttribute('locked','true');
|
141 |
}
|
135 |
if( $file = $proj->getPot() ){
|
136 |
$templateElement = $projElement->appendChild( $dom->createElement('template') );
|
137 |
$templateElement->appendChild( $model->createFileElement($file) );
|
138 |
+
// template may be protected from end-user tampering
|
139 |
if( $proj->isPotLocked() ){
|
140 |
$templateElement->setAttribute('locked','true');
|
141 |
}
|
src/data/Preferences.php
CHANGED
@@ -36,8 +36,8 @@ class Loco_data_Preferences extends Loco_data_Serializable {
|
|
36 |
public static function get(){
|
37 |
$id = get_current_user_id();
|
38 |
if( ! $id ){
|
39 |
-
// allow null return only
|
40 |
-
if( defined('LOCO_TEST')
|
41 |
return null;
|
42 |
}
|
43 |
throw new Exception( 'No current user' ); // @codeCoverageIgnore
|
36 |
public static function get(){
|
37 |
$id = get_current_user_id();
|
38 |
if( ! $id ){
|
39 |
+
// allow null return only on command line. All web users must be logged in
|
40 |
+
if( 'cli' === PHP_SAPI || defined('LOCO_TEST') ){
|
41 |
return null;
|
42 |
}
|
43 |
throw new Exception( 'No current user' ); // @codeCoverageIgnore
|
src/data/Settings.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
* @property string $version Current plugin version installed
|
6 |
* @property bool $gen_hash Whether to compile hash table into MO files
|
7 |
* @property bool $use_fuzzy Whether to include Fuzzy strings in MO files
|
|
|
8 |
* @property int $num_backups Number of backups to keep of Gettext files
|
9 |
* @property array $pot_alias Alternative names for POT files in priority order
|
10 |
* @property array $php_alias Alternative file extensions for PHP files
|
@@ -42,6 +43,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
|
|
42 |
'version' => '',
|
43 |
'gen_hash' => false,
|
44 |
'use_fuzzy' => true,
|
|
|
45 |
'num_backups' => 1,
|
46 |
'pot_alias' => array( 'default.po', 'en_US.po', 'en.po' ),
|
47 |
'php_alias' => array( 'php', 'twig' ),
|
5 |
* @property string $version Current plugin version installed
|
6 |
* @property bool $gen_hash Whether to compile hash table into MO files
|
7 |
* @property bool $use_fuzzy Whether to include Fuzzy strings in MO files
|
8 |
+
* @property int $fuzziness Fuzzy matching tolerance level, 0-100
|
9 |
* @property int $num_backups Number of backups to keep of Gettext files
|
10 |
* @property array $pot_alias Alternative names for POT files in priority order
|
11 |
* @property array $php_alias Alternative file extensions for PHP files
|
43 |
'version' => '',
|
44 |
'gen_hash' => false,
|
45 |
'use_fuzzy' => true,
|
46 |
+
'fuzziness' => 20,
|
47 |
'num_backups' => 1,
|
48 |
'pot_alias' => array( 'default.po', 'en_US.po', 'en.po' ),
|
49 |
'php_alias' => array( 'php', 'twig' ),
|
src/error/AdminNotices.php
CHANGED
@@ -34,6 +34,16 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
34 |
*/
|
35 |
public static function add( Loco_error_Exception $error ){
|
36 |
$notices = self::get();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$notices->errors[] = $error;
|
38 |
// do late flush if we missed the boat
|
39 |
if( did_action('loco_admin_init') ){
|
@@ -42,10 +52,6 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
42 |
if( did_action('admin_notices') ){
|
43 |
$notices->on_admin_notices();
|
44 |
}
|
45 |
-
// if exception wasn't thrown we have to do some work to establish where it was invoked
|
46 |
-
if( __FILE__ === $error->getFile() ){
|
47 |
-
$error->setCallee(1);
|
48 |
-
}
|
49 |
// Log messages of minimum priority and up, depending on debug mode
|
50 |
// note that non-debug level is in line with error_reporting set by WordPress (notices ignored)
|
51 |
$priority = loco_debugging() ? Loco_error_Exception::LEVEL_DEBUG : Loco_error_Exception::LEVEL_WARNING;
|
@@ -118,7 +124,8 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
118 |
* @return Loco_error_Exception[]
|
119 |
*/
|
120 |
public static function destroy(){
|
121 |
-
|
|
|
122 |
$buffer = $notices->errors;
|
123 |
$notices->errors = array();
|
124 |
self::$singleton = null;
|
@@ -145,7 +152,7 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
145 |
/**
|
146 |
* @return void
|
147 |
*/
|
148 |
-
private function
|
149 |
if( $this->errors ){
|
150 |
$htmls = array();
|
151 |
foreach( $this->errors as $error ){
|
@@ -169,13 +176,24 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
169 |
}
|
170 |
}
|
171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
/**
|
174 |
* admin_notices action handler.
|
175 |
*/
|
176 |
public function on_admin_notices(){
|
177 |
if( ! $this->inline ){
|
178 |
-
$this->
|
179 |
}
|
180 |
}
|
181 |
|
@@ -186,7 +204,7 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
186 |
*/
|
187 |
public function on_loco_admin_notices(){
|
188 |
$this->inline = true;
|
189 |
-
$this->
|
190 |
}
|
191 |
|
192 |
|
@@ -205,8 +223,11 @@ class Loco_error_AdminNotices extends Loco_hooks_Hookable {
|
|
205 |
*/
|
206 |
public function __destruct(){
|
207 |
$this->inline = false;
|
208 |
-
if(
|
209 |
-
$this->
|
|
|
|
|
|
|
210 |
}
|
211 |
}
|
212 |
|
34 |
*/
|
35 |
public static function add( Loco_error_Exception $error ){
|
36 |
$notices = self::get();
|
37 |
+
// if exception wasn't thrown we have to do some work to establish where it was invoked
|
38 |
+
if( __FILE__ === $error->getFile() ){
|
39 |
+
$error->setCallee(1);
|
40 |
+
}
|
41 |
+
// write error immediately under WP_CLIT
|
42 |
+
if( 'cli' === PHP_SAPI && class_exists('WP_CLI',false) ){
|
43 |
+
$error->logCli();
|
44 |
+
return $error;
|
45 |
+
}
|
46 |
+
// else buffer notices for displaying when UI is ready
|
47 |
$notices->errors[] = $error;
|
48 |
// do late flush if we missed the boat
|
49 |
if( did_action('loco_admin_init') ){
|
52 |
if( did_action('admin_notices') ){
|
53 |
$notices->on_admin_notices();
|
54 |
}
|
|
|
|
|
|
|
|
|
55 |
// Log messages of minimum priority and up, depending on debug mode
|
56 |
// note that non-debug level is in line with error_reporting set by WordPress (notices ignored)
|
57 |
$priority = loco_debugging() ? Loco_error_Exception::LEVEL_DEBUG : Loco_error_Exception::LEVEL_WARNING;
|
124 |
* @return Loco_error_Exception[]
|
125 |
*/
|
126 |
public static function destroy(){
|
127 |
+
$notices = self::$singleton;
|
128 |
+
if( $notices instanceof Loco_error_AdminNotices ){
|
129 |
$buffer = $notices->errors;
|
130 |
$notices->errors = array();
|
131 |
self::$singleton = null;
|
152 |
/**
|
153 |
* @return void
|
154 |
*/
|
155 |
+
private function flushHtml(){
|
156 |
if( $this->errors ){
|
157 |
$htmls = array();
|
158 |
foreach( $this->errors as $error ){
|
176 |
}
|
177 |
}
|
178 |
|
179 |
+
/**
|
180 |
+
* @return void
|
181 |
+
*/
|
182 |
+
private function flushCli(){
|
183 |
+
foreach( $this->errors as $e ){
|
184 |
+
$e->logCli();
|
185 |
+
}
|
186 |
+
$this->errors = array();
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
|
191 |
/**
|
192 |
* admin_notices action handler.
|
193 |
*/
|
194 |
public function on_admin_notices(){
|
195 |
if( ! $this->inline ){
|
196 |
+
$this->flushHtml();
|
197 |
}
|
198 |
}
|
199 |
|
204 |
*/
|
205 |
public function on_loco_admin_notices(){
|
206 |
$this->inline = true;
|
207 |
+
$this->flushHtml();
|
208 |
}
|
209 |
|
210 |
|
223 |
*/
|
224 |
public function __destruct(){
|
225 |
$this->inline = false;
|
226 |
+
if( class_exists('WP_CLI',false) ){
|
227 |
+
$this->flushCli();
|
228 |
+
}
|
229 |
+
else if( ! loco_doing_ajax() ){
|
230 |
+
$this->flushHtml();
|
231 |
}
|
232 |
}
|
233 |
|
src/error/Debug.php
CHANGED
@@ -26,6 +26,14 @@ class Loco_error_Debug extends Loco_error_Exception {
|
|
26 |
public function getLevel(){
|
27 |
return Loco_error_Exception::LEVEL_DEBUG;
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
|
31 |
/**
|
26 |
public function getLevel(){
|
27 |
return Loco_error_Exception::LEVEL_DEBUG;
|
28 |
}
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritDoc}
|
33 |
+
*/
|
34 |
+
public function logCli(){
|
35 |
+
WP_CLI::debug( $this->getMessage(), 'loco' );
|
36 |
+
}
|
37 |
|
38 |
|
39 |
/**
|
src/error/Exception.php
CHANGED
@@ -103,7 +103,7 @@ class Loco_error_Exception extends Exception implements JsonSerializable {
|
|
103 |
$path = $file->getRelativePath( loco_plugin_root() );
|
104 |
$text = sprintf('[Loco.%s] "%s" in %s:%u', $this->getType(), $this->getMessage(), $path, $this->getRealLine() );
|
105 |
// separate error log in CWD for tests
|
106 |
-
if(
|
107 |
error_log( '['.date('c').'] '.$text."\n", 3, 'debug.log' );
|
108 |
}
|
109 |
// Else write to default PHP log, but note that WordPress may have set this to wp-content/debug.log.
|
@@ -141,6 +141,15 @@ class Loco_error_Exception extends Exception implements JsonSerializable {
|
|
141 |
}
|
142 |
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
/**
|
145 |
* Get localized notice level name
|
146 |
* @return string
|
103 |
$path = $file->getRelativePath( loco_plugin_root() );
|
104 |
$text = sprintf('[Loco.%s] "%s" in %s:%u', $this->getType(), $this->getMessage(), $path, $this->getRealLine() );
|
105 |
// separate error log in CWD for tests
|
106 |
+
if( defined('LOCO_TEST') && LOCO_TEST ){
|
107 |
error_log( '['.date('c').'] '.$text."\n", 3, 'debug.log' );
|
108 |
}
|
109 |
// Else write to default PHP log, but note that WordPress may have set this to wp-content/debug.log.
|
141 |
}
|
142 |
|
143 |
|
144 |
+
/**
|
145 |
+
* Call wp cli logging function
|
146 |
+
* @return void
|
147 |
+
*/
|
148 |
+
public function logCli(){
|
149 |
+
WP_CLI::error( $this->getMessage(), false );
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
/**
|
154 |
* Get localized notice level name
|
155 |
* @return string
|
src/error/Notice.php
CHANGED
@@ -28,4 +28,12 @@ class Loco_error_Notice extends Loco_error_Exception {
|
|
28 |
return Loco_error_Exception::LEVEL_NOLOG;
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
28 |
return Loco_error_Exception::LEVEL_NOLOG;
|
29 |
}
|
30 |
|
31 |
+
|
32 |
+
/**
|
33 |
+
* {@inheritDoc}
|
34 |
+
*/
|
35 |
+
public function logCli(){
|
36 |
+
WP_CLI::log( $this->getMessage() );
|
37 |
+
}
|
38 |
+
|
39 |
}
|
src/error/ParseException.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*/
|
5 |
class Loco_error_ParseException extends Loco_error_Exception {
|
6 |
|
7 |
/**
|
8 |
-
* @var string
|
9 |
*/
|
10 |
private $context;
|
11 |
|
@@ -16,32 +16,36 @@ class Loco_error_ParseException extends Loco_error_Exception {
|
|
16 |
* @return self
|
17 |
*/
|
18 |
public function setContext( $line, $column, $source ){
|
19 |
-
$this->context =
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$
|
24 |
-
$
|
25 |
}
|
26 |
-
// get line of source code where error is and construct a ____^ thingy to show error on next line
|
27 |
-
// this requires that full source is passed in, so line number must be real
|
28 |
-
if( loco_debugging() ){
|
29 |
-
$lines = preg_split( '/\\r?\\n/', $source, $line+1 );
|
30 |
-
$offset = $line - 1;
|
31 |
-
if( isset($lines[$offset]) ){
|
32 |
-
$this->context = $lines[$offset] ."\n". str_repeat(' ', max(0,$column) ).'^';
|
33 |
-
}
|
34 |
-
}
|
35 |
-
// wrap initial message with context data
|
36 |
$this->message = sprintf("Error at line %u, column %u: %s", $line, $column, $this->message );
|
37 |
return $this;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* @return string
|
42 |
*/
|
43 |
public function getContext(){
|
44 |
-
return $this->context;
|
45 |
}
|
46 |
|
47 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Exception thrown when parsing fails
|
4 |
*/
|
5 |
class Loco_error_ParseException extends Loco_error_Exception {
|
6 |
|
7 |
/**
|
8 |
+
* @var string[]
|
9 |
*/
|
10 |
private $context;
|
11 |
|
16 |
* @return self
|
17 |
*/
|
18 |
public function setContext( $line, $column, $source ){
|
19 |
+
$this->context = array();
|
20 |
+
$lines = preg_split( '/\\r?\\n/', $source, $line+1 );
|
21 |
+
$offset = $line - 1;
|
22 |
+
if( isset($lines[$offset]) ){
|
23 |
+
$this->context[] = $lines[$offset];
|
24 |
+
$this->context[] = str_repeat(' ', max(0,$column-1) ).'^';
|
25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
$this->message = sprintf("Error at line %u, column %u: %s", $line, $column, $this->message );
|
27 |
return $this;
|
28 |
}
|
29 |
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @param int zero-based offset to failure point
|
33 |
+
* @param string source in which to identify line and column
|
34 |
+
* @return self
|
35 |
+
*/
|
36 |
+
public function setOffsetContext( $offset, $source ){
|
37 |
+
$lines = preg_split( '/\\r?\\n/', substr($source,0,$offset) );
|
38 |
+
$line = count($lines);
|
39 |
+
$column = 1 + strlen( end($lines) );
|
40 |
+
return $this->setContext( $line, $column, $source );
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
/**
|
45 |
* @return string
|
46 |
*/
|
47 |
public function getContext(){
|
48 |
+
return is_array($this->context) ? implode("\n",$this->context) : '';
|
49 |
}
|
50 |
|
51 |
}
|
src/error/Success.php
CHANGED
@@ -27,4 +27,13 @@ class Loco_error_Success extends Loco_error_Exception {
|
|
27 |
return Loco_error_Exception::LEVEL_NOLOG;
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
|
27 |
return Loco_error_Exception::LEVEL_NOLOG;
|
28 |
}
|
29 |
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritDoc}
|
33 |
+
*/
|
34 |
+
public function logCli(){
|
35 |
+
WP_CLI::success( $this->getMessage() );
|
36 |
+
}
|
37 |
+
|
38 |
}
|
39 |
+
|
src/error/Warning.php
CHANGED
@@ -27,4 +27,12 @@ class Loco_error_Warning extends Loco_error_Exception {
|
|
27 |
return Loco_error_Exception::LEVEL_WARNING;
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
27 |
return Loco_error_Exception::LEVEL_WARNING;
|
28 |
}
|
29 |
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritDoc}
|
33 |
+
*/
|
34 |
+
public function logCli(){
|
35 |
+
WP_CLI::warning( $this->getMessage() );
|
36 |
+
}
|
37 |
+
|
38 |
}
|
src/fs/File.php
CHANGED
@@ -170,7 +170,7 @@ class Loco_fs_File {
|
|
170 |
if( $writer->isDirect() && ( $uid = Loco_compat_PosixExtension::getuid() ) ){
|
171 |
return $uid === $this->uid() || $uid === $parent->uid();
|
172 |
}
|
173 |
-
// else delete operation won't be done directly, so can't
|
174 |
// TODO is it worth comparing FTP username etc.. for ownership?
|
175 |
}
|
176 |
// defaulting to "deletable" based on fact that parent is writable.
|
@@ -199,7 +199,7 @@ class Loco_fs_File {
|
|
199 |
|
200 |
|
201 |
/**
|
202 |
-
* Check if file can't be
|
203 |
* This does not check permissions recursively as directory trees are not built implicitly
|
204 |
* @return bool
|
205 |
*/
|
170 |
if( $writer->isDirect() && ( $uid = Loco_compat_PosixExtension::getuid() ) ){
|
171 |
return $uid === $this->uid() || $uid === $parent->uid();
|
172 |
}
|
173 |
+
// else delete operation won't be done directly, so can't preempt sticky problems
|
174 |
// TODO is it worth comparing FTP username etc.. for ownership?
|
175 |
}
|
176 |
// defaulting to "deletable" based on fact that parent is writable.
|
199 |
|
200 |
|
201 |
/**
|
202 |
+
* Check if file can't be overwritten when existent, nor created when non-existent
|
203 |
* This does not check permissions recursively as directory trees are not built implicitly
|
204 |
* @return bool
|
205 |
*/
|
src/fs/FileMode.php
CHANGED
@@ -13,6 +13,7 @@ class Loco_fs_FileMode {
|
|
13 |
|
14 |
/**
|
15 |
* Instantiate from integer file mode
|
|
|
16 |
*/
|
17 |
public function __construct( $mode ){
|
18 |
$this->i = (int) $mode;
|
13 |
|
14 |
/**
|
15 |
* Instantiate from integer file mode
|
16 |
+
* @param int
|
17 |
*/
|
18 |
public function __construct( $mode ){
|
19 |
$this->i = (int) $mode;
|
src/gettext/Data.php
CHANGED
@@ -41,7 +41,7 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
41 |
}
|
42 |
catch( Loco_error_ParseException $e ){
|
43 |
$path = $file->getRelativePath( loco_constant('WP_CONTENT_DIR') );
|
44 |
-
Loco_error_AdminNotices::debug( sprintf('Failed to parse %s as a %s file',$path,$type) );
|
45 |
throw new Loco_error_ParseException( sprintf('Invalid %s file: %s',$type,basename($path)) );
|
46 |
}
|
47 |
}
|
@@ -98,7 +98,6 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
98 |
* @return string
|
99 |
*/
|
100 |
public static function ensureUtf8( $src ){
|
101 |
-
loco_check_extension('mbstring');
|
102 |
$src = loco_remove_bom($src,$cs);
|
103 |
if( ! $cs ){
|
104 |
// read PO header, requiring partial parse
|
@@ -108,15 +107,8 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
108 |
catch( Loco_error_ParseException $e ){
|
109 |
Loco_error_AdminNotices::debug( $e->getMessage() );
|
110 |
}
|
111 |
-
// fall back on detection which will only work for latin1
|
112 |
-
if( ! $cs ){
|
113 |
-
$cs = mb_detect_encoding($src,array('UTF-8','ISO-8859-1'),true);
|
114 |
-
}
|
115 |
-
}
|
116 |
-
if( $cs && 'UTF-8' !== $cs ){
|
117 |
-
$src = mb_convert_encoding($src,'UTF-8',array($cs) );
|
118 |
}
|
119 |
-
return $src;
|
120 |
}
|
121 |
|
122 |
|
@@ -176,7 +168,7 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
176 |
* @param string text domain for JED metadata
|
177 |
* @param LocoPoMessage[] pre-compiled messages
|
178 |
* @return string
|
179 |
-
|
180 |
public function jedize( $domain, array $po ){
|
181 |
$head = $this->getHeaders();
|
182 |
// start locale_data with JED header
|
@@ -185,7 +177,7 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
185 |
'lang' => $head['language'],
|
186 |
'plural-forms' => $head['plural-forms'],
|
187 |
) );
|
188 |
-
|
189 |
foreach( $po as $msg ){
|
190 |
$data[ $msg->getKey() ] = $msg->getMsgstrs();
|
191 |
}
|
@@ -202,7 +194,7 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
|
|
202 |
$domain => $data,
|
203 |
),
|
204 |
), $json_options );
|
205 |
-
}
|
206 |
|
207 |
|
208 |
/**
|
41 |
}
|
42 |
catch( Loco_error_ParseException $e ){
|
43 |
$path = $file->getRelativePath( loco_constant('WP_CONTENT_DIR') );
|
44 |
+
Loco_error_AdminNotices::debug( sprintf('Failed to parse %s as a %s file; %s',$path,$type,$e->getMessage()) );
|
45 |
throw new Loco_error_ParseException( sprintf('Invalid %s file: %s',$type,basename($path)) );
|
46 |
}
|
47 |
}
|
98 |
* @return string
|
99 |
*/
|
100 |
public static function ensureUtf8( $src ){
|
|
|
101 |
$src = loco_remove_bom($src,$cs);
|
102 |
if( ! $cs ){
|
103 |
// read PO header, requiring partial parse
|
107 |
catch( Loco_error_ParseException $e ){
|
108 |
Loco_error_AdminNotices::debug( $e->getMessage() );
|
109 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
+
return loco_convert_utf8($src,$cs,false);
|
112 |
}
|
113 |
|
114 |
|
168 |
* @param string text domain for JED metadata
|
169 |
* @param LocoPoMessage[] pre-compiled messages
|
170 |
* @return string
|
171 |
+
*
|
172 |
public function jedize( $domain, array $po ){
|
173 |
$head = $this->getHeaders();
|
174 |
// start locale_data with JED header
|
177 |
'lang' => $head['language'],
|
178 |
'plural-forms' => $head['plural-forms'],
|
179 |
) );
|
180 |
+
// @var LocoPoMessage $msg
|
181 |
foreach( $po as $msg ){
|
182 |
$data[ $msg->getKey() ] = $msg->getMsgstrs();
|
183 |
}
|
194 |
$domain => $data,
|
195 |
),
|
196 |
), $json_options );
|
197 |
+
}*/
|
198 |
|
199 |
|
200 |
/**
|
src/gettext/Extraction.php
CHANGED
@@ -25,7 +25,7 @@ class Loco_gettext_Extraction {
|
|
25 |
|
26 |
/**
|
27 |
* List of files skipped due to memory limit
|
28 |
-
* @var Loco_fs_FileList
|
29 |
*/
|
30 |
private $skipped;
|
31 |
|
@@ -42,7 +42,6 @@ class Loco_gettext_Extraction {
|
|
42 |
*/
|
43 |
public function __construct( Loco_package_Bundle $bundle ){
|
44 |
loco_check_extension('ctype');
|
45 |
-
loco_check_extension('mbstring');
|
46 |
if( ! loco_check_extension('tokenizer') ){
|
47 |
throw new Loco_error_Exception('String extraction not available without required extension');
|
48 |
}
|
@@ -50,8 +49,9 @@ class Loco_gettext_Extraction {
|
|
50 |
$this->extracted = new LocoExtracted;
|
51 |
$this->extracted->setDomain('default');
|
52 |
$this->extras = array();
|
53 |
-
|
54 |
-
|
|
|
55 |
// wildcard stands in for empty text domain, meaning unspecified or dynamic domains will be included.
|
56 |
// note that strings intended to be in "default" domain must specify explicitly, or be included here too.
|
57 |
if( '*' === $domain ){
|
25 |
|
26 |
/**
|
27 |
* List of files skipped due to memory limit
|
28 |
+
* @var Loco_fs_FileList|null
|
29 |
*/
|
30 |
private $skipped;
|
31 |
|
42 |
*/
|
43 |
public function __construct( Loco_package_Bundle $bundle ){
|
44 |
loco_check_extension('ctype');
|
|
|
45 |
if( ! loco_check_extension('tokenizer') ){
|
46 |
throw new Loco_error_Exception('String extraction not available without required extension');
|
47 |
}
|
49 |
$this->extracted = new LocoExtracted;
|
50 |
$this->extracted->setDomain('default');
|
51 |
$this->extras = array();
|
52 |
+
$default = $bundle->getDefaultProject();
|
53 |
+
if( $default instanceof Loco_package_Project ){
|
54 |
+
$domain = $default->getDomain()->getName();
|
55 |
// wildcard stands in for empty text domain, meaning unspecified or dynamic domains will be included.
|
56 |
// note that strings intended to be in "default" domain must specify explicitly, or be included here too.
|
57 |
if( '*' === $domain ){
|
src/mvc/AdminController.php
CHANGED
@@ -40,9 +40,8 @@ abstract class Loco_mvc_AdminController extends Loco_mvc_Controller {
|
|
40 |
$this->auth();
|
41 |
|
42 |
// check essential extensions on all pages so admin notices are shown
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
|
47 |
// add contextual help tabs to current screen if there are any
|
48 |
if( $screen = get_current_screen() ){
|
40 |
$this->auth();
|
41 |
|
42 |
// check essential extensions on all pages so admin notices are shown
|
43 |
+
loco_check_extension('json');
|
44 |
+
loco_check_extension('mbstring');
|
|
|
45 |
|
46 |
// add contextual help tabs to current screen if there are any
|
47 |
if( $screen = get_current_screen() ){
|
src/mvc/FileParams.php
CHANGED
@@ -5,6 +5,11 @@
|
|
5 |
* @property-read string $name
|
6 |
* @property-read string $path
|
7 |
* @property-read string $relpath
|
|
|
|
|
|
|
|
|
|
|
8 |
*/
|
9 |
class Loco_mvc_FileParams extends Loco_mvc_ViewParams {
|
10 |
|
@@ -129,7 +134,6 @@ class Loco_mvc_FileParams extends Loco_mvc_ViewParams {
|
|
129 |
/**
|
130 |
* Using slightly modified version of WordPress's Human time differencing
|
131 |
* + Added "Just now" when in the last 30 seconds
|
132 |
-
* TODO possibly replace with custom function that includes "Yesterday" etc..
|
133 |
* @internal
|
134 |
* @return string
|
135 |
*/
|
5 |
* @property-read string $name
|
6 |
* @property-read string $path
|
7 |
* @property-read string $relpath
|
8 |
+
* @property-read string $size
|
9 |
+
* @property-read int $imode
|
10 |
+
* @property-read string $smode
|
11 |
+
* @property-read string $group
|
12 |
+
* @property-read string $owner
|
13 |
*/
|
14 |
class Loco_mvc_FileParams extends Loco_mvc_ViewParams {
|
15 |
|
134 |
/**
|
135 |
* Using slightly modified version of WordPress's Human time differencing
|
136 |
* + Added "Just now" when in the last 30 seconds
|
|
|
137 |
* @internal
|
138 |
* @return string
|
139 |
*/
|
src/output/DiffRenderer.php
CHANGED
@@ -24,6 +24,8 @@ class Loco_output_DiffRenderer extends WP_Text_Diff_Renderer_Table {
|
|
24 |
|
25 |
/**
|
26 |
* Render diff of two files, presumed to be PO or POT
|
|
|
|
|
27 |
* @return string HTML table
|
28 |
*/
|
29 |
public function renderFiles( Loco_fs_File $lhs, Loco_fs_File $rhs ){
|
@@ -34,10 +36,23 @@ class Loco_output_DiffRenderer extends WP_Text_Diff_Renderer_Table {
|
|
34 |
}
|
35 |
// like wp_text_diff but avoiding whitespace normalization
|
36 |
// uses deprecated signature for 'auto' in case of old WordPress
|
37 |
-
return $this->render( new Text_Diff (
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
|
24 |
|
25 |
/**
|
26 |
* Render diff of two files, presumed to be PO or POT
|
27 |
+
* @param Loco_fs_File Left hand file
|
28 |
+
* @param Loco_fs_File Right hand file
|
29 |
* @return string HTML table
|
30 |
*/
|
31 |
public function renderFiles( Loco_fs_File $lhs, Loco_fs_File $rhs ){
|
36 |
}
|
37 |
// like wp_text_diff but avoiding whitespace normalization
|
38 |
// uses deprecated signature for 'auto' in case of old WordPress
|
39 |
+
return $this->render( new Text_Diff( self::splitFile($lhs), self::splitFile($rhs) ) );
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @param Loco_fs_File
|
45 |
+
* @return string[]
|
46 |
+
*/
|
47 |
+
private static function splitFile( Loco_fs_File $file ){
|
48 |
+
$src = $file->getContents();
|
49 |
+
$src = Loco_gettext_Data::ensureUtf8($src);
|
50 |
+
$arr = preg_split( '/\\r?\\n/', $src );
|
51 |
+
if( ! is_array($arr) ){
|
52 |
+
$f = new Loco_mvc_FileParams( array(), $file );
|
53 |
+
throw new Loco_error_Exception('Failed to split '.$f->relpath.' ('.$f->size.')' );
|
54 |
+
}
|
55 |
+
return $arr;
|
56 |
}
|
57 |
|
58 |
|
src/package/Locale.php
CHANGED
@@ -23,6 +23,7 @@ class Loco_package_Locale {
|
|
23 |
|
24 |
/**
|
25 |
* Construct with locale to filter on
|
|
|
26 |
*/
|
27 |
public function __construct( Loco_locale $locale = null ){
|
28 |
$this->index = new ArrayObject;
|
@@ -34,7 +35,8 @@ class Loco_package_Locale {
|
|
34 |
|
35 |
|
36 |
/**
|
37 |
-
* Add another locale to
|
|
|
38 |
* @return Loco_package_Locale
|
39 |
*/
|
40 |
public function addLocale( Loco_Locale $locale ){
|
@@ -47,50 +49,33 @@ class Loco_package_Locale {
|
|
47 |
|
48 |
|
49 |
/**
|
50 |
-
* @
|
|
|
51 |
*/
|
52 |
public function getProject( Loco_fs_File $file ){
|
53 |
$path = $file->getPath();
|
54 |
if( isset($this->index[$path]) ){
|
55 |
return $this->index[$path];
|
56 |
}
|
|
|
57 |
}
|
58 |
|
59 |
|
60 |
-
|
61 |
/**
|
62 |
-
* @return
|
63 |
*/
|
64 |
public function getBundles(){
|
65 |
$bundles = $this->bundles;
|
66 |
if( ! $bundles ){
|
67 |
-
$bundles = array (
|
68 |
-
|
69 |
-
);
|
70 |
-
foreach( Loco_package_Plugin::get_plugins() as $handle => $data ){
|
71 |
-
try {
|
72 |
-
$bundles[] = Loco_package_Plugin::create( $handle );
|
73 |
-
}
|
74 |
-
catch( Exception $e ){
|
75 |
-
// @codeCoverageIgnore
|
76 |
-
}
|
77 |
-
}
|
78 |
-
/* @var $theme WP_Theme */
|
79 |
-
foreach( wp_get_themes() as $theme ){
|
80 |
-
try {
|
81 |
-
$bundles[] = Loco_package_Theme::create( $theme->get_stylesheet() );
|
82 |
-
}
|
83 |
-
catch( Exception $e ){
|
84 |
-
// @codeCoverageIgnore
|
85 |
-
}
|
86 |
-
}
|
87 |
$this->bundles = $bundles;
|
88 |
}
|
89 |
return $bundles;
|
90 |
}
|
91 |
|
92 |
|
93 |
-
|
94 |
/**
|
95 |
* @return loco_fs_FileList
|
96 |
*/
|
@@ -98,9 +83,8 @@ class Loco_package_Locale {
|
|
98 |
$index = $this->index;
|
99 |
$suffixes = $this->match;
|
100 |
$list = new Loco_fs_FileList;
|
101 |
-
/* @var $bundle Loco_package_Bundle */
|
102 |
foreach( $this->getBundles() as $bundle ){
|
103 |
-
/* @var $project
|
104 |
foreach( $bundle as $project ){
|
105 |
/* @var $file Loco_fs_File */
|
106 |
foreach( $project->findLocaleFiles('po') as $file ){
|
@@ -119,14 +103,12 @@ class Loco_package_Locale {
|
|
119 |
}
|
120 |
|
121 |
|
122 |
-
|
123 |
/**
|
124 |
* @return loco_fs_FileList
|
125 |
*/
|
126 |
public function findTemplateFiles(){
|
127 |
$index = $this->index;
|
128 |
$list = new Loco_fs_FileList;
|
129 |
-
/* @var $bundle Loco_package_Bundle */
|
130 |
foreach( $this->getBundles() as $bundle ){
|
131 |
/* @var $project Loco_package_Project */
|
132 |
foreach( $bundle as $project ){
|
@@ -140,6 +122,5 @@ class Loco_package_Locale {
|
|
140 |
}
|
141 |
return $list;
|
142 |
}
|
143 |
-
|
144 |
-
|
145 |
}
|
23 |
|
24 |
/**
|
25 |
* Construct with locale to filter on
|
26 |
+
* @param Loco_Locale|null
|
27 |
*/
|
28 |
public function __construct( Loco_locale $locale = null ){
|
29 |
$this->index = new ArrayObject;
|
35 |
|
36 |
|
37 |
/**
|
38 |
+
* Add another locale to search on
|
39 |
+
* @param Loco_Locale
|
40 |
* @return Loco_package_Locale
|
41 |
*/
|
42 |
public function addLocale( Loco_Locale $locale ){
|
49 |
|
50 |
|
51 |
/**
|
52 |
+
* @param Loco_fs_File
|
53 |
+
* @return Loco_package_Project|null
|
54 |
*/
|
55 |
public function getProject( Loco_fs_File $file ){
|
56 |
$path = $file->getPath();
|
57 |
if( isset($this->index[$path]) ){
|
58 |
return $this->index[$path];
|
59 |
}
|
60 |
+
return null;
|
61 |
}
|
62 |
|
63 |
|
|
|
64 |
/**
|
65 |
+
* @return Loco_package_Bundle[]
|
66 |
*/
|
67 |
public function getBundles(){
|
68 |
$bundles = $this->bundles;
|
69 |
if( ! $bundles ){
|
70 |
+
$bundles = array( Loco_package_Core::create() );
|
71 |
+
$bundles = array_merge( $bundles, Loco_package_Plugin::getAll() );
|
72 |
+
$bundles = array_merge( $bundles, Loco_package_Theme::getAll() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
$this->bundles = $bundles;
|
74 |
}
|
75 |
return $bundles;
|
76 |
}
|
77 |
|
78 |
|
|
|
79 |
/**
|
80 |
* @return loco_fs_FileList
|
81 |
*/
|
83 |
$index = $this->index;
|
84 |
$suffixes = $this->match;
|
85 |
$list = new Loco_fs_FileList;
|
|
|
86 |
foreach( $this->getBundles() as $bundle ){
|
87 |
+
/* @var Loco_package_Project $project */
|
88 |
foreach( $bundle as $project ){
|
89 |
/* @var $file Loco_fs_File */
|
90 |
foreach( $project->findLocaleFiles('po') as $file ){
|
103 |
}
|
104 |
|
105 |
|
|
|
106 |
/**
|
107 |
* @return loco_fs_FileList
|
108 |
*/
|
109 |
public function findTemplateFiles(){
|
110 |
$index = $this->index;
|
111 |
$list = new Loco_fs_FileList;
|
|
|
112 |
foreach( $this->getBundles() as $bundle ){
|
113 |
/* @var $project Loco_package_Project */
|
114 |
foreach( $bundle as $project ){
|
122 |
}
|
123 |
return $list;
|
124 |
}
|
125 |
+
|
|
|
126 |
}
|
src/package/Plugin.php
CHANGED
@@ -43,9 +43,26 @@ class Loco_package_Plugin extends Loco_package_Bundle {
|
|
43 |
}
|
44 |
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* Maintaining our own cache of full paths to available plugins, because get_mu_plugins doesn't get cached by WP
|
48 |
-
* @return array
|
49 |
*/
|
50 |
public static function get_plugins(){
|
51 |
$cached = wp_cache_get('plugins','loco');
|
43 |
}
|
44 |
|
45 |
|
46 |
+
/**
|
47 |
+
* @return Loco_package_Plugin[]
|
48 |
+
*/
|
49 |
+
public static function getAll(){
|
50 |
+
$plugins = array();
|
51 |
+
foreach( self::get_plugins() as $handle => $data ){
|
52 |
+
try {
|
53 |
+
$plugins[] = Loco_package_Plugin::create($handle);
|
54 |
+
}
|
55 |
+
catch( Exception $e ){
|
56 |
+
// @codeCoverageIgnore
|
57 |
+
}
|
58 |
+
}
|
59 |
+
return $plugins;
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
/**
|
64 |
* Maintaining our own cache of full paths to available plugins, because get_mu_plugins doesn't get cached by WP
|
65 |
+
* @return array[]
|
66 |
*/
|
67 |
public static function get_plugins(){
|
68 |
$cached = wp_cache_get('plugins','loco');
|
src/package/Project.php
CHANGED
@@ -355,6 +355,35 @@ class Loco_package_Project {
|
|
355 |
}
|
356 |
|
357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
/**
|
359 |
* Lazy create all searchable source paths
|
360 |
* @return Loco_fs_FileFinder
|
@@ -523,9 +552,10 @@ class Loco_package_Project {
|
|
523 |
*/
|
524 |
public function getPot(){
|
525 |
if( ! $this->pot ){
|
526 |
-
$
|
|
|
527 |
if( '.pot' !== $name ){
|
528 |
-
// find under configured domain paths
|
529 |
$targets = $this->getConfiguredTargets()->copy();
|
530 |
// always permit POT file in the bundle root (i.e. outside domain path)
|
531 |
if( $this->isDomainDefault() && $this->bundle->hasDirectoryPath() ){
|
@@ -551,11 +581,16 @@ class Loco_package_Project {
|
|
551 |
}
|
552 |
}
|
553 |
}
|
|
|
|
|
|
|
|
|
|
|
554 |
}
|
555 |
return $this->pot;
|
556 |
}
|
557 |
|
558 |
-
|
559 |
/**
|
560 |
* Force the use of a known POT file. This could be a PO file if necessary
|
561 |
* @param Loco_fs_File template POT file
|
355 |
}
|
356 |
|
357 |
|
358 |
+
/**
|
359 |
+
* Get first valid domain path
|
360 |
+
* @param bool whether directory should exist
|
361 |
+
* @return Loco_fs_Directory
|
362 |
+
*/
|
363 |
+
private function getSafeDomainPath(){
|
364 |
+
// use first configured domain path that exists
|
365 |
+
foreach( $this->getConfiguredTargets() as $d ){
|
366 |
+
if( $d->exists() ){
|
367 |
+
return $d;
|
368 |
+
}
|
369 |
+
}
|
370 |
+
// fallback to unconfigured, but possibly existent folders
|
371 |
+
$base = $this->getBundle()->getDirectoryPath();
|
372 |
+
foreach( array('languages','language','lang','l10n','i18n') as $d ){
|
373 |
+
$d = new Loco_fs_Directory($d);
|
374 |
+
$d->normalize($base);
|
375 |
+
if( $this->isTargetExcluded($d) ){
|
376 |
+
continue;
|
377 |
+
}
|
378 |
+
if( $d->exists() ){
|
379 |
+
return $d;
|
380 |
+
}
|
381 |
+
}
|
382 |
+
// Give up and place in root
|
383 |
+
return new Loco_fs_Directory($base);
|
384 |
+
}
|
385 |
+
|
386 |
+
|
387 |
/**
|
388 |
* Lazy create all searchable source paths
|
389 |
* @return Loco_fs_FileFinder
|
552 |
*/
|
553 |
public function getPot(){
|
554 |
if( ! $this->pot ){
|
555 |
+
$slug = $this->getSlug();
|
556 |
+
$name = ( $slug ? $slug : $this->getDomain()->getName() ).'.pot';
|
557 |
if( '.pot' !== $name ){
|
558 |
+
// find actual file under configured domain paths
|
559 |
$targets = $this->getConfiguredTargets()->copy();
|
560 |
// always permit POT file in the bundle root (i.e. outside domain path)
|
561 |
if( $this->isDomainDefault() && $this->bundle->hasDirectoryPath() ){
|
581 |
}
|
582 |
}
|
583 |
}
|
584 |
+
// fall back to a directory that exists, but where the POT may not
|
585 |
+
if( ! $this->pot ){
|
586 |
+
$this->pot = new Loco_fs_File($name);
|
587 |
+
$this->pot->normalize( (string) $this->getSafeDomainPath() );
|
588 |
+
}
|
589 |
}
|
590 |
return $this->pot;
|
591 |
}
|
592 |
|
593 |
+
|
594 |
/**
|
595 |
* Force the use of a known POT file. This could be a PO file if necessary
|
596 |
* @param Loco_fs_File template POT file
|
src/package/TextDomain.php
CHANGED
@@ -1,31 +1,32 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Object represents a Text Domain within a bundle.
|
4 |
-
* TODO implement a conflict watcher to warn when domains are shared by multiple bundles?
|
5 |
*/
|
6 |
class Loco_package_TextDomain extends ArrayIterator {
|
7 |
-
|
8 |
/**
|
9 |
* Actual Gettext-like name of Text Domain, e.g. "twentyfifteen"
|
10 |
* @var string
|
11 |
*/
|
12 |
private $name;
|
13 |
-
|
14 |
/**
|
15 |
* Whether this is the officially declared domain for a theme or plugin
|
16 |
* @var bool
|
17 |
*/
|
18 |
private $canonical = false;
|
19 |
|
20 |
-
|
21 |
/**
|
22 |
* Create new Text Domain from its name
|
|
|
23 |
*/
|
24 |
public function __construct( $name ){
|
|
|
25 |
$this->name = $name;
|
26 |
}
|
27 |
|
28 |
-
|
29 |
/**
|
30 |
* @internal
|
31 |
*/
|
@@ -45,6 +46,8 @@ class Loco_package_TextDomain extends ArrayIterator {
|
|
45 |
|
46 |
/**
|
47 |
* Create a named project in a given bundle for this Text Domain
|
|
|
|
|
48 |
* @return Loco_package_Project
|
49 |
*/
|
50 |
public function createProject( Loco_package_Bundle $bundle, $name ){
|
@@ -56,6 +59,7 @@ class Loco_package_TextDomain extends ArrayIterator {
|
|
56 |
|
57 |
|
58 |
/**
|
|
|
59 |
* @return Loco_package_TextDomain
|
60 |
*/
|
61 |
public function setCanonical( $bool ){
|
@@ -70,5 +74,5 @@ class Loco_package_TextDomain extends ArrayIterator {
|
|
70 |
public function isCanonical(){
|
71 |
return $this->canonical;
|
72 |
}
|
73 |
-
|
74 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Object represents a Text Domain within a bundle.
|
|
|
4 |
*/
|
5 |
class Loco_package_TextDomain extends ArrayIterator {
|
6 |
+
|
7 |
/**
|
8 |
* Actual Gettext-like name of Text Domain, e.g. "twentyfifteen"
|
9 |
* @var string
|
10 |
*/
|
11 |
private $name;
|
12 |
+
|
13 |
/**
|
14 |
* Whether this is the officially declared domain for a theme or plugin
|
15 |
* @var bool
|
16 |
*/
|
17 |
private $canonical = false;
|
18 |
|
19 |
+
|
20 |
/**
|
21 |
* Create new Text Domain from its name
|
22 |
+
* @param string
|
23 |
*/
|
24 |
public function __construct( $name ){
|
25 |
+
parent::__construct();
|
26 |
$this->name = $name;
|
27 |
}
|
28 |
|
29 |
+
|
30 |
/**
|
31 |
* @internal
|
32 |
*/
|
46 |
|
47 |
/**
|
48 |
* Create a named project in a given bundle for this Text Domain
|
49 |
+
* @param Loco_package_Bundle bundle of which this is one set of translations
|
50 |
+
* @param string
|
51 |
* @return Loco_package_Project
|
52 |
*/
|
53 |
public function createProject( Loco_package_Bundle $bundle, $name ){
|
59 |
|
60 |
|
61 |
/**
|
62 |
+
* @param bool
|
63 |
* @return Loco_package_TextDomain
|
64 |
*/
|
65 |
public function setCanonical( $bool ){
|
74 |
public function isCanonical(){
|
75 |
return $this->canonical;
|
76 |
}
|
77 |
+
|
78 |
}
|
src/package/Theme.php
CHANGED
@@ -71,6 +71,23 @@ class Loco_package_Theme extends Loco_package_Bundle {
|
|
71 |
}
|
72 |
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* Create theme bundle definition from WordPress theme handle
|
76 |
*
|
71 |
}
|
72 |
|
73 |
|
74 |
+
/**
|
75 |
+
* @return Loco_package_Theme[]
|
76 |
+
*/
|
77 |
+
public static function getAll(){
|
78 |
+
$themes = array();
|
79 |
+
foreach( wp_get_themes(array('errors'=>null)) as $theme ){
|
80 |
+
try {
|
81 |
+
$themes[] = self::createFromTheme($theme);
|
82 |
+
}
|
83 |
+
catch( Exception $e ){
|
84 |
+
// @codeCoverageIgnore
|
85 |
+
}
|
86 |
+
}
|
87 |
+
return $themes;
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
/**
|
92 |
* Create theme bundle definition from WordPress theme handle
|
93 |
*
|
tpl/admin/config/settings.php
CHANGED
@@ -98,6 +98,23 @@ $fs_help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/
|
|
98 |
</fieldset>
|
99 |
</td>
|
100 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
<!--tr>
|
102 |
<th scope="row"><?php esc_html_e('POT template files','loco-translate')?></th>
|
103 |
<td>
|
98 |
</fieldset>
|
99 |
</td>
|
100 |
</tr>
|
101 |
+
<tr>
|
102 |
+
<th scope="row"><?php esc_html_e('Syncing PO files','loco-translate')?></th>
|
103 |
+
<td>
|
104 |
+
<fieldset>
|
105 |
+
<legend class="screen-reader-text">
|
106 |
+
<span><?php esc_html_e('Syncing PO files','loco-translate')?></span>
|
107 |
+
</legend>
|
108 |
+
<p>
|
109 |
+
<label for="loco--">
|
110 |
+
<?php esc_html_e('Fuzzy matching tolerance:','loco-translate')?>
|
111 |
+
</label>
|
112 |
+
<input type="text" size="5" maxlength="3" name="opts[fuzziness]" id="loco--fuzziness" value="<?php echo esc_attr( $opts->fuzziness)?>" placeholder="0-100" />
|
113 |
+
<span>%</span>
|
114 |
+
</p>
|
115 |
+
</fieldset>
|
116 |
+
</td>
|
117 |
+
</tr>
|
118 |
<!--tr>
|
119 |
<th scope="row"><?php esc_html_e('POT template files','loco-translate')?></th>
|
120 |
<td>
|