From df59f0179a2f9503059e0476df992aaa2cc27bd3 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Sat, 11 Oct 2014 01:22:21 -0400 Subject: [PATCH] Eventify TemplateDataGenerator and use oojs-ui Change the ui/data behavior to work with oojs and event emitters, and replace the gui from jquery ui to oojs-ui. Changes made: * Recreate the templatedata editor with oojs and ooui. * Create a standalone templatedata model with internal validation. * Allow the user to insert language-specific strings: * Allow adding arbitrary languages and values * Normalize output between language object and 'simple' string * Add new language code by searching for its name or code * Import parameters from template code * If the template is in subpage and there is no code in the current page, the code will request the contents of the parent page. Change-Id: I985ea03dfee58984ec22ec9a157a00968bfca878 --- .jshintrc | 18 +- TemplateData.hooks.php | 25 +- TemplateData.php | 55 +- i18n/en.json | 23 +- i18n/qqq.json | 54 +- lib/jquery.uls/CREDITS | 13 + lib/jquery.uls/GPL-LICENSE | 342 ++++ lib/jquery.uls/src/jquery.uls.data.js | 7 + lib/jquery.uls/src/jquery.uls.data.utils.js | 465 ++++++ modules/ext.templateDataGenerator.core.js | 1483 ----------------- modules/ext.templateDataGenerator.css | 89 - modules/ext.templateDataGenerator.data.js | 1000 +++++++++++ modules/ext.templateDataGenerator.editPage.js | 14 +- modules/ext.templateDataGenerator.ui.css | 72 + modules/ext.templateDataGenerator.ui.js | 170 ++ .../ext.templateDataGenerator.ui.tdDialog.js | 823 +++++++++ modules/images/parameter-ltr.svg | 6 + modules/images/parameter-rtl.svg | 6 + modules/images/parameter-set-ltr.svg | 8 + modules/images/parameter-set-rtl.svg | 8 + ...plateDataGenerator.languageResultWidget.js | 77 + ...plateDataGenerator.languageSearchWidget.js | 112 ++ ...emplateDataGenerator.optionImportWidget.js | 37 + .../ext.templateDataGenerator.optionWidget.js | 54 + tests/ext.templateData.tests.js | 630 +++++-- 25 files changed, 3822 insertions(+), 1769 deletions(-) create mode 100644 lib/jquery.uls/CREDITS create mode 100644 lib/jquery.uls/GPL-LICENSE create mode 100644 lib/jquery.uls/src/jquery.uls.data.js create mode 100644 lib/jquery.uls/src/jquery.uls.data.utils.js delete mode 100644 modules/ext.templateDataGenerator.core.js delete mode 100644 modules/ext.templateDataGenerator.css create mode 100644 modules/ext.templateDataGenerator.data.js create mode 100644 modules/ext.templateDataGenerator.ui.css create mode 100644 modules/ext.templateDataGenerator.ui.js create mode 100644 modules/ext.templateDataGenerator.ui.tdDialog.js create mode 100644 modules/images/parameter-ltr.svg create mode 100644 modules/images/parameter-rtl.svg create mode 100644 modules/images/parameter-set-ltr.svg create mode 100644 modules/images/parameter-set-rtl.svg create mode 100644 modules/widgets/ext.templateDataGenerator.languageResultWidget.js create mode 100644 modules/widgets/ext.templateDataGenerator.languageSearchWidget.js create mode 100644 modules/widgets/ext.templateDataGenerator.optionImportWidget.js create mode 100644 modules/widgets/ext.templateDataGenerator.optionWidget.js diff --git a/.jshintrc b/.jshintrc index a71afbef..20eaae9f 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,7 +2,6 @@ // Enforcing "bitwise": true, "eqeqeq": true, - "es3": true, "freeze": true, "latedef": true, "noarg": true, @@ -11,12 +10,25 @@ "unused": true, "strict": false, + // Relaxing + "es5": false, + // Environment "browser": true, + "jquery": true, "globals": { - "jQuery": false, + "mw": false, + "OO": false, "QUnit": false, - "mediaWiki": false + "unicodeJS": false, + "jQuery": false, + "mediaWiki": false, + "TemplateDataModel": true, + "TemplateDataDialog": true, + "TemplateDataOptionWidget": true, + "TemplateDataOptionImportWidget": true, + "TemplateDataLanguageSearchWidget": true, + "TemplateDataLanguageResultWidget": true } } diff --git a/TemplateData.hooks.php b/TemplateData.hooks.php index 1ceb025b..ca598004 100644 --- a/TemplateData.hooks.php +++ b/TemplateData.hooks.php @@ -34,13 +34,36 @@ class TemplateDataHooks { ) { $testModules['qunit']['ext.templateData.test'] = array( 'scripts' => array( 'tests/ext.templateData.tests.js' ), - 'dependencies' => array( 'ext.templateDataGenerator.core' ), + 'dependencies' => array( 'ext.templateDataGenerator.data' ), 'localBasePath' => __DIR__ , 'remoteExtPath' => 'TemplateData', ); return true; } + /** + * Conditionally register the jquery.uls.data module, in case they've already + * been registered by the UniversalLanguageSelector extension. + * + * @param ResourceLoader $resourceLoader + * @return boolean true + */ + public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { + $resourceModules = $resourceLoader->getConfig()->get( 'ResourceModules' ); + if ( !isset( $resourceModules['jquery.uls.data'] ) ) { + $resourceLoader->register( array( + 'jquery.uls.data' => array( + 'localBasePath' => __DIR__, + 'remoteExtPath' => 'TemplateData', + 'scripts' => array( + 'lib/jquery.uls/src/jquery.uls.data.js', + 'lib/jquery.uls/src/jquery.uls.data.utils.js', + ) + ) + ) ); + } + } + /** * @param Page &$page * @param User &$user diff --git a/TemplateData.php b/TemplateData.php index ee1a81cb..6f9b1780 100644 --- a/TemplateData.php +++ b/TemplateData.php @@ -39,6 +39,7 @@ $wgHooks['ParserFirstCallInit'][] = 'TemplateDataHooks::onParserFirstCallInit'; $wgHooks['PageContentSave'][] = 'TemplateDataHooks::onPageContentSave'; $wgHooks['UnitTestsList'][] = 'TemplateDataHooks::onUnitTestsList'; $wgHooks['ResourceLoaderTestModules'][] = 'TemplateDataHooks::onResourceLoaderTestModules'; +$wgHooks['ResourceLoaderRegisterModules'][] = 'TemplateDataHooks::onResourceLoaderRegisterModules'; $wgHooks['EditPage::showEditForm:initial'][] = 'TemplateDataHooks::onEditPage'; // Register APIs @@ -62,7 +63,7 @@ $wgResourceModules['ext.templateDataGenerator.editPage'] = array( 'modules/ext.templateDataGenerator.editPage.js', ), 'dependencies' => array( - 'ext.templateDataGenerator.core', + 'ext.templateDataGenerator.ui', ), 'messages' => array( 'templatedata-editbutton', @@ -72,53 +73,83 @@ $wgResourceModules['ext.templateDataGenerator.editPage'] = array( ) ); -$wgResourceModules['ext.templateDataGenerator.core'] = array( +$wgResourceModules['ext.templateDataGenerator.data'] = array( 'localBasePath' => $dir, 'remoteExtPath' => 'TemplateData', - 'styles' => 'modules/ext.templateDataGenerator.css', 'scripts' => array( - 'modules/ext.templateDataGenerator.core.js', + 'modules/ext.templateDataGenerator.data.js' ), 'dependencies' => array( - 'jquery.ui.dialog', - 'jquery.ui.button', - 'jquery.ui.sortable', + 'oojs' + ) +); + +$wgResourceModules['ext.templateDataGenerator.ui'] = array( + 'localBasePath' => $dir, + 'remoteExtPath' => 'TemplateData', + 'styles' => 'modules/ext.templateDataGenerator.ui.css', + 'scripts' => array( + 'modules/ext.templateDataGenerator.ui.js', + 'modules/widgets/ext.templateDataGenerator.optionWidget.js', + 'modules/widgets/ext.templateDataGenerator.optionImportWidget.js', + 'modules/widgets/ext.templateDataGenerator.languageResultWidget.js', + 'modules/widgets/ext.templateDataGenerator.languageSearchWidget.js', + 'modules/ext.templateDataGenerator.ui.tdDialog.js', + ), + 'dependencies' => array( + 'oojs-ui', + 'ext.templateDataGenerator.data', + 'jquery.uls.data' ), 'messages' => array( + 'comma-separator', + 'templatedata-modal-button-add-language', 'templatedata-modal-button-addparam', 'templatedata-modal-button-apply', + 'templatedata-modal-button-back', 'templatedata-modal-button-cancel', + 'templatedata-modal-button-changelang', 'templatedata-modal-button-delparam', 'templatedata-modal-button-importParams', + 'templatedata-modal-button-saveparam', + 'templatedata-modal-current-language', 'templatedata-modal-errormsg', 'templatedata-modal-errormsg-import-noparams', 'templatedata-modal-errormsg-import-paramsalreadyexist', 'templatedata-modal-notice-import-numparams', + 'templatedata-modal-placeholder-paramkey', + 'templatedata-modal-search-input-placeholder', 'templatedata-modal-table-param-actions', 'templatedata-modal-table-param-aliases', 'templatedata-modal-table-param-autovalue', 'templatedata-modal-table-param-default', - 'templatedata-modal-table-param-desc', + 'templatedata-modal-table-param-description', + 'templatedata-modal-table-param-importoption', + 'templatedata-modal-table-param-importoption-subtitle', 'templatedata-modal-table-param-label', 'templatedata-modal-table-param-name', 'templatedata-modal-table-param-required', 'templatedata-modal-table-param-suggested', 'templatedata-modal-table-param-type', 'templatedata-modal-table-param-type-boolean', + 'templatedata-modal-table-param-type-boolean', 'templatedata-modal-table-param-type-content', - 'templatedata-modal-table-param-type-wiki-file-name', + 'templatedata-modal-table-param-type-date', 'templatedata-modal-table-param-type-line', 'templatedata-modal-table-param-type-number', - 'templatedata-modal-table-param-type-boolean', - 'templatedata-modal-table-param-type-date', - 'templatedata-modal-table-param-type-wiki-page-name', 'templatedata-modal-table-param-type-string', 'templatedata-modal-table-param-type-unbalanced-wikitext', 'templatedata-modal-table-param-type-undefined', + 'templatedata-modal-table-param-type-wiki-file-name', + 'templatedata-modal-table-param-type-wiki-page-name', 'templatedata-modal-table-param-type-wiki-user-name', 'templatedata-modal-table-param-uneditablefield', 'templatedata-modal-title', + 'templatedata-modal-title-addparam', + 'templatedata-modal-title-choose-language', + 'templatedata-modal-title-language', 'templatedata-modal-title-templatedesc', + 'templatedata-modal-title-templateparam-details', 'templatedata-modal-title-templateparams', ) ); diff --git a/i18n/en.json b/i18n/en.json index a5867c5e..bbaf24e1 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -38,21 +38,30 @@ "templatedata-invalid-type": "Property \"$1\" is expected to be of type \"$2\".", "templatedata-invalid-unknown": "Unexpected property \"$1\".", "templatedata-invalid-value": "Invalid value for property \"$1\".", + "templatedata-modal-button-add-language": "Add language", "templatedata-modal-button-addparam": "Add parameter", "templatedata-modal-button-apply": "Apply", + "templatedata-modal-button-back": "Back", "templatedata-modal-button-cancel": "Cancel", - "templatedata-modal-button-delparam": "Remove", + "templatedata-modal-button-changelang": "Change language", + "templatedata-modal-button-delparam": "Remove parameter information", "templatedata-modal-button-importParams": "Import parameters", + "templatedata-modal-button-saveparam": "Save", + "templatedata-modal-current-language": "Current language: $1", "templatedata-modal-errormsg": "Errors found. Please make sure there are no empty or duplicate parameter names, and that the parameter name does not include \"$1\", \"$2\" or \"$3\".", "templatedata-modal-errormsg-import-noparams": "No new parameters found during import.", "templatedata-modal-errormsg-import-paramsalreadyexist": "Some parameters were not imported, because they already exist in the editor: $1", - "templatedata-modal-notice-import-numparams": "$1 new {{PLURAL:$1|parameter was|parameters were}} imported.", + "templatedata-modal-notice-import-numparams": "$1 new {{PLURAL:$1|parameter was|parameters were}} imported: $2", + "templatedata-modal-placeholder-paramkey": "Parameter name", + "templatedata-modal-search-input-placeholder": "Search by language name or code", "templatedata-modal-table-param-actions": "Actions", "templatedata-modal-table-param-aliases": "Aliases (comma separated)", "templatedata-modal-table-param-autovalue": "Auto value", "templatedata-modal-table-param-default": "Default", - "templatedata-modal-table-param-desc": "Description", - "templatedata-modal-table-param-label": "Label", + "templatedata-modal-table-param-description": "Description ($1)", + "templatedata-modal-table-param-importoption": "Add $1 suggested {{PLURAL:$1|parameter|parameters}}", + "templatedata-modal-table-param-importoption-subtitle": "Including: $1", + "templatedata-modal-table-param-label": "Label ($1)", "templatedata-modal-table-param-name": "Name", "templatedata-modal-table-param-required": "Required", "templatedata-modal-table-param-suggested": "Suggested", @@ -70,6 +79,10 @@ "templatedata-modal-table-param-type-wiki-user-name": "User", "templatedata-modal-table-param-uneditablefield": "Uneditable", "templatedata-modal-title": "Template documentation editor", - "templatedata-modal-title-templatedesc": "Template description", + "templatedata-modal-title-addparam": "Add new parameter", + "templatedata-modal-title-choose-language": "Choose language", + "templatedata-modal-title-language": "Language", + "templatedata-modal-title-templatedesc": "Template description ($1)", + "templatedata-modal-title-templateparam-details": "Parameter details: $1", "templatedata-modal-title-templateparams": "Template parameters" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 7f091ea2..268ef403 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -1,14 +1,15 @@ { "@metadata": { "authors": [ - "Sethladan", - "Shirayuki", - "Timo Tijhof", - "Robby", - "Stryn", + "Liuxinyu970226", "Nike", "Raymond", - "Liuxinyu970226" + "Robby", + "Sethladan", + "Shirayuki", + "Stryn", + "Timo Tijhof", + "Moriel Schottlender" ] }, "apihelp-templatedata-description": "{{doc-apihelp-description|templatedata}}", @@ -44,25 +45,34 @@ "templatedata-invalid-type": "Error message when a property is of the wrong type.\n* $1 - name of property. e.g. \"params.1.required\"\n* $2 - expected type of property. e.g. \"boolean\"", "templatedata-invalid-unknown": "Error message when an unknown property is found.\n* $1 - name of property. e.g. \"params.1.foobar\"", "templatedata-invalid-value": "Error message when a property that cannot contain free-form text has an invalid value.\n* $1 - name of property. e.g. \"params.1.type\"", + "templatedata-modal-button-add-language": "Label for the button to add a language in the edit dialog.", "templatedata-modal-button-addparam": "Button to add a parameter.\n{{Identical|Add parameter}}", "templatedata-modal-button-apply": "Label of the apply button.\n{{Identical|Apply}}", + "templatedata-modal-button-back": "Label for the button to go back in the templatedata edit dialog.", "templatedata-modal-button-cancel": "Label of the cancel button.\n{{Identical|Cancel}}", + "templatedata-modal-button-changelang": "Label for the button to change language in the edit dialog.", "templatedata-modal-button-delparam": "Button to remove a parameter.\n{{Identical|Remove}}", "templatedata-modal-button-importParams": "Label of the import button", + "templatedata-modal-button-saveparam": "Label for the button to save parameter details in the templatedata edit dialog.", + "templatedata-modal-current-language": "Label displaying the current language in the edit dialog. $1 - currently showing language.", "templatedata-modal-errormsg": "Error message that appears in the TemplateData generator GUI in case there are empty, duplicate or invalid parameter names.\n\nInvalid characters are supplied as parameters to avoid parsing errors in translation strings.\n\nParameters:\n* $1 - pipe (|)\n* $2 - equal sign (=)\n* $3 - double curly brackets (}})", "templatedata-modal-errormsg-import-noparams": "Error message that appears in the TemplateData generator GUI in case no template parameters were found during the import attempt.", "templatedata-modal-errormsg-import-paramsalreadyexist": "Error message that appears when some parameters were not imported from the template code because they already exist in the editor.\n\nParameters:\n* $1 - list of parameters that were not imported", - "templatedata-modal-notice-import-numparams": "Message that appears in the TemplateData generator GUI showing how many new parameters were imported into the GUI from an existing template.\n\nParameters:\n* $1 - number of parameters", - "templatedata-modal-table-param-actions": "Label for a table heading: Parameter actions in the table\n{{Identical|Action}}", - "templatedata-modal-table-param-aliases": "Label for a table heading: Aliases of the parameter, instruct the user to separate aliases with commas.", - "templatedata-modal-table-param-autovalue": "Label for a table heading: Parameter auto value in the table", - "templatedata-modal-table-param-default": "Label for a table heading: Default value of the parameter.\n{{Identical|Default}}", - "templatedata-modal-table-param-desc": "Label for a table heading: Description of the parameter.\n{{Identical|Description}}", - "templatedata-modal-table-param-label": "Label for a table heading: Label of the parameter.\n\nSee https://en.wikipedia.org/w/index.php?title=Template:Infobox_treaty/TemplateData&action=edit for example.\n{{Identical|Label}}", - "templatedata-modal-table-param-name": "Label for a table heading: Name of the parameter.\n{{Identical|Name}}", - "templatedata-modal-table-param-required": "Label for a table heading: Required status of the parameter.\n{{Identical|Required}}", - "templatedata-modal-table-param-suggested": "Label for a table heading: Suggested status of the parameter.\n{{Identical|Suggested}}", - "templatedata-modal-table-param-type": "Label for a table heading: Type of the parameter.\n{{Identical|Type}}", + "templatedata-modal-notice-import-numparams": "Message that appears in the TemplateData generator GUI showing how many new parameters were imported into the GUI from an existing template.\n\nParameters:\n* $1 - number of parameters. $2 - list of parameters that were imported", + "templatedata-modal-placeholder-paramkey": "Placeholder for the input that contains new parameter name in the add parameter panel in the edit dialog.", + "templatedata-modal-search-input-placeholder": "Placeholder text for language search panel.", + "templatedata-modal-table-param-actions": "Label for a parameter property input: Parameter actions in the table", + "templatedata-modal-table-param-aliases": "Label for a parameter property input: Aliases of the parameter, instruct the user to separate aliases with commas.", + "templatedata-modal-table-param-autovalue": "Label for a parameter property input: Parameter auto value in the table", + "templatedata-modal-table-param-default": "Label for a parameter property input: Default value of the parameter.\n{{Identical|Default}}", + "templatedata-modal-table-param-description": "Label for a parameter property input: Description of the parameter. $1 - currently showing language.\n{{Identical|Description}}", + "templatedata-modal-table-param-importoption": "Label for the import option in the parameter list in the edit dialog. $1 - number of suggested parameters that can be imported.", + "templatedata-modal-table-param-importoption-subtitle": "A list of suggested parameter names in the import option in the parameter list in the edit dialog. $1 - list (or partial list) of suggested parameter names to import.", + "templatedata-modal-table-param-label": "Label for a parameter property input: Label of the parameter.\n\nSee https://en.wikipedia.org/w/index.php?title=Template:Infobox_treaty/TemplateData&action=edit for example. $1 - currently showing language.\n{{Identical|Label}}", + "templatedata-modal-table-param-name": "Label for a parameter property input: Name of the parameter.\n{{Identical|Name}}", + "templatedata-modal-table-param-required": "Label for a parameter property input: Required status of the parameter.\n{{Identical|Required}}", + "templatedata-modal-table-param-suggested": "Label for a parameter property input: Suggested status of the parameter.\n{{Identical|Suggested}}", + "templatedata-modal-table-param-type": "Label for a parameter property input: Type of the parameter.\n{{Identical|Type}}", "templatedata-modal-table-param-type-boolean": "A possible parameter type: Boolean\n{{Related|Templatedata-modal-table-param-type}}", "templatedata-modal-table-param-type-content": "A possible parameter type: Content\n{{Related|Templatedata-modal-table-param-type}}\n{{Identical|Content}}", "templatedata-modal-table-param-type-date": "A possible parameter type: Date\n{{Related|Templatedata-modal-table-param-type}}\n{{Identical|Date}}", @@ -74,8 +84,12 @@ "templatedata-modal-table-param-type-wiki-file-name": "A possible parameter type: File\n{{Related|Templatedata-modal-table-param-type}}\n{{Identical|File}}", "templatedata-modal-table-param-type-wiki-page-name": "A possible parameter type: Page\n{{Related|Templatedata-modal-table-param-type}}\n{{Identical|Page}}", "templatedata-modal-table-param-type-wiki-user-name": "A possible parameter type: User\n{{Related|Templatedata-modal-table-param-type}}\n{{Identical|User}}", - "templatedata-modal-table-param-uneditablefield": "Placeholder text notifying the user the field is uneditable\n{{Identical|Uneditable}}", - "templatedata-modal-title": "Title of the modal popup.", - "templatedata-modal-title-templatedesc": "The title for the template description textbox", + "templatedata-modal-table-param-uneditablefield": "Placeholder text notifying the user the field is uneditable", + "templatedata-modal-title": "Title of the edit dialog.", + "templatedata-modal-title-addparam": "Title for add new parameter panel in the edit dialog.\n{{Identical|Add parameter}}", + "templatedata-modal-title-choose-language": "Title for the choose language panel in the edit dialog.", + "templatedata-modal-title-language": "Label for the language dropdown in the edit menu.", + "templatedata-modal-title-templatedesc": "The title for the template description textbox. $1 - currently used language.", + "templatedata-modal-title-templateparam-details": "The title for the parameter information section. $1: The parameter name.", "templatedata-modal-title-templateparams": "The title for the template parameters table" } diff --git a/lib/jquery.uls/CREDITS b/lib/jquery.uls/CREDITS new file mode 100644 index 00000000..51b31ed6 --- /dev/null +++ b/lib/jquery.uls/CREDITS @@ -0,0 +1,13 @@ +Universal Language Selector, part of Project Milkshake, is a collaborative +project released under the GNU General Public License v2. We would like to +recognize the following names for their contribution to the product. + +== Developers == +* Alolita Sharma +* Amir Aharoni +* Arun Ganesh +* Brandon Harris +* Niklas Laxström +* Pau Giner +* Santhosh Thottingal +* Siebrand Mazeland diff --git a/lib/jquery.uls/GPL-LICENSE b/lib/jquery.uls/GPL-LICENSE new file mode 100644 index 00000000..019694a9 --- /dev/null +++ b/lib/jquery.uls/GPL-LICENSE @@ -0,0 +1,342 @@ +== GNU GENERAL PUBLIC LICENSE == + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +=== Preamble === + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +== TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION == + +'''0.''' This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +'''1.''' You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +'''2.''' You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + '''a)''' You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + '''b)''' You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + '''c)''' If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +'''3.''' You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + '''a)''' Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + '''b)''' Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + '''c)''' Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +'''4.''' You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +'''5.''' You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +'''6.''' Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +'''7.''' If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +'''8.''' If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +'''9.''' The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +'''10.''' If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +=== NO WARRANTY === + +'''11.''' BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +'''12.''' IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + '''END OF TERMS AND CONDITIONS''' + +== How to Apply These Terms to Your New Programs == + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/lib/jquery.uls/src/jquery.uls.data.js b/lib/jquery.uls/src/jquery.uls.data.js new file mode 100644 index 00000000..8f09d92e --- /dev/null +++ b/lib/jquery.uls/src/jquery.uls.data.js @@ -0,0 +1,7 @@ +// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php +( function ( $ ) { + 'use strict'; + $.uls = $.uls || {}; + //noinspection JSHint + $.uls.data = {"languages":{"aa":["Latn",["AF"],"Qafár af"],"ab":["Cyrl",["EU"],"Аҧсшәа"],"ace":["Latn",["AS","PA"],"Acèh"],"ady":["Cyrl",["EU","ME"],"Адыгэбзэ"],"ady-cyrl":["ady"],"ady-latn":["Latn",["EU","ME"],"Adygabze"],"aeb":["Arab",["AF"],"زَوُن"],"af":["Latn",["AF"],"Afrikaans"],"ahr":["Deva",["AS"],"अहिराणी"],"ak":["Latn",["AF"],"Akan"],"akz":["Latn",["AM"],"Albaamo innaaɬiilka"],"aln":["Latn",["EU"],"Gegë"],"am":["Ethi",["AF"],"አማርኛ"],"an":["Latn",["EU"],"aragonés"],"ang":["Latn",["EU"],"Ænglisc"],"anp":["Deva",["AS"],"अङ्गिका"],"ar":["Arab",["ME"],"العربية"],"arc":["Syrc",["ME"],"ܐܪܡܝܐ"],"arn":["Latn",["AM"],"mapudungun"],"aro":["Latn",["AM"],"Araona"],"arq":["Latn",["AF"],"Dziri"],"ary":["Latn",["ME"],"Maġribi"],"arz":["Arab",["ME"],"مصرى"],"as":["Beng",["AS"],"অসমীয়া"],"ase":["Sgnw",["AM"],"American sign language"],"ast":["Latn",["EU"],"asturianu"],"av":["Cyrl",["EU"],"авар"],"avk":["Latn",["WW"],"Kotava"],"ay":["Latn",["AM"],"Aymar aru"],"az":["az-latn"],"az-latn":["Latn",["EU","ME"],"azərbaycanca"],"az-arab":["Arab",["EU","ME"],"آذربايجانجا"],"az-cyrl":["Latn",["EU","ME"],"азәрбајҹанҹа"],"azb":["az-arab"],"ba":["Cyrl",["EU"],"башҡортса"],"bar":["Latn",["EU"],"Boarisch"],"bat-smg":["sgs"],"bbc-latn":["Latn",["AS"],"Batak Toba"],"bbc-batk":["Batk",["AS"],"Batak Toba"],"bbc":["Latn",["AS"],"Batak Toba"],"bcc":["Arab",["AS","ME"],"بلوچی مکرانی"],"bcl":["Latn",["AS"],"Bikol Central"],"be-tarask":["Cyrl",["EU"],"беларуская (тарашкевіца)"],"be-x-old":["be-tarask"],"be":["Cyrl",["EU"],"беларуская"],"bew":["Latn",["AS"],"Bahasa Betawi"],"bfq":["Taml",["AS"],"படகா"],"bg":["Cyrl",["EU"],"български"],"bh":["Deva",["AS"],"भोजपुरी"],"bho":["Deva",["AS"],"भोजपुरी"],"bi":["Latn",["PA"],"Bislama"],"bjn":["Latn",["AS"],"Bahasa Banjar"],"bm":["Latn",["AF"],"bamanankan"],"bn":["Beng",["AS"],"বাংলা"],"bo":["Tibt",["AS"],"བོད་ཡིག"],"bpy":["Beng",["AS"],"বিষ্ণুপ্রিয়া মণিপুরী"],"bqi":["Arab",["ME"],"بختياري"],"br":["Latn",["EU"],"brezhoneg"],"brh":["Latn",["ME","AS"],"Bráhuí"],"brx":["Deva",["AS"],"बड़ो"],"bs":["Latn",["EU"],"bosanski"],"bto":["Latn",["AS"],"Iriga Bicolano"],"bug":["Bugi",["AS"],"ᨅᨔ ᨕᨘᨁᨗ"],"bxr":["Cyrl",["AS"],"буряад"],"ca":["Latn",["EU"],"català"],"cbk-zam":["Latn",["AS"],"Chavacano de Zamboanga"],"cdo":["Latn",["AS"],"Mìng-dĕ̤ng-ngṳ̄"],"ce":["Cyrl",["EU"],"нохчийн"],"ceb":["Latn",["AS"],"Cebuano"],"ch":["Latn",["PA"],"Chamoru"],"cho":["Latn",["AM"],"Choctaw"],"chr":["Cher",["AM"],"ᏣᎳᎩ"],"chy":["Latn",["AM"],"Tsetsêhestâhese"],"ckb":["Arab",["ME"],"کوردی"],"co":["Latn",["EU"],"corsu"],"cps":["Latn",["AS"],"Capiceño"],"cr":["Cans",["AM"],"ᓀᐦᐃᔭᐍᐏᐣ"],"cr-cans":["cr"],"cr-latn":["Latn",["AM"],"Nēhiyawēwin"],"crh":["Latn",["EU"],"qırımtatarca"],"crh-cyrl":["Cyrl",["EU"],"къырымтатарджа"],"crh-latn":["crh"],"cs":["Latn",["EU"],"česky"],"csb":["Latn",["EU"],"kaszëbsczi"],"cu":["Cyrl",["EU"],"словѣньскъ \/ ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ"],"cv":["Cyrl",["EU"],"Чӑвашла"],"cy":["Latn",["EU"],"Cymraeg"],"da":["Latn",["EU"],"dansk"],"de-at":["Latn",["EU"],"Österreichisches Deutsch"],"de-ch":["Latn",["EU"],"Schweizer Hochdeutsch"],"de-formal":["Latn",["EU"],"Deutsch (Sie-Form)"],"de":["Latn",["EU"],"Deutsch"],"diq":["Latn",["EU","AS"],"Zazaki"],"dsb":["Latn",["EU"],"dolnoserbski"],"dtp":["Latn",["AS"],"Dusun Bundu-liwan"],"dv":["Thaa",["AS"],"ދިވެހިބަސް"],"dz":["Tibt",["AS"],"ཇོང་ཁ"],"ee":["Latn",["AF"],"eʋegbe"],"egl":["Latn",["EU"],"Emiliàn"],"el":["Grek",["EU"],"Ελληνικά"],"eml":["Latn",["EU"],"emiliàn e rumagnòl"],"en-ca":["Latn",["AM"],"Canadian English"],"en-gb":["Latn",["EU","AS","PA"],"British English"],"en":["Latn",["EU","AM","AF","ME","AS","PA","WW"],"English"],"eo":["Latn",["WW"],"Esperanto"],"es-419":["Latn",["AM"],"español de America Latina"],"es-formal":["Latn",["EU","AM","AF","WW"],"español (formal)"],"es":["Latn",["EU","AM","AF","WW"],"español"],"esu":["Latn",["AM"],"Yup'ik"],"et":["Latn",["EU"],"eesti"],"eu":["Latn",["EU"],"euskara"],"ext":["Latn",["EU"],"estremeñu"],"fa":["Arab",["ME"],"فارسی"],"ff":["Latn",["AF"],"Fulfulde"],"fi":["Latn",["EU"],"suomi"],"fil":["tl"],"fit":["Latn",["EU"],"meänkieli"],"fiu-vro":["vro"],"fj":["Latn",["PA"],"Na Vosa Vakaviti"],"fo":["Latn",["EU"],"føroyskt"],"fr":["Latn",["EU","AM","WW"],"français"],"frc":["Latn",["AM"],"français cadien"],"frp":["Latn",["EU"],"arpetan"],"frr":["Latn",["EU"],"Nordfriisk"],"fur":["Latn",["EU"],"furlan"],"fy":["Latn",["EU"],"Frysk"],"ga":["Latn",["EU"],"Gaeilge"],"gag":["Latn",["EU"],"Gagauz"],"gah":["Latn",["AS"],"Alekano"],"gan-hans":["Hans",["AS"],"赣语(简体)"],"gan-hant":["gan"],"gan":["Hant",["AS"],"贛語"],"gbz":["Latn",["AS"],"Dari"],"gcf":["Latn",["AM"],"Guadeloupean Creole French"],"gd":["Latn",["EU"],"Gàidhlig"],"gl":["Latn",["EU"],"galego"],"glk":["Arab",["ME"],"گیلکی"],"gn":["Latn",["AM"],"Avañe'ẽ"],"gom":["Deva",["AS"],"कोंकणी"],"gom-deva":["gom"],"gom-latn":["Latn",["AS"],"Konknni"],"got":["Goth",["EU"],"𐌲𐌿𐍄𐌹𐍃𐌺"],"grc":["Grek",["EU"],"Ἀρχαία ἑλληνικὴ"],"gsw":["Latn",["EU"],"Alemannisch"],"gu":["Gujr",["AS"],"ગુજરાતી"],"guc":["Latn",["AM"],"Wayúu"],"gur":["Latn",["AF"],"Gurenɛ"],"gv":["Latn",["EU"],"Gaelg"],"ha-arab":["Arab",["AF"],"هَوُسَ"],"ha-latn":["Latn",["AF"],"Hausa"],"ha":["ha-latn"],"hak":["Latn",["AS"],"Hak-kâ-fa"],"haw":["Latn",["AM","PA"],"Hawai`i"],"he":["Hebr",["ME"],"עברית"],"hi":["Deva",["AS"],"हिन्दी"],"hif":["Latn",["PA","AS"],"Fiji Hindi"],"hif-deva":["Deva",["AS"],"फ़ीजी हिन्दी"],"hif-latn":["hif"],"hil":["Latn",["AS"],"Ilonggo"],"hne":["Deva",["AS"],"छत्तीसगढ़ी"],"ho":["Latn",["PA"],"Hiri Motu"],"hr":["Latn",["EU"],"hrvatski"],"hsb":["Latn",["EU"],"hornjoserbsce"],"hsn":["Hans",["AS"],"湘语"],"ht":["Latn",["AM"],"Kreyòl ayisyen"],"hu-formal":["Latn",["EU"],"Magyar (magázó)"],"hu":["Latn",["EU"],"magyar"],"hy":["Armn",["EU","ME"],"Հայերեն"],"hz":["Latn",["AF"],"Otsiherero"],"ia":["Latn",["WW"],"interlingua"],"id":["Latn",["AS"],"Bahasa Indonesia"],"ie":["Latn",["WW"],"Interlingue"],"ig":["Latn",["AF"],"Igbo"],"ii":["Yiii",["AS"],"ꆇꉙ"],"ik":["Latn",["AM"],"Iñupiak"],"ike-cans":["Cans",["AM"],"ᐃᓄᒃᑎᑐᑦ"],"ike-latn":["Latn",["AM"],"inuktitut"],"ilo":["Latn",["AS"],"Ilokano"],"inh":["Cyrl",["EU"],"ГӀалгӀай"],"io":["Latn",["WW"],"Ido"],"is":["Latn",["EU"],"íslenska"],"it":["Latn",["EU"],"italiano"],"iu":["Cans",["AM"],"ᐃᓄᒃᑎᑐᑦ"],"ja":["Jpan",["AS"],"日本語"],"jam":["Latn",["AM"],"Patois"],"jbo":["Latn",["WW"],"lojban"],"jut":["Latn",["EU"],"jysk"],"jv":["Latn",["AS","PA"],"Basa Jawa"],"jv-java":["Java",["AS","PA"],"ꦧꦱꦗꦮ"],"ka":["Geor",["EU"],"ქართული"],"kaa":["Latn",["AS"],"Qaraqalpaqsha"],"kab":["Latn",["AF","EU"],"Taqbaylit"],"kbd-cyrl":["kbd"],"kbd-latn":["Latn",["EU"],"Qabardjajəbza"],"kbd":["Cyrl",["EU","ME"],"Адыгэбзэ"],"kea":["Latn",["AF"],"Kabuverdianu"],"kg":["Latn",["AF"],"Kongo"],"kgp":["Latn",["AM"],"Kaingáng"],"khw":["Arab",["ME","AS"],"کھوار"],"ki":["Latn",["AF"],"Gĩkũyũ"],"kiu":["Latn",["EU","ME"],"Kırmancki"],"kj":["Latn",["AF"],"Kwanyama"],"kk":["kk-cyrl"],"kk-arab":["Arab",["EU","AS"],"قازاقشا (تٶتە)"],"kk-cn":["kk-arab"],"kk-cyrl":["Cyrl",["EU","AS"],"қазақша"],"kk-kz":["kk-cyrl"],"kk-latn":["Latn",["EU","AS","ME"],"qazaqşa"],"kk-tr":["kk-latn"],"kl":["Latn",["AM","EU"],"kalaallisut"],"km":["Khmr",["AS"],"ភាសាខ្មែរ"],"kn":["Knda",["AS"],"ಕನ್ನಡ"],"ko-kp":["Kore",["AS"],"한국어 (조선)"],"ko":["Kore",["AS"],"한국어"],"koi":["Cyrl",["EU"],"Перем Коми"],"kr":["Latn",["AF"],"Kanuri"],"krc":["Cyrl",["EU"],"къарачай-малкъар"],"kri":["Latn",["AF"],"Krio"],"krj":["Latn",["ME","EU"],"Kinaray-a"],"krl":["Latn",["EU"],"Karjala"],"ks-arab":["Arab",["AS"],"کٲشُر"],"ks-deva":["Deva",["AS"],"कॉशुर"],"ks":["Arab",["AS"],"کٲشُر"],"ksf":["Latn",["AF"],"Bafia"],"ksh":["Latn",["EU"],"Ripoarisch"],"ku":["ku-latn"],"ku-arab":["Arab",["EU","ME"],"كوردي"],"ku-latn":["Latn",["EU","ME"],"Kurdî"],"kv":["Cyrl",["EU"],"коми"],"kw":["Latn",["EU"],"kernowek"],"ky":["Cyrl",["AS"],"Кыргызча"],"la":["Latn",["EU"],"Latina"],"lad":["lad-latn"],"lad-latn":["Latn",["ME","EU","AM"],"Ladino"],"lad-hebr":["Hebr",["ME","EU","AM"],"לאדינו"],"lb":["Latn",["EU"],"Lëtzebuergesch"],"lbe":["Cyrl",["EU"],"лакку"],"lez":["Cyrl",["EU"],"лезги"],"lfn":["Latn",["WW"],"Lingua Franca Nova"],"lg":["Latn",["AF"],"Luganda"],"li":["Latn",["EU"],"Limburgs"],"lij":["Latn",["EU"],"Ligure"],"liv":["Latn",["EU"],"Līvõ kēļ"],"lld":["Latn",["EU"],"Ladin"],"lmo":["Latn",["EU"],"lumbaart"],"ln":["Latn",["AF"],"lingála"],"lo":["Laoo",["AS"],"ລາວ"],"loz":["Latn",["AF"],"Silozi"],"lt":["Latn",["EU"],"lietuvių"],"lrc":["Arab",["AS"],"لوری"],"ltg":["Latn",["EU"],"latgaļu"],"lus":["Latn",["AS"],"Mizo ţawng"],"lut":["Latn",["AM"],"dxʷləšucid"],"lv":["Latn",["EU"],"latviešu"],"lzh":["Hant",["AS"],"文言"],"lzz":["Latn",["EU","ME"],"Lazuri"],"mai":["Deva",["AS"],"मैथिली"],"map-bms":["Latn",["AS"],"Basa Banyumasan"],"mdf":["Cyrl",["EU"],"мокшень"],"mfe":["Latn",["AM"],"Morisyen"],"mg":["Latn",["AF"],"Malagasy"],"mh":["Latn",["PA"],"Ebon"],"mhr":["Cyrl",["EU"],"олык марий"],"mi":["Latn",["PA"],"Māori"],"mic":["Latn",["AM"],"Mi'kmaq"],"min":["Latn",["AS"],"Baso Minangkabau"],"mk":["Cyrl",["EU"],"македонски"],"ml":["Mlym",["AS","ME"],"മലയാളം"],"mn":["Cyrl",["AS"],"монгол"],"mnc":["Mong",["AS"],"ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ"],"mni":["Beng",["AS"],"মেইতেই লোন্"],"mnw":["Mymr",["AS"],"ဘာသာ မန်"],"mo":["Cyrl",["EU"],"молдовеняскэ"],"mr":["Deva",["AS","ME"],"मराठी"],"mrj":["Cyrl",["EU"],"кырык мары"],"ms":["Latn",["AS"],"Bahasa Melayu"],"mt":["Latn",["EU"],"Malti"],"mui":["Latn",["AS"],"Musi"],"mus":["Latn",["AM"],"Mvskoke"],"mwl":["Latn",["EU"],"Mirandés"],"mwv":["Latn",["AS"],"Behase Mentawei"],"my":["Mymr",["AS"],"မြန်မာဘာသာ"],"myv":["Cyrl",["EU"],"эрзянь"],"mzn":["Arab",["ME","AS"],"مازِرونی"],"na":["Latn",["PA"],"Dorerin Naoero"],"nah":["Latn",["AM"],"Nāhuatl"],"nan":["Latn",["AS"],"Bân-lâm-gú"],"nap":["Latn",["EU"],"Nnapulitano"],"nb":["Latn",["EU"],"norsk (bokmål)"],"nds-nl":["Latn",["EU"],"Nedersaksisch"],"nds":["Latn",["EU"],"Plattdüütsch"],"ne":["Deva",["AS"],"नेपाली"],"new":["Deva",["AS"],"नेपाल भाषा"],"ng":["Latn",["AF"],"Oshiwambo"],"niu":["Latn",["PA"],"ko e vagahau Niuē"],"njo":["Latn",["AS"],"Ao"],"nl-informal":["Latn",["EU","AM"],"Nederlands (informeel)"],"nl":["Latn",["EU","AM"],"Nederlands"],"nn":["Latn",["EU"],"norsk (nynorsk)"],"no":["Latn",["EU"],"norsk"],"nov":["Latn",["WW"],"Novial"],"nqo":["Nkoo",["AF"],"ߒߞߏ"],"nrm":["Latn",["EU"],"Nouormand"],"nso":["Latn",["AF"],"Sesotho sa Leboa"],"nv":["Latn",["AM"],"Diné bizaad"],"ny":["Latn",["AF"],"Chi-Chewa"],"oc":["Latn",["EU"],"occitan"],"om":["Latn",["AF"],"Oromoo"],"or":["Orya",["AS"],"ଓଡ଼ିଆ"],"os":["Cyrl",["EU"],"Ирон"],"ota":["Latn",["AS","EU"],"Ottoman Turkish"],"pa":["pa-guru"],"pa-guru":["Guru",["AS"],"ਪੰਜਾਬੀ"],"pag":["Latn",["AS"],"Pangasinan"],"pam":["Latn",["AS"],"Kapampangan"],"pap":["Latn",["AM"],"Papiamentu"],"pcd":["Latn",["EU"],"Picard"],"pdc":["Latn",["EU","AM"],"Deitsch"],"pdt":["Latn",["EU","AM"],"Plautdietsch"],"pfl":["Latn",["EU"],"Pälzisch"],"pi":["Deva",["AS"],"पालि"],"pih":["Latn",["PA"],"Norfuk \/ Pitkern"],"pis":["Latn",["PA"],"Pijin"],"pko":["Latn",["AF"],"Pökoot"],"pl":["Latn",["EU"],"polski"],"pms":["Latn",["EU"],"Piemontèis"],"pnb":["Arab",["AS","ME"],"پنجابی"],"pnt":["Grek",["EU"],"Ποντιακά"],"ppl":["Latn",["AM"],"Nawat"],"prg":["Latn",["EU"],"Prūsiskan"],"ps":["Arab",["AS","ME"],"پښتو"],"pt-br":["Latn",["AM"],"português do Brasil"],"pt":["Latn",["EU","AM","AS","PA","AF","WW"],"português"],"qu":["Latn",["AM"],"Runa Simi"],"qug":["Latn",["AM"],"Runa shimi"],"rap":["Latn",["AM"],"arero rapa nui"],"rgn":["Latn",["EU"],"Rumagnôl"],"rif":["Latn",["AF"],"Tarifit"],"rki":["Mymr",["AS"],"ရခိုင်"],"rm":["Latn",["EU"],"rumantsch"],"rmf":["Latn",["EU"],"kaalengo tšimb"],"rmy":["Latn",["EU"],"Romani"],"rn":["Latn",["AF"],"Kirundi"],"ro":["Latn",["EU"],"română"],"roa-rup":["rup"],"roa-tara":["Latn",["EU"],"tarandíne"],"rtm":["Latn",["PA"],"Faeag Rotuma"],"ru":["Cyrl",["EU","AS","ME"],"русский"],"rue":["Cyrl",["EU"],"русиньскый"],"rup":["Latn",["EU"],"Armãneashce"],"ruq":["Cyrl",["EU"],"Влахесте"],"ruq-cyrl":["ruq"],"ruq-grek":["Grek",["EU"],"Megleno-Romanian (Greek script)"],"ruq-latn":["Latn",["EU"],"Vlăheşte"],"rw":["Latn",["AF"],"Kinyarwanda"],"rwr":["Deva",["AS"],"मारवाड़ी"],"ryu":["Kana",["AS"],"ʔucināguci"],"sa":["Deva",["AS"],"संस्कृतम्"],"sah":["Cyrl",["EU","AS"],"саха тыла"],"sat":["Latn",["AS"],"Santali"],"saz":["Saur",["AS"],"ꢱꣃꢬꢵꢯ꣄ꢡ꣄ꢬꢵ"],"sc":["Latn",["EU"],"sardu"],"scn":["Latn",["EU"],"sicilianu"],"sco":["Latn",["EU"],"Scots"],"sd":["Arab",["AS"],"سنڌي"],"sdc":["Latn",["EU"],"Sassaresu"],"se":["Latn",["EU"],"sámegiella"],"ses":["Latn",["AF"],"Koyraboro Senni"],"sei":["Latn",["AM"],"Cmique Itom"],"sg":["Latn",["AF"],"Sängö"],"sgs":["Latn",["EU"],"žemaitėška"],"sh":["Latn",["EU"],"srpskohrvatski"],"shi-latn":["Latn",["AF"],"Tašlḥiyt"],"shi-tfng":["Tfng",["AF"],"ⵜⴰⵛⵍⵃⵉⵜ"],"shi":["shi-latn"],"shn":["Mymr",["AS"],"လိၵ်ႈတႆး"],"si":["Sinh",["AS"],"සිංහල"],"simple":["Latn",["WW"],"Simple English"],"sk":["Latn",["EU"],"slovenčina"],"sl":["Latn",["EU"],"slovenščina"],"sli":["Latn",["EU"],"Schläsch"],"slr":["Latn",["AS"],"Salırça"],"sly":["Latn",["AS"],"Bahasa Selayar"],"syc":["Syrc",["ME"],"ܣܘܪܝܝܐ"],"sm":["Latn",["PA"],"Gagana Samoa"],"sma":["Latn",["EU"],"åarjelsaemien"],"smj":["Latn",["EU"],"julevsámegiella"],"smn":["Latn",["EU"],"anarâškielâ"],"sms":["Latn",["EU"],"sää´mǩiõll"],"sn":["Latn",["AF"],"chiShona"],"so":["Latn",["AF"],"Soomaaliga"],"sq":["Latn",["EU"],"shqip"],"sr":["sr-cyrl"],"sr-ec":["sr-cyrl"],"sr-cyrl":["Cyrl",["EU"],"српски"],"sr-el":["sr-latn"],"sr-latn":["Latn",["EU"],"srpski"],"srn":["Latn",["AM","EU"],"Sranantongo"],"ss":["Latn",["AF"],"SiSwati"],"st":["Latn",["AF"],"Sesotho"],"stq":["Latn",["EU"],"Seeltersk"],"su":["Latn",["AS"],"Basa Sunda"],"sv":["Latn",["EU"],"svenska"],"sw":["Latn",["AF"],"Kiswahili"],"swb":["Latn",["AF"],"Shikomoro"],"sxu":["Latn",["EU"],"Säggssch"],"szl":["Latn",["EU"],"ślůnski"],"ta":["Taml",["AS"],"தமிழ்"],"tcy":["Knda",["AS"],"ತುಳು"],"te":["Telu",["AS"],"తెలుగు"],"tet":["Latn",["AS","PA"],"tetun"],"tg-cyrl":["Cyrl",["AS"],"тоҷикӣ"],"tg-latn":["Latn",["AS"],"tojikī"],"tg":["Cyrl",["AS"],"тоҷикӣ"],"th":["Thai",["AS"],"ไทย"],"ti":["Ethi",["AF"],"ትግርኛ"],"tk":["Latn",["AS"],"Türkmençe"],"tkr":["Cyrl",["AS"],"ЦӀаьхна миз"],"tl":["Latn",["AS"],"Tagalog"],"tly":["Cyrl",["EU","AS","ME"],"толышә зывон"],"tn":["Latn",["AF"],"Setswana"],"to":["Latn",["PA"],"lea faka-Tonga"],"tokipona":["Latn",["WW"],"Toki Pona"],"tpi":["Latn",["PA","AS"],"Tok Pisin"],"tr":["Latn",["EU","ME"],"Türkçe"],"trp":["Latn",["AS"],"Kokborok (Tripuri)"],"tru":["Latn",["AS"],"Ṫuroyo"],"ts":["Latn",["AF"],"Xitsonga"],"tsd":["Grek",["EU"],"Τσακωνικά"],"tt":["Cyrl",["EU"],"татарча"],"tt-cyrl":["tt"],"tt-latn":["Latn",["EU"],"tatarça"],"ttt":["Cyrl",["AS"],"Tati"],"tum":["Latn",["AF"],"chiTumbuka"],"tw":["Latn",["AF"],"Twi"],"twd":["Latn",["EU"],"Tweants"],"ty":["Latn",["PA"],"Reo Mā`ohi"],"tyv":["Cyrl",["AS"],"тыва дыл"],"tzm":["Tfng",["AF"],"ⵜⴰⵎⴰⵣⵉⵖⵜ"],"udm":["Cyrl",["EU"],"удмурт"],"ug":["ug-arab"],"ug-arab":["Arab",["AS"],"ئۇيغۇرچە"],"ug-latn":["Latn",["AS"],"uyghurche"],"ug-cyrl":["Cyrl",["AS"],"уйғурчә"],"uk":["Cyrl",["EU"],"українська"],"ur":["Arab",["AS","ME"],"اردو"],"uz":["Latn",["AS"],"oʻzbekcha"],"ve":["Latn",["AF"],"Tshivenda"],"vec":["Latn",["EU"],"vèneto"],"vep":["Latn",["EU"],"vepsän kel’"],"vi":["Latn",["AS"],"Tiếng Việt"],"vls":["Latn",["EU"],"West-Vlams"],"vmf":["Latn",["EU"],"Mainfränkisch"],"vo":["Latn",["WW"],"Volapük"],"vot":["Latn",["EU"],"Vaďďa"],"vro":["Latn",["EU"],"Võro"],"wa":["Latn",["EU"],"walon"],"war":["Latn",["AS"],"Winaray"],"wls":["Latn",["PA"],"Faka'uvea"],"wo":["Latn",["AF"],"Wolof"],"wuu":["Hans",["AS"],"吴语"],"xal":["Cyrl",["EU"],"хальмг"],"xh":["Latn",["AF"],"isiXhosa"],"xmf":["Geor",["EU"],"მარგალური"],"ydd":["Hebr",["AS","EU"],"Eastern Yiddish"],"yi":["Hebr",["ME","EU","AM"],"ייִדיש"],"yo":["Latn",["AF"],"Yorùbá"],"yrk":["Cyrl",["AS"],"Ненэцяʼ вада"],"yrl":["Latn",["AM"],"ñe'engatú"],"yua":["Latn",["AM"],"Maaya T'aan"],"yue":["Hant",["AS"],"粵語"],"za":["Latn",["AS"],"Vahcuengh"],"zea":["Latn",["EU"],"Zeêuws"],"zh":["Hans",["AS"],"中文"],"zh-classical":["Hant",["AS"],"文言"],"zh-cn":["Hans",["AS"],"中文(中国大陆)"],"zh-hans":["Hans",["AS"],"中文(简体)"],"zh-hant":["Hant",["AS"],"中文(繁體)"],"zh-hk":["Hant",["AS"],"中文(香港)"],"zh-min-nan":["nan"],"zh-mo":["Hant",["AS"],"中文(澳門)"],"zh-my":["Hans",["AS"],"中文(马来西亚)"],"zh-sg":["Hans",["AS"],"中文(新加坡)"],"zh-tw":["Hant",["AS"],"中文(台灣)"],"zh-yue":["yue"],"zu":["Latn",["AF"],"isiZulu"]},"scriptgroups":{"Latin":["Latn","Goth"],"Greek":["Grek"],"WestCaucasian":["Armn","Geor"],"Arabic":["Arab"],"MiddleEastern":["Hebr","Syrc"],"African":["Ethi","Nkoo","Tfng"],"SouthAsian":["Beng","Deva","Gujr","Guru","Knda","Mlym","Orya","Saur","Sinh","Taml","Telu","Tibt","Thaa"],"Cyrillic":["Cyrl"],"CJK":["Hans","Hant","Kana","Kore","Jpan","Yiii"],"SouthEastAsian":["Batk","Bugi","Java","Khmr","Laoo","Mymr","Thai"],"Mongolian":["Mong"],"SignWriting":["Sgnw"],"NativeAmerican":["Cher","Cans"],"Special":["Zyyy"]},"rtlscripts":["Arab","Hebr","Syrc","Nkoo","Thaa"],"regiongroups":{"WW":1,"SP":1,"AM":2,"EU":3,"ME":3,"AF":3,"AS":4,"PA":4},"territories":{"AC":["en"],"AD":["ca","es","fr"],"AE":["ar","ml","ps","bal","fa"],"AF":["fa","ps","haz","uz-arab","tk-latn","prd","bal","ug-arab","kk-arab"],"AG":["en","pt"],"AI":["en"],"AL":["sq","el","mk"],"AM":["hy","az-latn","ku-latn"],"AO":["pt","umb","kmb","ln"],"AQ":["und"],"AR":["es","cy","gn"],"AS":["sm","en"],"AT":["de","hr","sl","hu"],"AU":["en","zh-hant","it"],"AW":["nl","pap","en"],"AX":["sv"],"AZ":["az-latn","az-cyrl","ku-latn"],"BA":["bs-cyrl","bs-latn","hr","sr-cyrl","sr-latn"],"BB":["en"],"BD":["bn","rkt","syl","ccp","my","grt","mni"],"BE":["nl","en","fr","wa","de"],"BF":["mos","dyu","fr"],"BG":["bg","tr"],"BH":["ar","ml"],"BI":["rn","fr","sw"],"BJ":["fr","fon","yo"],"BL":["fr"],"BM":["en"],"BN":["ms-latn","zh-hant","ms-arab","en"],"BO":["es","qu","ay","gn"],"BQ":["pap","nl"],"BR":["pt","de","it","ja","ko","kgp","gub","xav"],"BS":["en"],"BT":["dz","ne","tsj","lep"],"BV":["und"],"BW":["en","tn","af"],"BY":["be","ru"],"BZ":["en","es"],"CA":["en","fr","it","de","cr-cans","crk","yi","iu","moe","crj","atj","crl","csw","crm","ikt","dgr","den","scs","nsk","chp","gwi"],"CC":["ms-arab","en"],"CD":["sw","lua","swc","fr","ln","lu","kg","lol","rw"],"CF":["fr","sg","ln"],"CG":["fr","ln"],"CH":["de","fr","gsw","it","lmo","rm","rmo","wae"],"CI":["fr","bci","sef","daf","kfo","bqv"],"CK":["en"],"CL":["es"],"CM":["fr","en","bum","ff","ewo","ybb","bbj","nnh","bkm","bas","bax","byv","mua","maf","bfd","bss","kkj","dua","mgo","ar","jgo","ksf","agq","ha-arab","nmg","yav"],"CN":["zh-hans","ii","ug-arab","za","mn-mong","bo","ko","kk-arab","lis","ky-arab","nbf","khb","tdd","lcp","en","ru","vi","uz-cyrl"],"CO":["es"],"CP":["und"],"CR":["es"],"CU":["es"],"CV":["kea","pt"],"CW":["pap","nl","es"],"CX":["en"],"CY":["el","tr","hy","ar"],"CZ":["cs","de","pl"],"DE":["de","en","nds","tr","hr","it","ku-latn","ru","el","ksh","pl","es","nl","da","dsb"],"DG":["en"],"DJ":["aa","so","ar","fr"],"DK":["da","de","kl"],"DM":["en"],"DO":["es","en"],"DZ":["ar","fr","kab"],"EA":["es"],"EC":["es"],"EE":["et","ru"],"EG":["ar","el"],"EH":["ar"],"ER":["ti","en","tig","ar","aa","ssy","byn"],"ES":["es","en","ca","gl","eu","ast"],"ET":["en","am","om","so","ti","sid","wal","aa"],"FI":["fi","sv","ru","en","et","rmf","se","smn","sms"],"FJ":["en","hi","fj"],"FK":["en"],"FM":["chk","pon","kos","yap","en","uli"],"FO":["fo"],"FR":["fr","en","oc","it","pt","gsw","br","co","ca","nl","eu","ia"],"GA":["fr","puu"],"GB":["en","sco","pa-guru","cy","bn","zh-hant","syl","el","it","ks-arab","gd","yi","ml","ga","fr","kw"],"GD":["en"],"GE":["ka","ru","hy","ab","os","ku-latn"],"GF":["fr","gcr","zh-hant"],"GG":["en"],"GH":["ak","en","ee","abr","gaa","ha-latn","saf"],"GI":["en"],"GL":["kl","da"],"GM":["en","man-latn"],"GN":["fr","ff","man-nkoo","sus","kpe"],"GP":["fr"],"GQ":["es","fan","fr","bvb"],"GR":["el","mk","tr","bg","sq"],"GS":["und"],"GT":["es"],"GU":["en","ch"],"GW":["pt"],"GY":["en"],"HK":["zh-hant","en","zh-hans"],"HM":["und"],"HN":["es","en"],"HR":["hr","it"],"HT":["ht","fr"],"HU":["hu","de","ro","hr","sk","sl"],"IC":["es"],"ID":["id","jv","su","mad","ms-arab","min","bya","bjn","ban","bug","ace","bew","sas","bbc","zh-hant","mak","ljp","rej","gor","nij","kge","aoz","kvr","lbw","rob","mdr","sxn"],"IE":["en","ga"],"IL":["he","ar","ru","ro","yi","en","pl","hu","am","ti","ml"],"IM":["en","gv"],"IN":["hi","en","bn","te","mr","ta","ur","gu","kn","ml","or","pa-guru","bho","awa","as","bgc","mag","mwr","mai","hne","dcc","bjj","ne","sat","wtm","rkt","ks-arab","kok","swv","gbm","lmn","sd-arab","gon-telu","kfy","doi","kru","sck","tcy","wbq","xnr","wbr","khn","brx","noe","bhb","mni","raj","hoc","mtr","unr-beng","bhi","hoj","kha","kfr","grt","unx-beng","bfy","srx","saz","ccp","sd-deva","bfq","ria","bo","bft","bra","lep","btv","lif-deva","lah","sa","kht","dv","dz"],"IO":["en"],"IQ":["ar","ckb","fa","syr"],"IR":["fa","az-arab","glk","ckb","tk-latn","sdh","lrc","ar","bal","rmt","bqi","luz","lki","prd","hy","ps","ka","kk-arab"],"IS":["is","da"],"IT":["it","en","nap","scn","fur","de","fr","sl","ca","el","hr"],"JE":["en"],"JM":["en"],"JO":["ar"],"JP":["ja","ryu","ko"],"KE":["en","sw","ki","luy","luo","kam","kln","guz","mer","mas","ebu","so","dav","teo","pko","om","saq","ar","pa-guru","gu"],"KG":["ky-cyrl","ru"],"KH":["km","cja","kdt"],"KI":["en","gil"],"KM":["ar","fr","zdj"],"KN":["en"],"KP":["ko"],"KR":["ko"],"KW":["ar"],"KY":["en"],"KZ":["ru","kk-cyrl","de","ug-cyrl"],"LA":["lo","kjg","kdt"],"LB":["ar","hy","ku-arab","fr","en"],"LC":["en"],"LI":["de","gsw","wae"],"LK":["si","ta","en"],"LR":["en","kpe","vai-vaii","men","vai-latn"],"LS":["st","zu","ss","en","xh"],"LT":["lt","ru"],"LU":["fr","lb","de"],"LV":["lv","ru"],"LY":["ar"],"MA":["ar","zgh","fr","tzm-latn","shi-latn","shi-tfng","rif","es"],"MC":["fr"],"MD":["ro","uk","bg","gag","ru"],"ME":["sr-latn","sq","sr-cyrl"],"MF":["fr"],"MG":["mg","fr","en"],"MH":["en","mh"],"MK":["mk","sq","tr"],"ML":["bm","fr","ffm","snk","mwk","ses","tmh","khq","dtm","kao","ar","bmq","bze"],"MM":["my","shn","mnw","kht"],"MN":["mn-cyrl","kk-arab","zh-hans","ru","ug-cyrl"],"MO":["zh-hant","pt","zh-hans","en"],"MP":["en","ch"],"MQ":["fr"],"MR":["ar","fr","ff","wo"],"MS":["en"],"MT":["mt","en"],"MU":["mfe","en","bho","ur","fr","ta"],"MV":["dv"],"MW":["en","ny","tum","zu"],"MX":["es","yua","nhe","nhw","maz","nch"],"MY":["ms-latn","en","zh-hant","ta","bjn","jv","zmi","ml","bug"],"MZ":["pt","vmw","ndc","ts","ngl","seh","mgh","rng","ny","yao","sw","zu"],"NA":["af","kj","ng","naq","en","de","tn"],"NC":["fr"],"NE":["ha-latn","fr","dje","fuq","tmh","ar","twq"],"NF":["en"],"NG":["en","pcm","ha-latn","ig","yo","fuv","tiv","efi","ibb","ha-arab","bin","kaj","kcg","ar","cch","amo"],"NI":["es"],"NL":["nl","en","li","fy","gos","id","zea","rif","tr"],"NO":["nb","nn","se"],"NP":["ne","mai","bho","new","jml","taj","awa","thl","bap","tdg","thr","mgp","lif-deva","thq","mrd","bfy","xsr","rjs","tsf","hi","ggn","gvr","bo","tkt","tdh","bn","unr-deva","lep"],"NR":["en","na"],"NU":["en","niu"],"NZ":["en","mi"],"OM":["ar","bal","fa"],"PA":["es","en","zh-hant"],"PE":["es","qu","ay"],"PF":["fr","ty","zh-hant"],"PG":["tpi","en","ho"],"PH":["en","fil","es","ceb","ilo","hil","bik","war","bhk","pam","pag","mdh","tsg","zh-hant","bto","hnn","tbw","bku"],"PK":["ur","pa-arab","en","lah","ps","sd-arab","skr","bal","brh","hno","fa","hnd","tg-arab","gju","bft","kvx","khw","mvy","kxp","gjk","ks-arab","btv"],"PL":["pl","be","uk","csb","de","lt"],"PM":["fr","en"],"PN":["en"],"PR":["es","en"],"PS":["ar"],"PT":["pt","gl"],"PW":["pau","en"],"PY":["gn","es","de"],"QA":["ar","fa","ml"],"RE":["fr","rcf","ta"],"RO":["ro","hu","de","tr","sr-latn","bg","el","pl"],"RS":["sr-cyrl","sr-latn","sq","hu","ro","hr","sk","uk"],"RU":["ru","tt","ba","cv","hy","ce","av","udm","chm","sah","os","kbd","myv","dar","bua","mdf","kum","kv","lez","krc","inh","tyv","az-cyrl","ady","krl","koi","lbe","mrj","alt","fi","sr-latn","mn-cyrl","cu"],"RW":["rw","fr","en"],"SA":["ar"],"SB":["en"],"SC":["crs","fr","en"],"SD":["ar","en","nus","ha-arab"],"SE":["sv","fi","fit","se","rmu","yi","smj","sma","ia"],"SG":["en","zh-hans","ms-latn","ta","ml","pa-guru"],"SH":["en"],"SI":["sl","hu","it"],"SJ":["nb","ru"],"SK":["sk","hu","uk","pl","de"],"SL":["kri","en","men","tem"],"SM":["it","eo"],"SN":["fr","wo","ff","srr","dyo"],"SO":["so","ar","sw","om"],"SR":["nl","srn","zh-hant"],"SS":["ar","en"],"ST":["pt"],"SV":["es"],"SX":["en","es","vic","nl"],"SY":["ar","ku-latn","fr","hy","syr"],"SZ":["en","ss","zu","ts"],"TA":["en"],"TC":["en"],"TD":["fr","ar"],"TF":["fr"],"TG":["fr","ee"],"TH":["th","tts","nod","sou","mfa","zh-hant","kxm","kdt","mnw","shn","lcp","lwl"],"TJ":["tg-cyrl","fa","ar"],"TK":["en","tkl"],"TL":["pt","tet"],"TM":["tk-latn","ru","uz-latn","ku-latn"],"TN":["ar","fr"],"TO":["to","en"],"TR":["tr","ku-latn","zza","kbd","az-latn","ar","bgx","bg","ady","hy","ka","sr-latn","sq","ab","el","uz-latn","ky-latn","kk-cyrl"],"TT":["en","es"],"TV":["tvl","en"],"TW":["zh-hant","trv"],"TZ":["sw","en","suk","nym","kde","bez","ksb","mas","mgy","asa","lag","jmc","rof","vun","rwk","sbp"],"UA":["uk","ru","pl","yi","rue","be","ro","bg","tr","hu","el"],"UG":["sw","lg","nyn","cgg","xog","en","teo","laj","ach","myx","rw","ttj","hi"],"UM":["en"],"US":["en","es","zh-hant","fr","de","fil","it","vi","ko","ru","nv","yi","haw","chr","lkt","ik"],"UY":["es"],"UZ":["uz-latn","uz-cyrl","ru","kaa","tr"],"VA":["it","la"],"VC":["en"],"VE":["es"],"VG":["en"],"VI":["en"],"VN":["vi","zh-hant","cjm"],"VU":["bi","en","fr"],"WF":["wls","fr","fud"],"WS":["sm","en"],"XK":["sq","sr-cyrl","sr-latn"],"YE":["ar"],"YT":["swb","fr","buc","sw"],"ZA":["en","zu","xh","af","nso","tn","st","ts","ss","ve","hi","nr","sw"],"ZM":["en","bem","ny","loz"],"ZW":["en","sn","nd","mxc","ndc","kck","ny","ve","tn"],"ZZ":[]}}; +} ( jQuery ) ); diff --git a/lib/jquery.uls/src/jquery.uls.data.utils.js b/lib/jquery.uls/src/jquery.uls.data.utils.js new file mode 100644 index 00000000..7ff77114 --- /dev/null +++ b/lib/jquery.uls/src/jquery.uls.data.utils.js @@ -0,0 +1,465 @@ +/** + * Utility functions for querying language data. + * + * Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris, + * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other + * contributors. See CREDITS for a list. + * + * UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't + * have to do anything special to choose one license or the other and you don't + * have to notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @file + * @ingroup Extensions + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +( function ( $ ) { + 'use strict'; + + /** + * Is this language a redirect to another language? + * @param language string Language code + * @return Target language code if it's a redirect or false if it's not + */ + $.uls.data.isRedirect = function ( language ) { + return ( $.uls.data.languages[language] !== undefined && + $.uls.data.languages[language].length === 1 ) ? $.uls.data.languages[language][0] : false; + }; + + /** + * Returns the script of the language. + * @param language string Language code + * @return string + */ + $.uls.data.getScript = function ( language ) { + var target = $.uls.data.isRedirect( language ); + + if ( target ) { + return $.uls.data.getScript( target ); + } + + if ( !$.uls.data.languages[language] ) { + // Undetermined + return 'Zyyy'; + } + + return $.uls.data.languages[language][0]; + }; + + /** + * Returns the regions in which a language is spoken. + * @param language string Language code + * @return array|string 'UNKNOWN' + */ + $.uls.data.getRegions = function ( language ) { + var target = $.uls.data.isRedirect( language ); + + if ( target ) { + return $.uls.data.getRegions( target ); + } + + return ( $.uls.data.languages[language] && $.uls.data.languages[language][1] ) || 'UNKNOWN'; + }; + + /** + * Returns the autonym of the language. + * @param language string Language code + * @return string + */ + $.uls.data.getAutonym = function ( language ) { + var target = $.uls.data.isRedirect( language ); + + if ( target ) { + return $.uls.data.getAutonym( target ); + } + + return ( $.uls.data.languages[language] && $.uls.data.languages[language][2] ) || language; + }; + + /** + * Returns all language codes and corresponding autonyms + * @return array + */ + $.uls.data.getAutonyms = function () { + var language, + autonymsByCode = {}; + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + autonymsByCode[language] = $.uls.data.getAutonym( language ); + } + + return autonymsByCode; + }; + + /** + * Returns an array of all region codes. + * @return array + */ + $.uls.data.getAllRegions = function () { + var region, + allRegions = []; + + for ( region in $.uls.data.regiongroups ) { + allRegions.push( region ); + } + + return allRegions; + }; + + /** + * Returns all languages written in script. + * @param script string + * @return array of strings (languages codes) + */ + $.uls.data.getLanguagesInScript = function ( script ) { + return $.uls.data.getLanguagesInScripts( [ script ] ); + }; + + /** + * Returns all languages written in the given scripts. + * @param scripts array of strings + * @return array of strings (languages codes) + */ + $.uls.data.getLanguagesInScripts = function ( scripts ) { + var language, i, + languagesInScripts = []; + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + for ( i = 0; i < scripts.length; i++ ) { + if ( scripts[i] === $.uls.data.getScript( language ) ) { + languagesInScripts.push( language ); + break; + } + } + } + + return languagesInScripts; + }; + + /** + * Returns all languages in a given region. + * @param region string + * @return array of strings (languages codes) + */ + $.uls.data.getLanguagesInRegion = function ( region ) { + return $.uls.data.getLanguagesInRegions( [ region ] ); + }; + + /** + * Returns all languages in given regions. + * @param regions array of strings. + * @return array of strings (languages codes) + */ + $.uls.data.getLanguagesInRegions = function ( regions ) { + var language, i, + languagesInRegions = []; + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + for ( i = 0; i < regions.length; i++ ) { + if ( $.inArray( regions[i], $.uls.data.getRegions( language ) ) !== -1 ) { + languagesInRegions.push( language ); + break; + } + } + } + + return languagesInRegions; + }; + + /** + * Returns all languages in a region group. + * @param groupNum number. + * @return array of strings (languages codes) + */ + $.uls.data.getLanguagesInRegionGroup = function ( groupNum ) { + return $.uls.data.getLanguagesInRegions( $.uls.data.getRegionsInGroup( groupNum ) ); + }; + + /** + * Returns an associative array of languages in a region, + * grouped by script. + * @param region string Region code + * @return associative array + */ + $.uls.data.getLanguagesByScriptInRegion = function ( region ) { + var language, script, + languagesByScriptInRegion = {}; + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + if ( $.inArray( region, $.uls.data.getRegions( language ) ) !== -1 ) { + script = $.uls.data.getScript( language ); + + if ( languagesByScriptInRegion[script] === undefined ) { + languagesByScriptInRegion[script] = []; + } + languagesByScriptInRegion[script].push( language ); + } + } + + return languagesByScriptInRegion; + }; + + /** + * Returns an associative array of languages in a region, + * grouped by script group. + * @param region string Region code + * @return associative array + */ + $.uls.data.getLanguagesByScriptGroupInRegion = function ( region ) { + return $.uls.data.getLanguagesByScriptGroupInRegions( [ region ] ); + }; + + /** + * Returns an associative array of all languages, + * grouped by script group. + * @return associative array + */ + $.uls.data.getAllLanguagesByScriptGroup = function () { + return $.uls.data.getLanguagesByScriptGroupInRegions( $.uls.data.getAllRegions() ); + }; + + /** + * Get the given list of languages grouped by script. + * @param languages Array of language codes + * @return {Object} Array of languages indexed by script codes + */ + $.uls.data.getLanguagesByScriptGroup = function ( languages ) { + var languagesByScriptGroup = {}, + language, codeToAdd, langScriptGroup; + + for ( language in languages ) { + codeToAdd = $.uls.data.isRedirect( language ) || language; + + langScriptGroup = $.uls.data.getScriptGroupOfLanguage( codeToAdd ); + + if ( !languagesByScriptGroup[langScriptGroup] ) { + languagesByScriptGroup[langScriptGroup] = []; + } + + // Prevent duplicate adding of redirects + if ( $.inArray( codeToAdd, languagesByScriptGroup[langScriptGroup] ) === -1 ) { + languagesByScriptGroup[langScriptGroup].push( codeToAdd ); + } + } + + return languagesByScriptGroup; + }; + + /** + * Returns an associative array of languages in several regions, + * grouped by script group. + * @param regions array of strings - region codes + * @return associative array + */ + $.uls.data.getLanguagesByScriptGroupInRegions = function ( regions ) { + var language, i, scriptGroup, + languagesByScriptGroupInRegions = {}; + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + for ( i = 0; i < regions.length; i++ ) { + if ( $.inArray( regions[i], $.uls.data.getRegions( language ) ) !== -1 ) { + scriptGroup = $.uls.data.getScriptGroupOfLanguage( language ); + + if ( languagesByScriptGroupInRegions[scriptGroup] === undefined ) { + languagesByScriptGroupInRegions[scriptGroup] = []; + } + + languagesByScriptGroupInRegions[scriptGroup].push( language ); + break; + } + } + } + + return languagesByScriptGroupInRegions; + }; + + /** + * Returns an array of languages grouped by region group, + * region, script group and script. + * @return associative array + */ + $.uls.data.getAllLanguagesByRegionAndScript = function () { + var region, regionGroup, language, + script, scriptGroup, regions, regionNum, + allLanguagesByRegionAndScript = {}; + + for ( region in $.uls.data.regiongroups ) { + regionGroup = $.uls.data.regiongroups[region]; + + if ( allLanguagesByRegionAndScript[regionGroup] === undefined ) { + allLanguagesByRegionAndScript[regionGroup] = {}; + } + + allLanguagesByRegionAndScript[regionGroup][region] = {}; + } + + for ( language in $.uls.data.languages ) { + if ( $.uls.data.isRedirect( language ) ) { + continue; + } + + script = $.uls.data.getScript( language ); + scriptGroup = $.uls.data.getGroupOfScript( script ); + regions = $.uls.data.getRegions( language ); + + for ( regionNum = 0; regionNum < regions.length; regionNum++ ) { + region = regions[regionNum]; + regionGroup = $.uls.data.regiongroups[region]; + + if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] === undefined ) { + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] = {}; + } + + if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] === undefined ) { + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] = []; + } + + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script].push( language ); + } + } + + return allLanguagesByRegionAndScript; + }; + + /** + * Returns all regions in a region group. + * @param groupNum int + * @return array of strings + */ + $.uls.data.getRegionsInGroup = function ( groupNum ) { + var region, + regionsInGroup = []; + + for ( region in $.uls.data.regiongroups ) { + if ( $.uls.data.regiongroups[region] === groupNum ) { + regionsInGroup.push( region ); + } + } + + return regionsInGroup; + }; + + /** + * Returns the script group of a script or 'Other' if it doesn't + * belong to any group. + * @param script string Script code + * @return string script group name + */ + $.uls.data.getGroupOfScript = function ( script ) { + var scriptGroup; + + for ( scriptGroup in $.uls.data.scriptgroups ) { + if ( $.inArray( script, $.uls.data.scriptgroups[scriptGroup] ) !== -1 ) { + return scriptGroup; + } + } + + return 'Other'; + }; + + /** + * Returns the script group of a language. + * @param language string Language code + * @return string script group name + */ + $.uls.data.getScriptGroupOfLanguage = function ( language ) { + return $.uls.data.getGroupOfScript( $.uls.data.getScript( language ) ); + }; + + /** + * A callback for sorting languages by autonym. + * Can be used as an argument to a sort function. + * @param a string Language code + * @param b string Language code + */ + $.uls.data.sortByAutonym = function ( a, b ) { + var autonymA = $.uls.data.getAutonym( a ) || a, + autonymB = $.uls.data.getAutonym( b ) || b; + + return ( autonymA.toLowerCase() < autonymB.toLowerCase() ) ? -1 : 1; + }; + + /** + * Check if a language is right-to-left. + * @param language string Language code + * @return boolean + */ + $.uls.data.isRtl = function ( language ) { + return $.inArray( $.uls.data.getScript( language ), $.uls.data.rtlscripts ) !== -1; + }; + + /** + * Return the direction of the language + * @param language string Language code + * @return string + */ + $.uls.data.getDir = function ( language ) { + return $.uls.data.isRtl( language ) ? 'rtl' : 'ltr'; + }; + + /** + * Returns the languages spoken in a territory. + * @param territory string Territory code + * @return list of language codes + */ + $.uls.data.getLanguagesInTerritory = function ( territory ) { + return $.uls.data.territories[territory]; + }; + + /** + * Adds a language in run time and sets its options as provided. + * If the target option is provided, the language is defined as a redirect. + * Other possible options are script, regions and autonym. + * + * @param code string New language code. + * @param options Object Language properties. + * @return list of language codes + */ + $.uls.data.addLanguage = function( code, options ) { + if ( options.target ) { + $.uls.data.languages[code] = [options.target]; + } else { + $.uls.data.languages[code] = [options.script, options.regions, options.autonym]; + } + }; + + /** + * Removes a language from the langdb in run time. + * + * @param code string Language code to delete. + * @return true if the language was removed, false otherwise. + */ + $.uls.data.deleteLanguage = function( code ) { + if ( $.uls.data.languages[code] ) { + delete $.uls.data.languages[code]; + + return true; + } + + return false; + }; +} ( jQuery ) ); diff --git a/modules/ext.templateDataGenerator.core.js b/modules/ext.templateDataGenerator.core.js deleted file mode 100644 index eabf99f7..00000000 --- a/modules/ext.templateDataGenerator.core.js +++ /dev/null @@ -1,1483 +0,0 @@ -( function ( $, mw ) { - /** - * TemplateDataGenerator generates the JSON string for templatedata - * or reads existing templatedata string and allows for it to be edited - * with a visual modal GUI. - * - * @author Moriel Schottlender - */ - 'use strict'; - mw.libs.templateDataGenerator = ( function () { - var globalSettings, - /** - * Unique counter for new param names so they can - * be attached a unique and temporary paramId in the - * model before the name field is filled. - * @property {number} - */ - newParamIdCounter = 0, - /** - * Cache and store the original templatedata json string - * in an object. Particularly useful to preserve any types - * or attributes that the editor might not handle yet. - * @property {Object} - */ - jsonOriginalObject, - /** - * Full name of the current page, including subpages - * @property {string} - */ - fullPageName, - /** - * The current page is sublevel; this is used when - * fetching the template code. If there is no template - * code in the current page, and the page is sub-level - * then the system will look for template code at the - * parent page. - * @property {boolean} - */ - isPageSubLevel, - /** - * The cached jQuery promise to search for template source code - * from the API. - * @property {jQuery.Promise} - */ - templateCodePromise, - /** - * The original wikitext that is in the edit page textbox. - * @property {string} - */ - originalTemplateDataWikitext, - /** - * The parameters should be sorted. This is automatically - * set to true if the given templatedata json string already - * has a paramOrder set, and it turns true if the user - * actively changes the order of parameters in the table. - * Otherwise, paramOrder is not outputted - * @property {boolean} - */ - isSorted = false, - /** - * The templatedata parameters model - * @property {Object} - */ - paramsDataModel, - /** - * The templatedata meta model - * @property {Object} - */ - templateDataMetaModel, - /** - * An array of the parameter names that are found - * in the template code - * @property {string[]} - */ - templateParamNames = [], - /** - * A reference to the textarea in the template edit - * page - * @property {jQuery} - */ - $editTextArea, - // Dialog DOM Elements - /** - * An error label in the edit dialog - * @property {jQuery} - */ - $errorModalBox, - /** - * The DOM element holding the editor dialog - * @property {jQuery} - */ - $modalBox, - /** - * Define elements to attach to the main template edit - * area. - * @property {Object} - */ - editAreaElements = { - /** - * Define the edit button for the main template edit - * area that will trigger the editor window. - * @property {jQuery} - */ - $editButton: $( '