Very good start! Few notes:manoeuvre wrote:Unable to get my custom localization script to work.
1. You have to put checks inside the country block, i.e.:
Code: Select all
window.WME_Validator_Canada = {
// checks should be here
}
3. To use a backslash inside a string you need to escape it, i.e. to match an alphanumeric character use "\\w" and to match a dot use "\\."
Here is your script with the above changes:
Code: Select all
// ==UserScript==
// @name WME Validator Localization for Canada
// @version 1.1.1
// @description This script localizes WME Validator for Canada. You also need main package (WME Validator) installed.
// @match https://editor-beta.waze.com/*editor/*
// @match https://www.waze.com/*editor/*
// @grant none
// @run-at document-start
// ==/UserScript==
//
window.WME_Validator_Canada = {
".country": "Canada",
".codeISO": "CA",
".author": "manoeuvre",
".updated": "2014-09-03",
"171.enabled": true,
"171.params": {
"regexp": "/ (Aly|Avenue|Bnd|Boulevard|By-pass|Centre|Center|Circle|Cl|Court|Cr|Ct|Crescent|Cul-de-sac|Drive|Extension|Fld|Gardens|Gln|Grn|Grounds|Grv|Harbour|Harbr|Heights|Highway|Hl|Holw|Landing|Landng|Ln|Mnr|Mdw|Mountain|Orchard|Park|Parkway|Passage|Pass|Ptwy|Place|Pt|Prt|Pvt|Promenade|Rg|Rdge|Road|Square|Subdiv|Street|Terrace|Ter|Trl|Tr|Thick|Tline|Turnabt|Village|Villge|North|East|South|West)$/i",
},
"174.enabled": true,
"174.params": {
"titleEN": "St. not St",
"problemEN": "St. not St",
"solutionEN": "Use St. instead of St",
"regexp": "/^St \\w\\w/",
},
}
Re: [Script] WME Validator 1.1.1 / 30.08.2014