Modify

Opened 4 weeks ago

Closed 2 days ago

Last modified 2 days ago

#14425 closed enhancement (fixed)

[patch] Improve Wikipedia tag validators

Reported by: nyurik Owned by: team
Priority: normal Milestone: 17.03
Component: Core validator Version:
Keywords: , wikipedia Cc:

Description (last modified by nyurik)

Wikipedia tags need a few more validators with fixers:

  • update the list of valid Wikipedia languages
  • auto-replace language be-x-old with be-tarask
  • auto-replace language cz with cs
  • remove space before page title ("en: Foo" -> "en:Foo")
  • replace "_" with spaces ("en:Foo_bar" -> "en:Foo bar")
  • capitalize first letter if it's not "jbo" language ("en:foo" -> "en:Foo")
  • double language link ("en:en:Foo" -> "en:Foo")

This patch also adds a few additional validator functions: trim, upper and lower

Attachments (5)

wikipedia-validations.patch (8.3 KB) - added by nyurik 4 weeks ago.
patch to fix this issue
wikipedia-validations.2.patch (10.0 KB) - added by nyurik 3 weeks ago.
overrides previous patch
wikipedia-validations.3.patch (10.9 KB) - added by nyurik 3 weeks ago.
wikipedia-validations.4.patch (12.3 KB) - added by nyurik 3 weeks ago.
wikipedia-validations.5.patch (12.4 KB) - added by nyurik 2 weeks ago.

Download all attachments as: .zip

Change History (18)

Changed 4 weeks ago by nyurik

Attachment: wikipedia-validations.patch added

patch to fix this issue

comment:1 Changed 4 weeks ago by nyurik

Description: modified (diff)

comment:2 Changed 4 weeks ago by nyurik

Description: modified (diff)

comment:3 Changed 3 weeks ago by Don-vip

Component: CoreCore validator
Keywords: added; patch validator removed
Milestone: 17.03
Summary: (patch) Improve Wikipedia tag validators[patch] Improve Wikipedia tag validators

Changed 3 weeks ago by nyurik

overrides previous patch

comment:4 Changed 3 weeks ago by nyurik

Description: modified (diff)

Changed 3 weeks ago by nyurik

Changed 3 weeks ago by nyurik

comment:5 Changed 3 weeks ago by Don-vip

Please don't write this:

 	29	  throwWarning: tr("wikipedia ''be-x-old'' language is obsolete, use ''be-tarask'' instead");
 	36	  throwWarning: tr("wikipedia ''cz'' language is invalid, use ''cs'' instead");

This makes an entry to translate for each value we will list in an individual check. Instead, this only creates a generic string to translate:

 	29	  throwWarning: tr("wikipedia ''{0}'' language is obsolete, use ''{1}'' instead", "be-x-old", "be-tarask");
 	36	  throwWarning: tr("wikipedia ''{0}'' language is invalid, use ''{1}'' instead", "cz", "cs");

I didn't check the other strings, you see the point :)

Changed 2 weeks ago by nyurik

comment:6 Changed 2 weeks ago by nyurik

@Don-vip, please recheck. I so wish we used git for this. Attaching and revising patches like this is very arcane.

comment:7 Changed 5 days ago by nyurik

@don-vip, is something still missing for this ticket to be merged?

comment:8 Changed 5 days ago by Don-vip

Sorry I forgot this one I'll review it tonight :)

comment:9 Changed 4 days ago by Don-vip

Resolution: fixed
Status: newclosed

In 11756/josm:

fix #14425 - Improve Wikipedia tag validators (patch by nyurik, modified)

comment:10 Changed 4 days ago by Don-vip

Thanks for the patch! :)
However for the next time, please test it with JOSM first, I had to fix many syntax issues (wrong quote characters, missing semicolons, etc.)

comment:11 Changed 2 days ago by Klumbumbus

Resolution: fixed
Status: closedreopened

"wikipedia tag is set, but there is no wikidata tag. Wikipedia plugin might help with wikidata id lookups" does this really fit into the category warning? wikidata tag seems to me an optional tag.

comment:12 Changed 2 days ago by Don-vip

Resolution: fixed
Status: reopenedclosed

In 11771/josm:

fix #14425 - reduce wikidata warning to info level

comment:13 Changed 2 days ago by Klumbumbus

@nyurik: please add documentation for the new functions at wiki:Help/Styles/MapCSSImplementation

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.