@1ec5 commented on this pull request.
> @@ -1,9 +1,11 @@
# frozen_string_literal: true
module BrowseTagsHelper
- # https://wiki.openstreetmap.org/wiki/Key:wikipedia#Secondary_Wikipedia_links
- # https://wiki.openstreetmap.org/wiki/Key:wikidata#Secondary_Wikidata_links
- SECONDARY_WIKI_PREFIXES =
"architect|artist|brand|buried|flag|genus|manufacturer|model|(?:official_|old_)?name:etymology|network|(?:heritage:|old_)?operator|owner|species|subject|taxon"
+ SECONDARY_WIKI_PREFIX_PATTERN = /[a-z:_-]+:/
+ QID_PATTERN = /[Qq][1-9][0-9]*/
+
+ # regex to match all wikipedia locale project identifiers from de and simple
to zh-classical
+ WIKIPEDIA_PROJECT_IDENTIFIER_PATTERN = /[a-z]{1,2}[a-z-]{0,8}?[a-z]{1,2}/
You might be able to treat `simple` as more of a special case (to the extent
that it ever makes sense to link to it from OSM). None of [the other language
codes](https://github.com/osmlab/wmf-sitematrix/blob/dae8cfcc1bb414fd225d0c04da422bc7af807a02/data/wikipedia.json#L3)
gets so long before the first hyphen.
> @@ -81,9 +77,9 @@ def wikipedia_links(key, value)
return nil if %r{^https?://}.match?(value)
case key
- when "wikipedia", /^(#{SECONDARY_WIKI_PREFIXES}):wikipedia/o
- lang = "en"
I think it’s safe to drop this special case. I had no idea anyone is still
using it.
If we also handle subkeys like `wikipedia:fr=*`, then I think we could get away
with dropping support for those as well. Occasionally, there are [local
proposals](https://community.openstreetmap.org/t/bulk-edit-announcement-addition-of-wikipedia-en-he-values/111842/12)
to systematically introduce the language subkeys due to official bilingualism,
but `wikidata=*` is the preferred solution for language-agnostic Wikimedia
linking these days.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7136#pullrequestreview-4498465734
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/7136/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev