' ).addClass( 'cx-bounce' )
14 | );
15 | };
16 | }() );
17 |
--------------------------------------------------------------------------------
/skin/templates/Header.mustache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/skin/templates/Logo.mustache:
--------------------------------------------------------------------------------
1 | {{#data-logos}}
2 |
3 | {{#icon}}
4 | {{! alt is provided for valid HTML but given aria-hidden not needed. }}
5 |
6 | {{/icon}}
7 | {{#wordmark}}
8 |
9 | {{/wordmark}}
10 | {{^wordmark}}
11 | {{msg-sitetitle}}
12 | {{/wordmark}}
13 |
14 | {{/data-logos}}
15 |
{{html-title}}
16 |
--------------------------------------------------------------------------------
/skin/templates/skin.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{>Header}}
4 |
5 |
6 |
7 | {{{html-body-content}}}
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_lists-index-owner.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_lists-index-owner.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_lists_owner ON /*_*/cx_lists (cxl_owner);
6 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_suggestions-index-source_language_title.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_suggestions-index-source_language_title.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_suggestions_source_language_title ON /*_*/cx_suggestions (cxs_source_language, cxs_title);
6 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translations-index-translation_last_update_by_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_last_update_by_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_last_update_by_last_updated_timestamp ON /*_*/cx_translations (
6 | translation_last_update_by, translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translations-index-translation_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_last_updated_timestamp ON /*_*/cx_translations (
6 | translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translations-index-translation_started_by_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_started_by_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_started_by_last_updated_timestamp ON /*_*/cx_translations (
6 | translation_started_by, translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translations-target-title-index.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: extensions/ContentTranslation/sql/abstractSchemaChanges/patch-cx_translations-target-title-index.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translation_target_title ON /*_*/cx_translations (translation_target_title);
6 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translators-index-translator_translation_id.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translators-index-translator_translation_id.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translators_translation_id ON /*_*/cx_translators (translator_translation_id);
6 |
--------------------------------------------------------------------------------
/sql/mysql/patch-cx_translators-unique-to-pk.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translators-unique-to-pk.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | DROP INDEX cx_translation_translators ON /*_*/cx_translators;
6 | ALTER TABLE /*_*/cx_translators
7 | ADD PRIMARY KEY ( translator_user_id, translator_translation_id );
--------------------------------------------------------------------------------
/sql/mysql/patch-new-fields-to-cx_section_translations.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: extensions/ContentTranslation/sql/abstractSchemaChanges/patch-new-fields-to-cx_section_translations.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | ALTER TABLE /*_*/cx_section_translations
6 | ADD cxsx_translation_status TINYINT(1) DEFAULT NULL,
7 | ADD cxsx_translation_progress TINYBLOB NOT NULL,
8 | ADD cxsx_translation_start_timestamp BINARY(14) NOT NULL,
9 | ADD cxsx_translation_last_updated_timestamp BINARY(14) NOT NULL;
--------------------------------------------------------------------------------
/sql/notification-log.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE /*_*/cx_notification_log (
2 | -- Notification log id - autogenerated
3 | cxn_id int primary key auto_increment,
4 | -- Date when notification script was run
5 | cxn_date binary(14) not null,
6 | -- Newest draft which was updated with this script run
7 | cxn_newest binary(14) not null,
8 | -- Wiki ID of draft notification sent by the script
9 | cxn_wiki_id varchar(64) binary
10 | ) /*$wgDBTableOptions*/;
11 |
12 | -- Support query: SELECT MAX(cxn_newest) WHERE cxn_wiki_id = 'X'
13 | CREATE INDEX /*i*/cxn_wiki_id_newest ON /*_*/cx_notification_log (
14 | cxn_wiki_id,
15 | cxn_newest
16 | );
17 |
--------------------------------------------------------------------------------
/sql/patch-2020-09-21-notification-log-add-wikiid.sql:
--------------------------------------------------------------------------------
1 | -- Add wiki_id column to notification_log and update index.
2 | ALTER TABLE /*_*/cx_notification_log
3 | DROP INDEX /*i*/cx_notification_log_index,
4 | ADD COLUMN cxn_wiki_id varchar(64) binary,
5 | ADD INDEX /*i*/cxn_wiki_id_newest (
6 | cxn_wiki_id,
7 | cxn_newest
8 | );
9 |
--------------------------------------------------------------------------------
/sql/patch-cx_corpora-timestamp.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE /*_*/cx_corpora
2 | CHANGE cxc_timestamp cxc_timestamp binary(14);
3 |
--------------------------------------------------------------------------------
/sql/patch-cx_lists-timestamps.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE /*_*/cx_lists
2 | CHANGE cxl_start_time cxl_start_time binary(14),
3 | CHANGE cxl_end_time cxl_end_time binary(14);
4 |
--------------------------------------------------------------------------------
/sql/patch-cx_notification_log-timestamps.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE /*_*/cx_notification_log
2 | CHANGE cxn_date cxn_date binary(14) not null,
3 | CHANGE cxn_newest cxn_newest binary(14) not null;
4 |
--------------------------------------------------------------------------------
/sql/patch-cx_translations-timestamps.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE /*_*/cx_translations
2 | CHANGE translation_start_timestamp translation_start_timestamp binary(14) not null,
3 | CHANGE translation_last_updated_timestamp translation_last_updated_timestamp binary(14) not null;
4 |
--------------------------------------------------------------------------------
/sql/patch-tables-binary.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE /*_*/cx_notification_log
2 | MODIFY cxn_wiki_id varbinary(64);
3 |
4 | ALTER TABLE /*_*/cx_translations
5 | MODIFY translation_source_url blob not null,
6 | MODIFY translation_target_url blob default null;
7 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_lists-index-owner.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_lists-index-owner.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_lists_owner ON cx_lists (cxl_owner);
6 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_suggestions-index-source_language_title.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_suggestions-index-source_language_title.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_suggestions_source_language_title ON cx_suggestions (cxs_source_language, cxs_title);
6 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translations-index-translation_last_update_by_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_last_update_by_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_last_update_by_last_updated_timestamp ON cx_translations (
6 | translation_last_update_by, translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translations-index-translation_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_last_updated_timestamp ON cx_translations (
6 | translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translations-index-translation_started_by_last_updated_timestamp.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translations-index-translation_started_by_last_updated_timestamp.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translations_started_by_last_updated_timestamp ON cx_translations (
6 | translation_started_by, translation_last_updated_timestamp
7 | );
8 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translations-target-title-index.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: extensions/ContentTranslation/sql/abstractSchemaChanges/patch-cx_translations-target-title-index.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translation_target_title ON cx_translations (translation_target_title);
6 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translators-index-translator_translation_id.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translators-index-translator_translation_id.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE INDEX cx_translators_translation_id ON cx_translators (translator_translation_id);
6 |
--------------------------------------------------------------------------------
/sql/postgres/patch-cx_translators-unique-to-pk.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: sql/abstractSchemaChanges/patch-cx_translators-unique-to-pk.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | DROP INDEX cx_translation_translators;
6 | ALTER TABLE cx_translators
7 | ADD PRIMARY KEY ( translator_user_id, translator_translation_id );
--------------------------------------------------------------------------------
/sql/postgres/patch-new-fields-to-cx_section_translations.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: extensions/ContentTranslation/sql/abstractSchemaChanges/patch-new-fields-to-cx_section_translations.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | ALTER TABLE cx_section_translations
6 | ADD cxsx_translation_status SMALLINT DEFAULT NULL;
7 | ALTER TABLE cx_section_translations
8 | ADD cxsx_translation_progress TEXT NOT NULL;
9 | ALTER TABLE cx_section_translations
10 | ADD cxsx_translation_start_timestamp TIMESTAMPTZ NOT NULL;
11 | ALTER TABLE cx_section_translations
12 | ADD cxsx_translation_last_updated_timestamp TIMESTAMPTZ NOT NULL;
--------------------------------------------------------------------------------
/sql/section-translations.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaSql.php.
2 | -- Source: extensions/ContentTranslation/sql/tables.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | CREATE TABLE /*_*/cx_section_translations (
6 | cxsx_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
7 | cxsx_translation_id INT UNSIGNED NOT NULL,
8 | cxsx_section_id VARBINARY(30) NOT NULL,
9 | cxsx_source_section_title VARBINARY(512) NOT NULL,
10 | cxsx_target_section_title VARBINARY(512) NOT NULL,
11 | UNIQUE INDEX cx_sx_sections (
12 | cxsx_translation_id, cxsx_section_id
13 | ),
14 | PRIMARY KEY(cxsx_id)
15 | ) /*$wgDBTableOptions*/;
16 |
--------------------------------------------------------------------------------
/sql/sqlite/patch-new-fields-to-cx_section_translations.sql:
--------------------------------------------------------------------------------
1 | -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 | -- Source: extensions/ContentTranslation/sql/abstractSchemaChanges/patch-new-fields-to-cx_section_translations.json
3 | -- Do not modify this file directly.
4 | -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 | ALTER TABLE /*_*/cx_section_translations
6 | ADD COLUMN cxsx_translation_status SMALLINT DEFAULT NULL;
7 | ALTER TABLE /*_*/cx_section_translations
8 | ADD COLUMN cxsx_translation_progress BLOB NOT NULL;
9 | ALTER TABLE /*_*/cx_section_translations
10 | ADD COLUMN cxsx_translation_start_timestamp BLOB NOT NULL;
11 | ALTER TABLE /*_*/cx_section_translations
12 | ADD COLUMN cxsx_translation_last_updated_timestamp BLOB NOT NULL;
--------------------------------------------------------------------------------
/tests/phpunit/Makefile:
--------------------------------------------------------------------------------
1 | ifndef MW_INSTALL_PATH
2 | MW_INSTALL_PATH=../../../..
3 | endif
4 |
5 | default:
6 | php ${MW_INSTALL_PATH}/tests/phpunit/phpunit.php .
7 |
8 | .PHONY: *Test.php
9 | *Test.php:
10 | php ${MW_INSTALL_PATH}/tests/phpunit/phpunit.php $@
11 |
--------------------------------------------------------------------------------
/tests/phpunit/structure/BundleSizeTest.php:
--------------------------------------------------------------------------------
1 | [ ContentTranslationHookRunner::class ];
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/qunit/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "extends": [
4 | "../../modules/.eslintrc.json",
5 | "wikimedia/qunit"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/tests/qunit/data/dm-translation-source-article.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/tests/selenium/.env.sample:
--------------------------------------------------------------------------------
1 | # Server URL where the test should be run
2 | MW_SERVER=http://fr.mediawiki.mwdd.localhost:8080
3 | MW_SCRIPT_PATH=/w
4 |
5 | # User account that should be used for testing
6 | MEDIAWIKI_USER=admin
7 | MEDIAWIKI_PASSWORD=mwddpassword
8 |
9 | # ContentTranslation-specific environment variables
10 | CX_REMOTE_API_URL_TEMPLATE=http://{domain}.wikipedia.org/w/api.php
11 |
--------------------------------------------------------------------------------
/tests/selenium/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "extends": [
4 | "wikimedia/selenium"
5 | ],
6 | "globals": {
7 | "document": "readonly"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tests/selenium/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 |
--------------------------------------------------------------------------------
/tests/selenium/navigation-steps/DashboardSuggestion.list.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const NEW_TRANSLATION_BUTTON_SELECTOR = '#dashboard-search-translation-button';
4 | const ElementAction = require( '../utils/ElementAction' );
5 |
6 | class DashboardSuggestionList {
7 | goToSearch() {
8 | const newTranslationButton = $( NEW_TRANSLATION_BUTTON_SELECTOR );
9 | return ElementAction.doClick( newTranslationButton );
10 | }
11 | }
12 |
13 | module.exports = new DashboardSuggestionList();
14 |
--------------------------------------------------------------------------------
/tests/selenium/navigation-steps/SXArticleSearch.step.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const ARTICLE_SEARCH_INPUT_SELECTOR = 'input[type="search"]';
4 | const FIRST_SEARCH_SUGGESTION_SELECTOR = '.sx-article-search .cx-search-suggestion';
5 | const ElementAction = require( '../utils/ElementAction' );
6 |
7 | class SXArticleSearchStep {
8 | async searchAndSelectArticleToTranslate( pageTitle ) {
9 | const articleSearchInput = $( ARTICLE_SEARCH_INPUT_SELECTOR );
10 | await ElementAction.setInput( articleSearchInput, pageTitle );
11 | const firstSearchSuggestion = $( FIRST_SEARCH_SUGGESTION_SELECTOR );
12 | await ElementAction.doClick( firstSearchSuggestion );
13 | }
14 |
15 | }
16 |
17 | module.exports = new SXArticleSearchStep();
18 |
--------------------------------------------------------------------------------
/tests/selenium/navigation-steps/TranslationConfirmer.step.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const START_TRANSLATION_BUTTON_SELECTOR = '.sx-translation-confirmer__action button';
4 | const ElementAction = require( '../utils/ElementAction' );
5 |
6 | class TranslationConfirmerStep {
7 | async startTranslation() {
8 | const startTranslationButton = $( START_TRANSLATION_BUTTON_SELECTOR );
9 | await ElementAction.doClick( startTranslationButton );
10 | }
11 | }
12 |
13 | module.exports = new TranslationConfirmerStep();
14 |
--------------------------------------------------------------------------------
/tests/selenium/wdio.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | require( 'dotenv' ).config( {
4 | path: __dirname + '/.env',
5 | // Override any other values with what's present in the .env file
6 | override: true
7 | } );
8 |
9 | const { config } = require( 'wdio-mediawiki/wdio-defaults.conf.js' );
10 |
11 | exports.config = {
12 | ...config,
13 | services: [ 'intercept', ...( config.services || [] ) ]
14 | // Override, or add to, the setting from wdio-mediawiki.
15 | // Learn more at https://webdriver.io/docs/configurationfile/
16 | //
17 | // Example:
18 | // logLevel: 'info',
19 | };
20 |
--------------------------------------------------------------------------------