User:Jimregan/Scripts/LanguageConverter.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// [[File:User:He7d3r/Tools/LanguageConverter.js]] (workaround for [[phab:T35355]])
/*jslint browser: true, regexp:true, white: true */
/*global mw */
if ( window.LanguageConverter === undefined ) {
window.LanguageConverter = {};
}
// Define specific configuration for Irish on Wikisource
window.LanguageConverter.config = {
msg: {
error_missing_dict : 'pas de dictionnaire: ',
error_word_processing : 'Error has occurred while processing this word: ', // French translation?
help_page_link : 'Leathanach cabhrach',
show_changes_link : 'Taispeáin athruithe',
hide_changes_link : 'Hide changes'
},
word_chars : 'a-zçâàäāãáéèêẽëîïíôöōõóûùüúÿœæA-ZÀÂÄÁÉÈÊËÎÏÍÔÖÓÙÛÜÚŸÇŒÆ&ßĩq̃ºª\\-ĨċḃḋḟġṁṗṡṫḂĊḊḞĠṀṖṪṠ\'’Q̃',
variants_list : {
'ga':'Bunlitriú',
'ga-nuachoirithe':'Litriú nuachóirithe',
'ga-caighdeanaithe':'Litriú caighdeánaithe'
},
typo_changes : {
'ga-nuachoirithe': [
[ / sa n-([aeiouáéíóúAEIOUÁÉÍÓÚ])/g, " san $1" ],
[ / i n-([aeiouáéíóúAEIOUÁÉÍÓÚ])/g, " in $1" ],
[ / h-([aeiouáéíóúAEIOUÁÉÍÓÚ])/g, " h$1" ],
[ /([A-ZÁÉÍÓÚ])Ḃ/g, "$1BH" ],
[ /([A-ZÁÉÍÓÚ])Ċ/g, "$1CH" ],
[ /([A-ZÁÉÍÓÚ])Ḋ/g, "$1DH" ],
[ /([A-ZÁÉÍÓÚ])Ḟ/g, "$1FH" ],
[ /([A-ZÁÉÍÓÚ])Ġ/g, "$1GH" ],
[ /([A-ZÁÉÍÓÚ])Ṁ/g, "$1MH" ],
[ /([A-ZÁÉÍÓÚ])Ṗ/g, "$1PH" ],
[ /([A-ZÁÉÍÓÚ])Ṡ/g, "$1SH" ],
[ /([A-ZÁÉÍÓÚ])Ṫ/g, "$1TH" ],
[ /Ḃ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "BH$1" ],
[ /Ċ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "CH$1" ],
[ /Ḋ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "DH$1" ],
[ /Ḟ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "FH$1" ],
[ /Ġ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "GH$1" ],
[ /Ṁ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "MH$1" ],
[ /Ṗ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "PH$1" ],
[ /Ṡ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "SH$1" ],
[ /Ṫ([A-ZÁÉÍÓÚḂĊḊḞĠṀṖṪ])/g, "TH$1" ],
[ /Ḃ/g, "Bh" ],
[ /Ċ/g, "Ch" ],
[ /Ḋ/g, "Dh" ],
[ /Ḟ/g, "Fh" ],
[ /Ġ/g, "Gh" ],
[ /Ṁ/g, "Mh" ],
[ /Ṗ/g, "Ph" ],
[ /Ṡ/g, "Sh" ],
[ /Ṫ/g, "Th" ],
[ /ſ/g, "s" ],
[ /ff/g, "ff" ],
[ /fl/g, "fl" ],
[ /fi/g, "fi" ],
[ /ffi/g, "ffi" ],
[ /ffl/g, "ffl" ],
[ /ſt/g, "st" ],
[ /st/g, "st" ],
[ /ḃ/g, "bh" ],
[ /ċ/g, "ch" ],
[ /ḋ/g, "dh" ],
[ /ḟ/g, "fh" ],
[ /ġ/g, "gh" ],
[ /ṁ/g, "mh" ],
[ /ṗ/g, "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g, "s" ],
[ /ff/g, "ff" ],
[ /fl/g, "fl" ],
[ /fi/g, "fi" ],
[ /ffi/g, "ffi" ],
[ /ffl/g, "ffl" ],
[ /ſt/g, "st" ],
[ /st/g, "st" ],
[ /ḃ/g, "bh" ],
[ /ċ/g, "ch" ],
[ /ḋ/g, "dh" ],
[ /ḟ/g, "fh" ],
[ /ġ/g, "gh" ],
[ /ṁ/g, "mh" ],
[ /ṗ/g, "ph" ],
[ /ṡ/g, "sh" ],
[ /ṫ/g, "th" ],
]
},
ns_list : {
0: true, // Main
2: true, // User
//4: true, // Wikisource
14: true, // Category
102: true // Author
// 104: true // Page
},
local_dic_id : {
'ga': 'bunlitriu',
'ga-nuachoirithe':'nuachoirithe',
'ga-caighdeanaithe':'caighdeanaithe'
},
no_conversion_class : 'no-conversion', // You may want to choose another name (without spaces), but it is probably good idea to avoid accented letters here
global_dic_page : {
'ga':'Wikisource:Foclóir/Folamh',
'ga-nuachoirithe':'Wikisource:Foclóir/Roinnte|Wikisource:Foclóir/Nuachóirithe',
'ga-caighdeanaithe': 'Wikisource:Foclóir/Roinnte|Wikisource:Foclóir/Caighdeánaithe'
},
help_page : 'Wikisource:Foclóir/Leathanach cabhrach',
// Useful when we are checking the conversion
// Requires a CSS like this:
// .show-changes .v-fr-XXXX {background-color: #AAFFAA;}
show_changes : true,
show_menu_title : true,
selection_mode: 'OR',
max_seq : 3
}; // Config
mw.util.addCSS('.show-changes .v-ga-nuachoirithe { background-color: #AAFFAA; }');
mw.util.addCSS('.show-changes .v-ga-caighdeanaithe { background-color: #AAFFFF; }');
// Import [[m:User:He7d3r/Tools/LanguageConverter.js]] to allow modernization
mw.loader.load( 'https://meta.wikimedia.org/w/index.php?title=User:He7d3r/Tools/LanguageConverter.js&action=raw&ctype=text/javascript' );