Last change
on this file since 9576 was 7937, checked in by bastiK, 10 years ago |
add subversion property svn:eol=native
|
-
Property svn:eol-style
set to
native
|
File size:
2.1 KB
|
Line | |
---|
1 | /* validation for the wikipedia=* tag - see ticket #8383 */
|
---|
2 |
|
---|
3 | /* If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ... */
|
---|
4 | *[wikipedia][wikipedia !~ /^[a-zA-Z_-]{2,12}:/] {
|
---|
5 | throwError: tr("no wikipedia-language given, use ''wikipedia''=''language:page title''");
|
---|
6 | assertMatch: "node wikipedia=Foobar";
|
---|
7 | assertNoMatch: "node wikipedia=en:Foobar";
|
---|
8 | assertNoMatch: "node wikipedia=en-GB:Foobar";
|
---|
9 | }
|
---|
10 |
|
---|
11 | /* Valid languages are extracted from <http://de.wikipedia.org/w/api.php?action=sitematrix&format=xml>, which may change, so this is a warning only. */
|
---|
12 | *[wikipedia =~ /^[a-zA-Z_-]{2,12}:/][wikipedia !~ /^https?:\/\//][wikipedia !~ /^(aa|ab|ace|af|ak|als|am|an|ang|ar|arc|arz|as|ast|av|ay|az|ba|bar|bat-smg|bcl|be|be-x-old|bg|bh|bi|bjn|bm|bn|bo|bpy|br|bs|bug|bxr|ca|cbk-zam|cdo|ce|ceb|ch|cho|chr|chy|ckb|co|cr|crh|cs|csb|cu|cv|cy|cz|da|de|diq|dk|dsb|dv|dz|ee|el|eml|en|eo|epo|es|et|eu|ext|fa|ff|fi|fiu-vro|fj|fo|fr|frp|frr|fur|fy|ga|gag|gan|gd|gl|glk|gn|got|gu|gv|ha|hak|haw|he|hi|hif|ho|hr|hsb|ht|hu|hy|hz|ia|id|ie|ig|ii|ik|ilo|io|is|it|iu|ja|jbo|jp|jv|ka|kaa|kab|kbd|kg|ki|kj|kk|kl|km|kn|ko|koi|kr|krc|ks|ksh|ku|kv|kw|ky|la|lad|lb|lbe|lez|lg|li|lij|lmo|ln|lo|lt|ltg|lv|map-bms|mdf|mg|mh|mhr|mi|minnan|mk|ml|mn|mo|mr|mrj|ms|mt|mus|mwl|my|myv|mzn|na|nah|nan|nap|nb|nds|nds-nl|ne|new|ng|nl|nn|no|nov|nrm|nso|nv|ny|oc|om|or|os|pa|pag|pam|pap|pcd|pdc|pfl|pi|pih|pl|pms|pnb|pnt|ps|pt|qu|rm|rmy|rn|ro|roa-rup|roa-tara|ru|rue|rw|sa|sah|sc|scn|sco|sd|se|sg|sh|si|simple|sk|sl|sm|sn|so|sq|sr|srn|ss|st|stq|su|sv|sw|szl|ta|te|tet|tg|th|ti|tk|tl|tn|to|tpi|tr|ts|tt|tum|tw|ty|udm|ug|uk|ur|uz|ve|vec|vep|vi|vls|vo|wa|war|wo|wuu|xal|xh|xmf|yi|yo|za|zea|zh|zh-cfr|zh-classical|zh-min-nan|zh-yue|zu):/] {
|
---|
13 | throwWarning: tr("unknown language prefix in wikipedia tag");
|
---|
14 | assertMatch: "node wikipedia=X-Y-Z:Foobar";
|
---|
15 | assertNoMatch: "node wikipedia=en:Foobar";
|
---|
16 | }
|
---|
17 |
|
---|
18 | *[wikipedia =~ /https?:\/\//] {
|
---|
19 | throwWarning: tr("deprecated format for wikipedia tag");
|
---|
20 | suggestAlternative: tr("''wikipedia''=''language:page title''");
|
---|
21 | assertMatch: "node wikipedia=http://en.wikipedia.org/wiki/OpenStreetMap";
|
---|
22 | assertNoMatch: "node wikipedia=en:OpenStreetMap";
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.