Israel is multilingual and getting name tag consistency is tricky. This script helps with that. It copies name:en, name:he, name:ar to name and vice-versa in Israel (and West Bank area C).
This script is part of SwiftFast_bot. (Click for contact details, opt-out, other scripts, bot overview, etc.).
- To make sure everything in Israel should have name and name:lang. The script automatically does that for the obvious cases.
- To fix inconsistent name tags, editing mistakes, and sometimes vandalism, by manually scanning the warning logs created by the script. The script creates warnings when some name tags don't make sense.
Create a page for a list of nodes that have errors.
- #49768266 - 23/06/2017 - 77 names copies: Copied missing name tags and fixed whitespace.
- #49674056 - 19/06/2017 - 356 name copies: Copied missing name tags and fixed whitespace.
- #49548816 - 15/06/2017 - 9362 name copies: Copied missing name tags and fixed whitespace - Southern District pt. 2, and Area C
- #49475143 - 12/06/2017 - 6626 name copies: Copied missing name tags and fixed whitespace - Jerusalem District
- #49412690 - 10/06/2017 - 5479 name copies: Copied missing name tags and fixed whitespace - Southern District
- #49299149 - 06/06/2017 - 5967 name copies: Copied missing name tags and fixed whitespace - Tel Aviv District
- #49294617 - 06/06/2017 - 11076 name copies: Copied missing name tags and fixed whitespace - Central District
Total names copies: 77 Total name to name:en: 31 Total name:he to name: 1 Total name to name:he: 39 Total name:ar to name: 0 Total name to name:ar: 6 Whitespace fixes: 0 Total scanned: 927 Total unhandled errors: 838
- #49225264 - 03/06/2017 - 5658 changes: Copied missing name tags - Haifa District
- #49223571 - 03/06/2017 - 9828 changes: Copied missing name tags - Northern District
- #49171684 - 01/06/2017 - 115 changes: Copied missing name tags (limited test in Dalia)
- #49031645 - 27/05/2017 - 607 changes: Copied name tag from "name:he" or "name:ar" in Israel (This was a much less ambitious edit with a trivial algorithm: when name:he or name:ar was the only name tag, it was copied to name.)
bot=yes (older changesets used mechanical=yes)
only he,ar,en names are analyzed.
For each POI:
- If name exists, deduce language, if name:lang doesn't exist for that language, copy name to name:lang.
- If only one name tag exists, and it is name:he or name:ar (and name doesn't exist) copy name:lang to name.
The following are possible exceptions and how they're handled. Nodes that have no name/name:lang tags at all are simply ignored.
- name,name:lang mismatch (these two have the same language, but mismatched value) - node skipped.
- Has no name tag, has multiple name:lang - node skipped.
- name:lang has non printable characters - name:lang never copied to name.
- name:lang is not lang (wrong language) - name:lang never copied to name.
- name is not ar,he,en - skipped
I no longer copy name:en to name since SwiftFast_nameCopy2. Let humans decide whether a translation exists or if it's a good idea to copy English.
The exceptions were changed a couple of times in SwiftFast_nameCopy2.
The script fixes obvious whitespace issues in any tag. This doesn't guarantee perfect whitespace all across Israel; the fix is only applied opportunistically to the nodes being checked for name issues.