Opened 4 months ago

Last modified 3 months ago

#17173 closed enhancement

[Patch] Detect preset wiki languages automatically — at Initial Version

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 19.01
Component: Internal preset Version:
Keywords: Cc: Don-vip, michael2402, stoecker, naoliv, Simon, Poole

Description

Instead of maintaining various OSM wiki languages in defaultpresets.xml, maintaining presets_lang.pl, running presets_lang.pl from time to time, still applying manual changes (cf. #17171), let JOSM detect the wiki language automatically. This features has been implemented long ago in HelpAction.displayHelp: it opens https://wiki.openstreetmap.org/wiki/[lang]:[page] if it exists and falls back to https://wiki.openstreetmap.org/wiki/[page].

So in a nutshell …

  • data/defaultpresets.xml

    diff --git a/data/defaultpresets.xml b/data/defaultpresets.xml
    index b88f3d9d4..0ec763ca8 100644
    a b  
    326326        <reference ref="voltage_frequency" />
    327327    </chunk>
    328328    <chunk id="power_generator">
    329         <link href="https://wiki.openstreetmap.org/wiki/Tag:power=generator"
    330                   cs.href="https://wiki.openstreetmap.org/wiki/Cs:Tag:power=generator"
    331                   de.href="https://wiki.openstreetmap.org/wiki/DE:Tag:power=generator"
    332                   es.href="https://wiki.openstreetmap.org/wiki/ES:Tag:power=generator"
    333                   fr.href="https://wiki.openstreetmap.org/wiki/FR:Tag:power=generator"
    334                   it.href="https://wiki.openstreetmap.org/wiki/IT:Tag:power=generator"
    335                   ja.href="https://wiki.openstreetmap.org/wiki/JA:Tag:power=generator"
    336                   pl.href="https://wiki.openstreetmap.org/wiki/Pl:Tag:power=generator"
    337                   pt.href="https://wiki.openstreetmap.org/wiki/Pt:Tag:power=generator"
    338                   ru.href="https://wiki.openstreetmap.org/wiki/RU:Tag:power=generator" />
     329        <link wiki="Tag:power=generator" />
    339330        <space />
    340331        <key key="power" value="generator" />
    341332        <reference ref="name_ref_operator" />

In total: 719 insertions(+), 5651 deletions(-)

Change History (1)

Changed 4 months ago by simon04

Attachment: 17173.patch.gz added
Note: See TracTickets for help on using tickets.