MediaWiki:ConvenientDiscussions.js: Difference between revisions
From BetaArchive Wiki
(update CD) |
(Replaced content with "→* * This configuration might get outdated as the script evolves, so it's best to keep it up to date * by checking for the generator script and documentation updates from time to time. See the * documentation at * https://commons.wikimedia.org/wiki/Special:MyLanguage/User:Jack_who_built_the_house/Convenient_Discussions#Configuring_for_a_wiki.: // <nowiki> (function () { function unique(item, i, arr) { return arr.indexOf(item) === i; } function getString...") Tag: Replaced |
||
Line 1: | Line 1: | ||
/* | /** | ||
* | * This configuration might get outdated as the script evolves, so it's best to keep it up to date | ||
* | * by checking for the generator script and documentation updates from time to time. See the | ||
* | * documentation at | ||
* https://commons.wikimedia.org/wiki/Special:MyLanguage/User:Jack_who_built_the_house/Convenient_Discussions#Configuring_for_a_wiki. | |||
* https://commons.wikimedia.org/wiki/User:Jack_who_built_the_house/ | |||
*/ | */ | ||
// <nowiki> | |||
(function () { | |||
function unique(item, i, arr) { | |||
return arr.indexOf(item) === i; | |||
} | |||
function getStrings() { | |||
const requests = [mw.config.get('wgUserLanguage'), mw.config.get('wgContentLanguage')] | |||
.filter(unique) | |||
.filter(function (lang) { | |||
return lang !== 'en'; | |||
}) | |||
.map(function (lang |
Latest revision as of 12:23, 20 October 2023
/** * This configuration might get outdated as the script evolves, so it's best to keep it up to date * by checking for the generator script and documentation updates from time to time. See the * documentation at * https://commons.wikimedia.org/wiki/Special:MyLanguage/User:Jack_who_built_the_house/Convenient_Discussions#Configuring_for_a_wiki. */ // <nowiki> (function () { function unique(item, i, arr) { return arr.indexOf(item) === i; } function getStrings() { const requests = [mw.config.get('wgUserLanguage'), mw.config.get('wgContentLanguage')] .filter(unique) .filter(function (lang) { return lang !== 'en'; }) .map(function (lang) { return mw.loader.getScript('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions-i18n/' + lang + '.js&action=raw&ctype=text/javascript'); }); // We assume it's OK to fall back to English if the translation is unavailable for any reason. return Promise.all(requests).catch(function () {}); } window.convenientDiscussions = window.convenientDiscussions || {}; if (convenientDiscussions.config) return; /* BEGINNING OF THE CONFIGURATION */ convenientDiscussions.config = { 'messages': { 'sun': 'Sun', 'mon': 'Mon', 'tue': 'Tue', 'wed': 'Wed', 'thu': 'Thu', 'fri': 'Fri', 'sat': 'Sat', 'sunday': 'Sunday', 'monday': 'Monday', 'tuesday': 'Tuesday', 'wednesday': 'Wednesday', 'thursday': 'Thursday', 'friday': 'Friday', 'saturday': 'Saturday', 'jan': 'Jan', 'feb': 'Feb', 'mar': 'Mar', 'apr': 'Apr', 'may': 'May', 'jun': 'Jun', 'jul': 'Jul', 'aug': 'Aug', 'sep': 'Sep', 'oct': 'Oct', 'nov': 'Nov', 'dec': 'Dec', 'january': 'January', 'february': 'February', 'march': 'March', 'april': 'April', 'may_long': 'May', 'june': 'June', 'july': 'July', 'august': 'August', 'september': 'September', 'october': 'October', 'november': 'November', 'december': 'December', 'january-gen': 'January', 'february-gen': 'February', 'march-gen': 'March', 'april-gen': 'April', 'may-gen': 'May', 'june-gen': 'June', 'july-gen': 'July', 'august-gen': 'August', 'september-gen': 'September', 'october-gen': 'October', 'november-gen': 'November', 'december-gen': 'December', 'parentheses': '($1)', 'parentheses-start': '(', 'parentheses-end': ')', 'word-separator': ' ', 'comma-separator': ', ', 'colon-separator': ': ', 'nextdiff': 'Newer edit →', 'timezone-utc': 'UTC', 'pagetitle': '$1 - {{SITENAME}}', 'visualeditor-educationpopup-dismiss': 'Okay, got it' }, 'specialPageAliases': { 'Contributions': 'Contributions', 'Diff': 'Diff', 'PermanentLink': 'PermanentLink' }, 'timezone': 'Europe/London', 'useGlobalPreferences': false, 'signatureEndingRegexp': / \(talk\)/ }; /* END OF THE CONFIGURATION */ if (!convenientDiscussions.isRunning) { convenientDiscussions.getStringsPromise = getStrings(); mw.loader.getScript('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript') .catch(function (e) { console.warn('Couldn\'t load Convenient Discussions.', e); }); } }()); // </nowiki>