Re: [openstreetmap/openstreetmap-website] Change naming of boundaries based on admin_level=* (Issue #5450)
For Overpass queries, there’s currently a special case that pulls in a dedicated string based on the `admin_level=*` if it’s present. Maybe instead we could use the generic “Administrative Boundary” label, using the normal code path, but add a suffix like “(Level 3)”? https://github.com/openstreetmap/openstreetmap-website/blob/7565f5aa4aad13bb45929ba26e82a1ab3ca28210/app/assets/javascripts/index/query.js#L73-L78 For Nominatim queries, if a `place=*` tag is present on either the boundary or the `label` member, we show that as the label instead of anything related to the boundary: https://github.com/openstreetmap/openstreetmap-website/blob/7565f5aa4aad13bb45929ba26e82a1ab3ca28210/app/controllers/geocoder_controller.rb#L101-L107 For example, searching for “[Wapakoneta](https://www.openstreetmap.org/search?query=Wapakoneta#map=13/40.56551/-84.19397)” returns [this `boundary=administrative` `admin_level=8` relation](https://www.openstreetmap.org/relation/182636) but labels it as a “Town” based on the `place=town` tag on [this `label` member](https://www.openstreetmap.org/node/153976720). The label doesn’t call it a “boundary” of any sort, even if that’s what gets highlighted when you select the result. This is pretty reasonable, because the boundary represents a populated place that we’d tag as a `place=town` regardless of the boundary or legal designation. However, for something that doesn’t represent a populated place, such as a U.S. county or a French department, a `label` wouldn’t be as relevant or appropriate, so there still needs to be a “boundary” label for the search result. I think it would be possible to use a suffix here too. It would need some additional translatable format strings. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5450#issuecomment-2565817707 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Change naming of boundaries based on admin_level=* (Issue #5450)
Fortunately, Nominatim does expose `border_type` in the `extratags` field of the response, and both Overpass queries (for nearby and enclosing features) include all the element’s tags. Unfortunately, `border_type=*` values are unlocalized and un-namespaced. We’d only be able to pretty-print the snake_case keywords in English. The forum thread discusses some potential solutions. The simple solution would be to define `geocoder.search_osm_nominatim.border_types.#{border_type}` strings for the most common values of `border_type=*`. This would require every localization on Translatewiki.net to come up with a single word that corresponds to each English word. In some languages, this can be quite difficult for generic words like “[town](https://en.wiktionary.org/wiki/town#Translations)”. I’m not sure it would be received by the community any better than the current `admin_level=*` labels. Fortunately, the Nominatim result comes with a `country_code` field, so we could prefer more specific string keys like `geocoder.search_osm_nominatim.border_types.#{country_code}.#{border_type}`, falling back to a more generic `geocoder.search_osm_nominatim.border_types.global.#{border_type}`. We could either introduce the per-country keys as needed or come up with a more comprehensive list of common `border_type=*` values per country. The latter would put much more of a burden on translators. I’ve seen that in the iD project, where translators have to localize each part of an address field for every country. Unfortunately, the Overpass queries execute independently of each other, so the results for nearby features won’t have any context about the containing country. Since the response is handled on the client side in JavaScript, we could parse the enclosing features results for a country boundary, whenever it arrives, and patch up the labels on the enclosing features. In the meantime, these labels would use the global strings. Kind of icky, but I guess it could work. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5450#issuecomment-2566049746 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 pushed 1 commit. e7f1141fc1d3c78ce808db55ee53b13ec770444c Label boundaries by regional official designations -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493/files/1b9dcca4a9fca8ac670188bf313c8ef78173aeec..e7f1141fc1d3c78ce808db55ee53b13ec770444c You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
Search results for Nominatim and Overpass queries now label administrative boundaries according to the real-world designation according to the `border_type=*` tag. If the value of this tag is unrecognized, the label falls back to a more generic “Administrative Boundary (Level _n_)”, where _n_ is the `admin_level=*` value. The English localization no longer attempts to translate these administrative levels to a fictional country’s administrative hierarchy.There are [many tagging schemes](https://wiki.openstreetmap.org/wiki/Key:border_type#Alternatives) for the real-world designation, each with their advantages and disadvantages, but I focused on `border_type=*` for now because it’s the most common scheme globally. Fixes #5450. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5493 -- Commit Summary -- * Label administrative boundaries by level * Level 2 is always an international boundary * Label boundaries by regional official designations -- File Changes -- M app/assets/javascripts/index/query.js (8) M app/controllers/geocoder_controller.rb (6) M config/locales/en.yml (47) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/5493.patch https://github.com/openstreetmap/openstreetmap-website/pull/5493.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493 You are receiving this because you are subscribed to this thread. Message ID:
Before After [ ](https://www.openstreetmap.org/query?lat=39.252971&lon=-84.281251#map=18/39.253109/-84.280527)
[ ](http://0.0.0.0:3000/query?lat=39.252971&lon=-84.281251#map=18/39.253109/-84.280527)
[ ](https://www.openstreetmap.org/query?lat=43.068068&lon=-79.019396#map=18/43.068339/-79.018591)
[ ](http://0.0.0.0:3000/query?lat=43.068068&lon=-79.019396#map=18/43.068339/-79.018591)
[ ](https://www.openstreetmap.org/search?query=Hamilton#map=11/39.1673/-84.5384)
[ ](http://0.0.0.0:3000/search?query=Hamilton#map=11/39.1673/-84.5384)
___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > +arrondissement: "Arrondissement Boundary" +borough: "Borough Boundary" +cercle: "Cercle Boundary" +city: "City Boundary" +comarca: "Comarca Boundary" +county: "County Boundary" +departement: "Department Boundary" +department: "Department Boundary" +district: "District Boundary" +distrito: "District Boundary" +freguesia: "Freguesia Boundary" +local_authority: "Local Authority Boundary" +municipality: "Municipal Boundary" +municipi: "Municipal Boundary" +município: "Municipal Boundary" +nation: "International Boundary" +national: "International Boundary" +neighbourhood: "Neighborhood Boundary" +parish: "Parish Boundary" +province: "Provincial Boundary" +região: "Regional Boundary" +region: "Regional Boundary" +state: "State Boundary" +town: "Town Boundary" +township: "Township Boundary" +village: "Village Boundary" For starters, I added a translatable string for each of the 30 or so `border_type=*` values that occur most frequently with `boundary=administrative`. Only one translatable string is provided per `border_type=*` value globally. This will likely present a problem for some languages that would translate English words like “district”, “county”, or “town” differently depending on the country. I think we’ll need to add some more specific strings qualified by country code, as explained in https://github.com/openstreetmap/openstreetmap-website/issues/5450#issuecomment-2566049746, but it’ll require a bit more research to find out which values are important in which countries. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#pullrequestreview-2545317289 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Change naming of boundaries based on admin_level=* (Issue #5450)
#5493 implements the enhancements above except for distinguishing a given `border_type=*` value that needs to be translated differently depending on the country. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5450#issuecomment-2585517181 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Copyedit English localization as American English (PR #5029)
@1ec5 commented on this pull request. > +level2: "International Border" +level3: "Regional Administrative Boundary" +level4: "Regional Administrative Boundary" +level5: "Regional Administrative Boundary" +level6: "Local Administrative Boundary" +level7: "Local Administrative Boundary" +level8: "Local Administrative Boundary" +level9: "Sublocal Administrative Boundary" +level10: "Sublocal Administrative Boundary" +level11: "Sublocal Administrative Boundary" This is superseded by #5493. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5029#discussion_r1912377698 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > +level3: "Administrative Boundary (Level 3)" +level4: "Administrative Boundary (Level 4)" +level5: "Administrative Boundary (Level 5)" +level6: "Administrative Boundary (Level 6)" +level7: "Administrative Boundary (Level 7)" +level8: "Administrative Boundary (Level 8)" +level9: "Administrative Boundary (Level 9)" +level10: "Administrative Boundary (Level 10)" +level11: "Administrative Boundary (Level 11)" I noticed that other boundary types don’t say “Boundary”. For example, `boundary=electoral` is just “Electoral”. We could shorten “Administrative Boundary (Level 4)” to just “Administrative (Level 4)”, but I’m ambivalent about similarly truncating the `border_type=*`-based labels, such as “City ~~Boundary~~”. That would easily get confused with the `place=*`-based labels, which follow different criteria. Another option would be to drop the level suffix, since @tomhughes doesn’t seem enamored with including this information anyways. To the extent that this introduces ambiguity in the search results, the solution would be to tag boundaries with `border_type=*`, which is a good idea anyways. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1912562705 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > +level3: "Administrative Boundary (Level 3)" +level4: "Administrative Boundary (Level 4)" +level5: "Administrative Boundary (Level 5)" +level6: "Administrative Boundary (Level 6)" +level7: "Administrative Boundary (Level 7)" +level8: "Administrative Boundary (Level 8)" +level9: "Administrative Boundary (Level 9)" +level10: "Administrative Boundary (Level 10)" +level11: "Administrative Boundary (Level 11)" Not a bad idea overall, though the numbers probably aren’t as intuitive for many mappers as designations coming from either `border_type=*` or `place=*`. I had forgotten about the code to transform an unrecognized tag into a label. As long as we have labels, we could fall back to a format string like “_Border Type_ Boundary” if `border_type=*` is present but set to an unrecognized value. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1912585645 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > + border_type = t > "geocoder.search_osm_nominatim.border_types.#{extratag.attributes['value']}", > :default => prefix_name if extratag.attributes["key"] == "border_type" + place_type = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "linked_place" || extratag.attributes["key"] == "place" Yes, good catch. I originally had two loops that set `prefix_name` directly. Now we probably don’t need a `:default` at all. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1912575079 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > +level3: "Administrative Boundary (Level 3)" +level4: "Administrative Boundary (Level 4)" +level5: "Administrative Boundary (Level 5)" +level6: "Administrative Boundary (Level 6)" +level7: "Administrative Boundary (Level 7)" +level8: "Administrative Boundary (Level 8)" +level9: "Administrative Boundary (Level 9)" +level10: "Administrative Boundary (Level 10)" +level11: "Administrative Boundary (Level 11)" Would the number be clearer than the locally common word for the type of boundary? Mappers who specialize in boundaries would know the local `admin_level=*` scale by heart, but others would find words more intuitive and would already know which are larger than others. Also, the Overpass results are ranked by size. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1913602838 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add OpenMapTiles vector map (PR #4042)
@1ec5 commented on this pull request. > @@ -9,6 +14,43 @@ L.extend(L.LatLngBounds.prototype, { } }); +if (OSM.MAPTILER_KEY) { + maplibregl.setRTLTextPlugin( + "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js";, To avoid this external dependency on a Mapbox API, install the `@mapbox/mapbox-gl-rtl-text` package and have a build script copy node_modules/@mapbox/mapbox-gl-rtl-text/dist/mapbox-gl-rtl-text.js into app/assets/javascripts/. Then this becomes just `mapbox-gl-rtl-text.js`. > +var mainLocale = I18n.locale.slice(0, 2); +var localeIndex = supportedLanguages.findIndex(function (locale) { + return locale === mainLocale; +}); This website and maplibre-gl-omt-language both support some locales that have three-character-long language codes, such as [Western Punjabi](https://github.com/openstreetmap/openstreetmap-website/blob/e206dd527ef7c6d1829f131533d722e536e4bfb5/config/locales/pnb.yml) (pnb). I don’t think this code will match such locales. If I’m not mistaken, the intention is to match on only the language code and ignore any script or country code. If so, this would be more robust: ```suggestion var mainLocale = I18n.locale.split('-')[0]; var localeIndex = supportedLanguages.findIndex(function (locale) { return locale === mainLocale; }); ``` Note that this is still quite a rudimentary locale matching heuristic. It won’t match `zh-Hans` or `zh-Hant`, which the plugin also supports. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4042#pullrequestreview-2603380276 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Contribution heatmap is off by a month (Issue #5802)
1ec5 left a comment (openstreetmap/openstreetmap-website#5802) I can reliably reproduce this issue: * In Firefox 137.0b6 and Safari 18.3.1 on macOS 15.3.2, and Safari on iOS 16.7 * With `I18n.locale` evaluating to `en` or `vi` * With a screen 1,728 pixels wide or 375 pixels wide -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5802#issuecomment-2726768075 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Contribution heatmap is off by a month (Issue #5802)
1ec5 left a comment (openstreetmap/openstreetmap-website#5802) > Not sure if timezone would affect this, but I'm in UTC -4. Ah, that’s a good insight. I’m in UTC−7. Changing my system clock to UTC works around the issue: https://github.com/user-attachments/assets/ea4c16eb-c893-48d8-b085-4a2c72e61ef8"; width="960" alt="No contributions on March 13, 2025, with a label March above it."> So this issue affects anyone in the Western Hemisphere. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5802#issuecomment-2726796685 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] Missing translations should fall back to English (Issue #5819)
1ec5 created an issue (openstreetmap/openstreetmap-website#5819) Fall back to English when a string is missing from the localization or the translation refers to a nonexistent interpolation argument. ## Rationale Sometimes a localizable string has to get changed to a different ID whenever the interpolated placeholders change. Otherwise, translations coming from Translatewiki.net can get out of sync with the new string’s set of interpolations, causing the `I18n.t` function to raise an `I18n::MissingInterpolationArgument` exception. Changing the string ID can be a good signal that the translator needs to slow down and potentially retranslate the message. But often, the content change is minor yet it’s difficult to track down the old string to ensure consistency. As a translator, I feel this every time a nontrivial change occurs on the Copyright page. Over in the OpenHistoricalMap fork of this project, we’ve had to customize many messages that have interpolation arguments. For example, we had a couple miscues merging #4572, which renamed a string on the homepage at the same time it changed its interpolation arguments. Git detected the change as a merge conflict in en.yml but not in the source files that used the string. As a result, many locales wound up with a raw ID in the UI. I thought OpenHistoricalMap/ohm-website#264 would fix the problem on the homepage by aligning with the ID from upstream. Unfortunately, my change instead led to 500 errors like OpenHistoricalMap/issues#972, either because translators hadn’t gotten around to updating the string or because they’d accept the translation memory suggestion coming from openstreetmap-website’s localization. We can rename the string again to avoid further problems, but it’s just one of many lurking issues along these lines. Another example is OpenHistoricalMap/issues#537. ## Suggestion Translatewiki.net assumes the software behaves like MediaWiki, which is resilient to strings that include nonexistent interpolation arguments. For the I18n library we’re using, [this blog post](https://kinduff.com/2022/02/07/an-i18n-coding-adventure/) explores setting `missing_interpolation_argument_handler` to suppress the error in favor of something gentler, such as a “missing key” string. Even better, I suspect we could implement a handler that falls back to English, the base localization, by passing the same string into `t` but passing `en` as the `locale`. If we need to retain the ability to spot when a translation is missing, maybe we can limit this handler to production code. I might be missing a simpler solution, but in general it seems like the translation process is too fragile for a 500 error to be the right response to a malformed translation. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5819 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing interpolations in translations should fall back to English (Issue #5819)
Closed #5819 as not planned. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5819#event-16852904738 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing interpolations in translations should fall back to English (Issue #5819)
1ec5 left a comment (openstreetmap/openstreetmap-website#5819) Right, I’ve definitely found this test useful. I’ll have to look into why it isn’t running on Translatewiki.net PRs like OpenHistoricalMap/ohm-website#276. I recall you’ve periodically had to go into osm-community-index to report issues where someone overtranslated the name of the interpolation variable. If you’re OK with that kind of issue blocking a deployment, then what I described is mainly an issue for when forks have to merge from upstream. But with the low number of highly customized forks, I suppose that’s something we can handle downstream. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5819#issuecomment-2735157309 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] pretty formatting of OSM URLS in notes, changeset comment, and comments (Issue #5780)
1ec5 left a comment (openstreetmap/openstreetmap-website#5780) GitHub gets around this problem by requiring a `#` in front of the number, or the full URL. Even just detecting and linkifying the URL would be a significant improvement. By the way, the URL format for elements used to be slightly different, for example, https://www.openstreetmap.org/browse/way/1249366504. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5780#issuecomment-2746261182 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] Contribution heatmap is off by a month (Issue #5802)
1ec5 created an issue (openstreetmap/openstreetmap-website#5802) The horizontal axis on the user contribution heatmap is off by a month. Each label across the top appears to be centered over the following month. For example, if you’ll excuse me showing off my own profile: https://github.com/user-attachments/assets/bf959db2-5dc1-416c-9c8b-23f0987d7c85"; width="960" alt="The tooltip says March 04, 2025, but the label above it says February."> Not sure if this is a bug in cal-heatmap upstream or in this repository, since [the template](https://github.com/openstreetmap/openstreetmap-website/blob/037be97bf1fd758dfacd7861276f13a629261a59/app/views/users/show.html.erb#L245-L253) only contains an explicit list for the day labels along the side. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5802 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing interpolations in translations should fall back to English (Issue #5819)
1ec5 left a comment (openstreetmap/openstreetmap-website#5819) Sorry, the title of the issue was misleading; I changed it. This is specifically about when a string in the YAML file includes a `%{foo}` but `foo` isn’t one of the arguments passed into `I18n.t`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5819#issuecomment-273454 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] pretty formatting of OSM URLS in notes, changeset comment, and comments (Issue #5780)
1ec5 left a comment (openstreetmap/openstreetmap-website#5780) > Also osm.wiki could be considered another URL variant, but idk how official > that one is. The OSMF owns the osm.wiki domain. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5780#issuecomment-2746967396 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Enable native share if available (PR #5882)
1ec5 left a comment (openstreetmap/openstreetmap-website#5882) > I'm not sure if it's very useful because you can just share the current page > url from the browser menu. In Safari on macOS, a share sheet appears with a variety of options, including shortcuts to people I’ve chatted with recently and actions provided by third-party extensions. Ultimately it’s based on a URL, but it can save users some steps. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5882#issuecomment-2788591689 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] pretty formatting of OSM URLS in notes, changeset comment, and comments (Issue #5780)
1ec5 left a comment (openstreetmap/openstreetmap-website#5780) Longer comments are more likely to prompt respondents to quote individual passages. In changeset and note discussions, this is usually a sign that the discussion should move outside the confines of the sidebar, to either direct messages or the forum. Other places like diary comments already support Markdown, so there’s a little less urgency there. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5780#issuecomment-2762152123 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] pretty formatting of OSM URLS in notes, changeset comment, and comments (Issue #5780)
1ec5 left a comment (openstreetmap/openstreetmap-website#5780) That reminds me of another detail about GitHub’s pretty-printing: if you copy the pretty-printed text, some rich text formatting get paired with it, so that pasting the text will result in a working link in any rich text editor or Markdown-enabled field. Originally, they didn’t have this functionality, but # links would get linkified anyways, so it wasn’t a big deal unless you pasted outside of GitHub. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5780#issuecomment-2761808349 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Make contribution heat map opt in (Issue #5804)
1ec5 left a comment (openstreetmap/openstreetmap-website#5804) Who is this widget’s intended audience and what’s its purpose? https://github.com/openstreetmap/openstreetmap-website/issues/5373#issue-2714677416 frames it this way: > The current user profile page provides a detailed summary of contributions > but lacks a visual representation of activity trends. A calendar heatmap, > similar to GitHub's user contribution calendar, would make it easier to > understand user engagement over time at a glance. Going back further, https://github.com/openstreetmap/openstreetmap-website/issues/5356#issue-2691128594 opens with this problem statement: > We want to enhance the OSM profile pages with more engaging and informative > features, similar to HDYC. I’m not sure I agree with the premise that the profile page had a detailed summary in the first place. But putting that aside, all I see is a desire to match the visual attractiveness of GitHub profile pages and Pascal Neis’s How Did You Contribute? tool, and to track “user engagement”. As user engagement isn’t a meaningful metric for OSM as a project, I think this feature could’ve benefited from more detailed consideration of use cases. For example: * If it’s for the user to track their own edits, it probably belongs on their dashboard, which is visible only to them. That should mitigate the privacy concerns expressed here, even if we extend the feature to make it easier to reminisce about a changeset by date. * If it’s for the user to show off their editing streak to others, as a light form of gamification, then there should be an option about that. At the very least, some community members don’t view their changeset history as a fair portrayal of their value to the community. I hear griping about that almost every year when OSMF board candidates’ heatmaps get posted on the wiki for all to see (even nonmembers). * If it’s for others to gauge at a glance whether the user is actively editing these days, then I don’t think this level of granularity helps very much. I don’t need to know whether the user edits on weekends in order to predict whether they’re likely to respond to a direct message promptly or complain about their work getting reverted, or whether I should be concerned that my ~~friend~~ follow is drifting away from the project. A simpler all-time line graph would convey this information more effectively (irrespective of any privacy considerations). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5804#issuecomment-2726753639 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { +:bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}, +:discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)}, +:facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)}, +:github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)}, +:gitlab => %r{\Ahttps?://(?:www\.)?gitlab\.com/([a-zA-Z0-9_-]+)}, +:instagram => %r{\Ahttps?://(?:www\.)?instagram\.com/([a-zA-Z0-9._]+)}, +:linkedin => %r{\Ahttps?://(?:www\.)?linkedin\.com/in/([a-zA-Z0-9_-]+)}, +:line => %r{\Ahttps?://(?:www\.)?line\.me/ti/p/([a-zA-Z0-9_-]+)}, +:mastodon => %r{\Ahttps?://(?:(?:www\.)?mastodon\.social|en\.osm\.town)/@([a-zA-Z0-9_]+)}, Bluesky also uses a leading at sign, but only Mastodon uses two at signs as far as I know. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1995945136 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Contribution heatmap is off by a month (Issue #5802)
1ec5 left a comment (openstreetmap/openstreetmap-website#5802) Ah sorry, I’m [Minh Nguyen](https://www.openstreetmap.org/user/Minh%20Nguyen) on OSM, though I’m seeing this on everyone’s heatmap, such as [Steve](https://www.openstreetmap.org/user/Steve) and [Mateusz Konieczny - bot account](https://www.openstreetmap.org/user/Mateusz%20Konieczny%20-%20bot%20account). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5802#issuecomment-2726089781 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Remove u-turn side decision (PR #5777)
1ec5 left a comment (openstreetmap/openstreetmap-website#5777) > and the `driving_side` is wrong more often. As noted in https://github.com/Project-OSRM/osrm-backend/issues/2269#issuecomment-357154269, a GeoJSON of [left-hand-drive regions](https://github.com/Project-OSRM/osrm-backend/blob/4ee9968e3b585ee8ef28aec4a7fe3cfdea1f9ea2/data/driving_side.geojson) needs to be passed into `osrm-extract`. Otherwise, `driving_side` will always fall back to the default value of `right`. This seems to be the current behavior of the FOSSGIS OSRM server. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5777#issuecomment-2788636408 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)
@1ec5 commented on this pull request. > } else { - return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) }); + const ft = m / ftSize; + const mi = m / miSize; + if (ft < 1000) { > You mean at 0.1 miles? Yep, that was a typo, fixed. The difference between metric and non-metric in these SDKs is due to a large quantity like 999 meters still being comprehensible compared to 5,280 feet. Fewer digits helps too. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5915#discussion_r2039879862 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)
@1ec5 commented on this pull request. > } else { - return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) }); + const ft = m / ftSize; + const mi = m / miSize; + if (ft < 1000) { That would seem more reasonable to me. 👍 -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5915#discussion_r2040013366 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Can we avoid inlining svgs into erb templates? (Issue #5880)
1ec5 left a comment (openstreetmap/openstreetmap-website#5880) Conceivably the project could have SVGs that aren’t just paths, for example the larger decorative image on the login screen or the occasional banner advertisement on the homepage, in order to make it scalable or more easily translatable. I suspect contributors would be more comfortable editing such images in a full-fledged editor like Inkscape, even if it would be overkill for the simpler icons. (As a point of reference, the OSM Americana project has [a suggested workflow](https://github.com/osm-americana/openstreetmap-americana/blob/c4829f2c91099c3b5619fff829a390133ea08a53/CONTRIBUTING.md#highway-shield-contributors-guide) involving Inkscape and an automated build script that optimizes the exported SVG, stripping out the excessive metadata that Inkscape adds.) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5880#issuecomment-2813582540 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Replace CC by-sa license link with ODbL in history feeds (PR #5933)
@1ec5 commented on this pull request. > @@ -10,9 +10,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, feed.logo image_url("mag_map-rss2.0.png") feed.rights :type => "xhtml" do |xhtml| -xhtml.a :href => "https://creativecommons.org/licenses/by-sa/2.0/"; do |a| - a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0" -end +xhtml.a "Open Data Commons Open Database License", :href => "https://opendatacommons.org/licenses/odbl/"; I’m fixing the license in OpenHistoricalMap/ohm-website#288. (I hadn’t noticed the problem until this PR of yours.) In local testing, the feed does seem to pull from at least en.yml, but I haven’t tested with other locales. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5933#discussion_r2046420644 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Replace CC by-sa license link with ODbL in history feeds (PR #5933)
@1ec5 commented on this pull request. > @@ -10,9 +10,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, feed.logo image_url("mag_map-rss2.0.png") feed.rights :type => "xhtml" do |xhtml| -xhtml.a :href => "https://creativecommons.org/licenses/by-sa/2.0/"; do |a| - a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0" -end +xhtml.a "Open Data Commons Open Database License", :href => "https://opendatacommons.org/licenses/odbl/"; That’s true, it’s probably not as useful as synchronizing with the overall site setting. I only inspected the source code to see that it had pulled it from the YAML file instead of leaving a raw string key. 🤷♂️ Anyways, this isn’t a huge deal, just curious if there could’ve been a way to keep this bug from lurking for so long. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5933#discussion_r2046460047 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] What is the license of the images on the OSM website? (Issue #5966)
1ec5 left a comment (openstreetmap/openstreetmap-website#5966) > I also wouldn't say it's that common for open source projects that are > primarily code based to go to the trouble of specifying a different license > for artwork. I'm sure it does happen but I can't think of any examples off > the top of my head. It happens with some map style repositories, such as [this fork of OSM Carto](https://imagico.de/blog/en/on-open-map-design-licensing/) and [Mapbox’s original vector styles](https://github.com/mapbox/mapbox-gl-styles/blob/c4b34ab336fdb70be489fa018f2fe9e6f341b4f5/LICENSE.md), but these projects are known primarily for their visual output. Some vector tile schemas license “cartographic design” separately from the code, such as [OpenMapTiles](https://github.com/openmaptiles/openmaptiles/blob/f70ae783b286e362431efc53a07dfa35472be2bd/LICENSE.md), in order to require attribution in the finished product. Occasionally I’ve seen website projects separately license graphical elements within, but I don’t know of any OSM-related examples off the top of my head. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5966#issuecomment-2845086226 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Please add NATO coordinates, Here is why. (Issue #5984)
1ec5 left a comment (openstreetmap/openstreetmap-website#5984) > aren't you guys sort of competing with Google? Only in the sense of providing geographic data about on-the-ground stuff that others could use to create services that compete with Google. You’ve basically asked the plumber to bake you a New York pizza. 😉 Taking a step back, perhaps you could post to [our help forum](https://community.openstreetmap.org/c/help-and-support/7) explaining what it is you’d like to do with grid reference systems, practically speaking. Folks in the community might know of existing software that provides this capability in conjunction with OSM data, or they might be able to suggest suitable workarounds that you could implement yourself. (As with anywhere on the Internet, you might want to focus on technical problem-solving without so much geopolitical context to ensure constructive responses.) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5984#issuecomment-2851781334 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] [Feature request] Changelog (Issue #5950)
1ec5 left a comment (openstreetmap/openstreetmap-website#5950) Yes, I’m looking into starting a series of posts on the forum periodically highlighting noteworthy changes as they go in, similar to what I’ve been doing for OpenHistoricalMap. These won’t technically be release notes, since this project uses a continuous deployment model. Separately, some OSM-related projects [maintain running “changelogs”](https://keepachangelog.com/en/1.0.0/) that are more like draft release notes. In principle, the document could be divided by month rather than release. In iD and related projects, we’ve been discussing the best way to manage these documents. iD’s changelog has gotten so long that GitHub sometimes breaks down trying to render it. Drafting updates at release time slows down the release process, sometimes by days, but the running changelog concept hasn’t really worked out either, since most contributors don’t bother writing their own blurbs (and there’s a whole issue around merge conflicts if they do). All of this is to say: let’s start with high-level updates outside the repo for now, and see how it goes. Look for an announcement probably next week tied to this discussion. 🙂 -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5950#issuecomment-2830897286 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Replace CC by-sa license link with ODbL in history feeds (PR #5933)
@1ec5 commented on this pull request. > @@ -10,9 +10,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, feed.logo image_url("mag_map-rss2.0.png") feed.rights :type => "xhtml" do |xhtml| -xhtml.a :href => "https://creativecommons.org/licenses/by-sa/2.0/"; do |a| - a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0" -end +xhtml.a "Open Data Commons Open Database License", :href => "https://opendatacommons.org/licenses/odbl/"; Should this use `Settings.license_url`? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5933#pullrequestreview-2769525094 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)
@1ec5 commented on this pull request. > } else { - return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) }); + const ft = m / ftSize; + const mi = m / miSize; + if (ft < 1000) { For what it’s worth, the [MapLibre Navigation SDK](https://github.com/maplibre/maplibre-navigation-ios/blob/f91faffa1aa03be16fc588dc5076b7811d1c5166/MapboxCoreNavigation/DistanceFormatter.swift#L146-L160) switches at 1,000 meters = 1 kilometer, 176 yards = 1 mile for the UK, or 528 feet = 1 mile for the U.S. (ignoring the rounding increments that are applied for readability at a glance). [Ferrostar](https://github.com/stadiamaps/ferrostar/blob/f10b01c03bec9554a7cf827327795d253ad4c1f0/apple/Sources/FerrostarCarPlayUI/Measurement/MKDistanceFormatterUnits.swift#L36-L54) switches at 1,000 meters = 1 kilometer, 300 yards = 0.17 miles for the UK, or 289 feet = 0.16 miles for the U.S. These navigation SDKs don’t aim for equivalent thresholds between measurement systems, since most users aren’t switching back and forth between them. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5915#discussion_r2038424247 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing American English localization (Issue #4975)
1ec5 left a comment (openstreetmap/openstreetmap-website#4975) As the original post and #5029 illustrate, `en` is currently a mix of British English, American English, OSM English, and some outright mistakes. Regardless, Translatewiki.net assumes `en` is American English, as does pretty much every user agent (operating system or browser). It is possible to create our own custom mapping from Translatewiki.net’s locale codes to YAML files. However, Translatewiki.net contributors probably wouldn’t abide by any unusual mapping from `en-CA` to `en-US`, especially not any Canadian translators there, who would be rightfully proud of their country code. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/4975#issuecomment-2707699299 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > + border_type = t > "geocoder.search_osm_nominatim.border_types.#{extratag.attributes['value']}", > :default => prefix_name if extratag.attributes["key"] == "border_type" + place_type = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "linked_place" || extratag.attributes["key"] == "place" Fixed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1984987788 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 pushed 1 commit. 7869631e83a7686c06d92aaefb8a23245e930b57 Label boundaries by regional official designations -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493/files/84ca7f4d897b8361d2209968a3abeb4f78dfb86b..7869631e83a7686c06d92aaefb8a23245e930b57 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 commented on this pull request. > @@ -101,9 +101,13 @@ def search_osm_nominatim if klass == "boundary" && type == "administrative" rank = (place.attributes["address_rank"].to_i + 1) / 2 prefix_name = t "geocoder.search_osm_nominatim.admin_levels.level#{rank}", :default => prefix_name +border_type = false +place_type = false Fixed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1984987577 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
@1ec5 pushed 3 commits. ad5d67931fa1cbfe0049db3cb5a0a910f351c07f Label administrative boundaries by level 7006aa983947fde2a48ea4143059668d50d1cb16 Level 2 is always an international boundary 84ca7f4d897b8361d2209968a3abeb4f78dfb86b Label boundaries by regional official designations -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493/files/e7f1141fc1d3c78ce808db55ee53b13ec770444c..84ca7f4d897b8361d2209968a3abeb4f78dfb86b You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Label administrative boundaries by real-world designation (PR #5493)
1ec5 left a comment (openstreetmap/openstreetmap-website#5493) Thanks for your patience. I’ve addressed the code-level feedback. https://github.com/openstreetmap/openstreetmap-website/pull/5493#discussion_r1912562048 is unresolved; there are a couple options for making it briefer (in English at least), but not without losing some detail. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5493#issuecomment-2706367281 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing American English localization (Issue #4975)
1ec5 left a comment (openstreetmap/openstreetmap-website#4975) > Isn't Canadian English similar to US English? For the kinds of strings being translated in this repository, Canadian English spelling is closer to Australian English than American English, for example, “cancelled”, “centre”, and “licence” (versus AmEng “canceled”, “center”, and “license”, respectively). But as I mentioned in the PR, I’m more concerned about vocabulary than spelling, which most users can simply get used to. Unfortunately, there are also some differences in terminology that could cause confusion, such as “parkade” (versus “parking garage”) and “washroom” (versus “restroom”). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/4975#issuecomment-2708631689 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Missing American English localization (Issue #4975)
1ec5 left a comment (openstreetmap/openstreetmap-website#4975) No, currently there is no U.S. English localization. This issue was closed almost immediately, and #5029 is only a draft for discussion about what a U.S. English localization would contain, if we could find a Translatewiki.net-compatible code for it. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/4975#issuecomment-2707604491 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
1ec5 left a comment (openstreetmap/openstreetmap-website#5261) I just noticed this renaming as I went to update translations over on Translatewiki.net. Like others here, I was also struck by the oddity of describing an individual as “a following” and a set of individuals as “followings”. It’s basically a made-up word at this point. Worse, as https://github.com/openstreetmap/openstreetmap-website/pull/5261#issuecomment-2613978828 points out, it’s completely backwards: a following is the people who are following _you_, not the people whom _you_ are following. As it’s used in social media, “follow” is a figure of speech, a [skeuomorph](https://en.wikipedia.org/wiki/Skeuomorph), for the act of chasing after someone. The opposite of a _follower_ is a _leader_, and I think that underscores how poorly the social media model fits this website. (And, let’s be honest, the opposite of a _stalker_ is a _target_.) In Vietnamese, I’ve already been translating “subscribe (to a changeset)” as “follow”, so I’d probably do that for this as well, but “a follow” unfortunately has no translation. The closest I can come up with would be “a followed user”, which might as well be what we say in English. Do we even need a user-facing word for this concept, apart from the internal data model? The dashboard has plenty of space to say “Users you are following” (above “Other nearby users”), and the notifications can say “[User name] is now following you”. As far as I know, all this function currently does is list a user on your dashboard: https://github.com/openstreetmap/openstreetmap-website/issues/3310#issuecomment-912283262. Is the intention to eventually make this functionality behave more like a social media feed? If not, there must be some word that better describes it than either “friend” or “follow”. Maybe a better mental model would be “pinning a pinned user”. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#issuecomment-2708463482 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] allow markdown in changeset comments (#844)
1ec5 left a comment (openstreetmap/openstreetmap-website#844) Many websites that accept Markdown end up pretty-printing raw URLs. For example, GitHub turns `https://github.com/openstreetmap/openstreetmap-website/issues/844#issuecomment-2705479356` into https://github.com/openstreetmap/openstreetmap-website/issues/844#issuecomment-2705479356. It isn’t the most discoverable syntax: you’d probably see people occasionally trying to replicate the presentation by hand as ```[`informal=yes`](https://wiki.openstreetmap.org/wiki/Tag:informal%3Dyes)```, but I don’t think that would be a huge problem. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/844#issuecomment-2708470716 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add OpenMapTiles vector map (PR #4042)
@1ec5 commented on this pull request. > + + var copyright = I18n.t("javascripts.map.copyright_text", { copyright_link: copyright_link }); + + var openmaptiles_link = I18n.t("javascripts.map.openmaptiles", { +openmaptiles_url: "https://openmaptiles.org/";, +maptiler_url: "https://www.maptiler.com/"; + }); + + var terms = $("", { +href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use";, +text: I18n.t("javascripts.map.website_and_api_terms") + }).prop("outerHTML"); + + this.baseLayers.push(new L.OpenMapTiles({ +attribution: copyright + ". " + openmaptiles_link + ". " + terms, +code: "V", I think it’s just based on the name of the layer, using whatever letter is available and unlikely to clash with the others. OpenHistoricalMap’s fork has also assigned [its own codes](https://github.com/OpenHistoricalMap/ohm-website/blob/ad4ea829a7f794a456ef5c1484e977653cd9f7c3/app/assets/javascripts/leaflet.map.js#L81), currently J, O, R, and W, but there hasn’t been a conflict because some of OSM’s featured layers have been removed. The only risk from reusing a previously assigned letter is that some old links to the old layer will now point to the new layer, but these links have been falling back to the Standard layer anyways. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4042#discussion_r1976457225 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { +:bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}, +:discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)}, +:facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)}, +:github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)}, +:gitlab => %r{\Ahttps?://(?:www\.)?gitlab\.com/([a-zA-Z0-9_-]+)}, +:instagram => %r{\Ahttps?://(?:www\.)?instagram\.com/([a-zA-Z0-9._]+)}, +:linkedin => %r{\Ahttps?://(?:www\.)?linkedin\.com/in/([a-zA-Z0-9_-]+)}, +:line => %r{\Ahttps?://(?:www\.)?line\.me/ti/p/([a-zA-Z0-9_-]+)}, +:mastodon => %r{\Ahttps?://(?:(?:www\.)?mastodon\.social|en\.osm\.town)/@([a-zA-Z0-9_]+)}, This is very restrictive. A lot of OSM contributors have accounts in other places, such as but not limited to [Mapstodon](https://mapstodon.space/). Sites that accept Mastodon accounts typically accept them in one of the following formats: * `map...@example.net` * `@map...@example.net` * `https://example.net/@mapper` There’s no way to validate a Mastodon profile URL or Mastodon address by domain, as that would defeat the purpose of the Fediverse. If the purpose of this regex is only to assign a Mastodon icon, that’s no big deal. But it looks like the link in the profile only displays the local part of the Mastodon address. This can get confusing when multiple servers have accounts with the same name. The standard display format is `@map...@example.com`. > +# +# Foreign Keys +# +# fk_rails_... (user_id => users.id) +# + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { +:bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}, +:discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)}, +:facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)}, +:github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)}, Flickr might be a nice one to add. I’ve seen lots of examples of people using their Flickr accounts to host photos taken during field surveys, and our forum has special handling for Flickr photos. > +# +# Indexes +# +# index_social_links_on_user_id (user_id) +# +# Foreign Keys +# +# fk_rails_... (user_id => users.id) +# + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { Some suggestions for additional sites that users might want to display on their profiles in the same manner, in case the list isn’t strictly limited to social media accounts: * OSM Community Forum (though it should be automatic) * OpenGeofiction and OpenHistoricalMap * Wikipedia, Wikidata, Wikivoyage, and Wikimedia Commons -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#pullrequestreview-2683519315 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)
1ec5 left a comment (openstreetmap/openstreetmap-website#5769) CLDR has string formats for [future/past relative years/months/etc.](https://www.unicode.org/cldr/charts/47/summary/sk.html#38e7d288d00bc475) However, it doesn’t have any provisions for “about”. As far as I know, “about” timestamps are relatively rare these days, since most software would write out the specific date past a certain point. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2723097448 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Calendar heatmap of user contributions on user profile (Issue #5373)
1ec5 left a comment (openstreetmap/openstreetmap-website#5373) This landed in #5402. This issue didn’t close automatically because “addresses” isn’t one of [GitHub’s closing keywords](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5373#issuecomment-2722827109 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)
1ec5 left a comment (openstreetmap/openstreetmap-website#5769) Are rails-i18n and homegrown translation strings the only options for formatting dates? On the client side, JavaScript has [a robust API for formatting relative dates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) according to a given locale. It’s powered by CLDR, which is the industry standard for this sort of thing. If we can find a Rails library that pulls data from CLDR, then we don’t need to burden translators with every permutation that their language doesn’t need. Or we could leave it as an absolute timestamp and rely on JavaScript to relativize it on the fly. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2722906195 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add OpenMapTiles vector map (PR #4042)
@1ec5 commented on this pull request. > @@ -9,6 +14,43 @@ L.extend(L.LatLngBounds.prototype, { } }); +if (OSM.MAPTILER_KEY) { + maplibregl.setRTLTextPlugin( + "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js";, See https://github.com/openstreetmap/openstreetmap-website/pull/4042#discussion_r1966816765, sorry for the delay. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4042#discussion_r1966833648 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Company Name on Profile Page (PR #5987)
1ec5 left a comment (openstreetmap/openstreetmap-website#5987) There’s already a fairly strong disincentive to claim corporate affiliation in at least some parts of the OSM community. 😅 Maybe optimistically linking to a matching wiki page could help by giving the user a way to verify for themselves. Do we have a way to link to only certain categories of wiki pages like [Organised Editing Teams](https://wiki.openstreetmap.org/wiki/Category:Organised_Editing_Teams)? If spam is a concern, I can probably rig something to alert wiki administrators when a page gets added to that category (or a more specific category of your choosing), so we can add it to our watchlists. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5987#issuecomment-2859962047 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] API versions, capabilities and permissions resources (PR #5979)
1ec5 left a comment (openstreetmap/openstreetmap-website#5979) I [updated the documentation](https://wiki.openstreetmap.org/wiki/Special:Diff/2852642) to reflect the removal. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5979#issuecomment-2871275388 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] API versions, capabilities and permissions resources (PR #5979)
1ec5 left a comment (openstreetmap/openstreetmap-website#5979) Oh! My bad. I [reverted the change](https://wiki.openstreetmap.org/wiki/Special:Diff/2852676). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5979#issuecomment-2871750842 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Change language for welcome mat (Issue #5991)
1ec5 left a comment (openstreetmap/openstreetmap-website#5991) The welcome mat for corporate and institutional editing teams is a separate website. Unfortunately it doesn’t appear to be translatable yet: osmfoundation/welcome-mat#8. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5991#issuecomment-2861807347 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Improve statistucs numbers (PR #5994)
@1ec5 commented on this pull request. This will make the stats much more readable at a glance. Do we know of anything that scrapes this page and possibly expects these numbers to remain unformatted? Does this also affect [the statistics page on the planet site](https://planet.openstreetmap.org/statistics/data_stats.html) or only on the main domain? I’m no fan of scraping pages for stuff like this, but we don’t have an equivalent API endpoint, so I might need to spread the word about this change. > @@ -23,11 +29,11 @@ begin relation_count = Relation.where(:visible => true).count puts "" -puts "Number of users#{user_count}" -puts "Number of uploaded GPS points#{tracepoint_count}" -puts "Number of nodes#{node_count}" -puts "Number of ways#{way_count}" -puts "Number of relations#{relation_count}" +puts "Number of users#{user_count.format()}" +puts "Number of uploaded GPS points#{tracepoint_count.format()}" +puts "Number of nodes#{node_count.format()}" +puts "Number of ways#{way_count.format()}" +puts "Number of relations#{relation_count.format()}" If you’re open to it, an alternative approach would be to add a small amount of JavaScript that [formats the number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on the fly. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5994#pullrequestreview-2825679494 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add OpenLocationCode to OSM website (#1807)
1ec5 left a comment (openstreetmap/openstreetmap-website#1807) > My suggestion for next steps is to adopt the syntax `geo:$x,$y;u=$u` as a > Latitude/Longitude input. For example, `geo:-23.55,-46.63;u=15`. #1123 tracks accepting a geo: URI as search input. The topic of standing up a companion website probably deserves a separate discussion, perhaps in [osm-planning](https://github.com/osmlab/osm-planning/) or [operations](https://github.com/openstreetmap/operations/) (if you foresee the OWG or OSMF taking an active role in this), or better yet, somewhere like [the forum](https://community.openstreetmap.org/t/plus-codes/84969) where people are used to discussions going off in many very interesting tangents. Same goes with the topic of grid references inside geo: URIs. If there’s already a standard affordance for grid references inside geo: URIs, then we could track providing that URI as part of the Share panel alongside the existing geo: URI, but that needs to be a separate issue. Otherwise, it probably wouldn’t be very useful for this site to unilaterally accept grid reference geo: URIs that no one else produces yet, so there’s some groundwork to do outside of this project. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/1807#issuecomment-2867089812 You are receiving this because you commented. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > +# +# Foreign Keys +# +# fk_rails_... (user_id => users.id) +# + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { +:bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}, +:discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)}, +:facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)}, +:github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)}, This isn’t critical. Maybe I’ll open a separate issue for it later on, depending how this overall feature is received. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2081994482 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > +# +# Indexes +# +# index_social_links_on_user_id (user_id) +# +# Foreign Keys +# +# fk_rails_... (user_id => users.id) +# + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { By the way, I think these can be tail work. It could be a good opportunity for someone less involved with the codebase to contribute something small. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2081993571 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@1ec5 commented on this pull request. > + + <% Locale.available + .select { |locale| I18n.exists? "shared.language_selector.#{locale}" } + .sort_by { |locale| t(".#{locale}") } + .each do |locale| %> +><%= t(".#{locale}") %> + <% end %> + [`Intl.DisplayNames.prototype.of()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of) returns undefined if the language code is unrecognized, so we could fall back to the raw code. It only throws an exception on a malformed language code. But if we already have a string that we can access at build time, that would be good too. In that case, we wouldn’t need all those added lines in the YAML file, one for each language… -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r2087048210 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@1ec5 commented on this pull request. > + + <% Locale.available + .select { |locale| I18n.exists? "shared.language_selector.#{locale}" } + .sort_by { |locale| t(".#{locale}") } + .each do |locale| %> +><%= t(".#{locale}") %> + <% end %> + https://translatewiki.net/w/i.php?title=Special:Translations&message=Osm%3ASite.copyright.native.native+link shows that most localizations are correctly translating into their own language, though a few have `THIS_LANGUAGE_NAME_HERE` untranslated. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r2087050998 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@1ec5 commented on this pull request. > + + <% Locale.available + .select { |locale| I18n.exists? "shared.language_selector.#{locale}" } + .sort_by { |locale| t(".#{locale}") } + .each do |locale| %> +><%= t(".#{locale}") %> + <% end %> + Do we need to generate this menu statically? If we can rely on JavaScript to generate the labels, then [`Intl.DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) would save our translators the burden of translating all these language names yet again. (Or you could use the same API to preserve each language’s name for itself.) For example, [here’s how OpenStreetMap Americana](https://github.com/osm-americana/openstreetmap-americana/blob/7fe7232d102e309e2398c719eedcc294220c39cc/src/js/language_label.js#L39-L114) generates its language selector. If JavaScript is disabled or the browser doesn’t support this API, we could fall back to ISO 639 codes or a text field. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#pullrequestreview-2835595164 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] HTTP 500 error on user profile pages (Issue #6023)
1ec5 created an issue (openstreetmap/openstreetmap-website#6023) ### URL https://www.openstreetmap.org/user/Minh%20Nguyen ### How to reproduce the issue? Open certain user profile pages (can’t figure out a pattern yet). ### Screenshot(s) or anything else?  Reproduced so far in: * https://www.openstreetmap.org/user/Minh%20Nguyen * https://www.openstreetmap.org/user/TomH * https://www.openstreetmap.org/user/SomeoneElse * https://www.openstreetmap.org/user/woodpeck * https://www.openstreetmap.org/user/NE2 but not: * https://www.openstreetmap.org/user/Steve * https://www.openstreetmap.org/user/TIGERcnl Reproduces when logged in and logged out. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/6023 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Company Name on Profile Page (PR #5987)
@1ec5 commented on this pull request. > @@ -153,6 +153,14 @@ <%= @user.home_location_name %> <% end %> +<% if @user.company&.strip.present? %> + +http://www.w3.org/2000/svg"; width="16" height="16" fill="currentColor" class="bi bi-suitcase-lg-fill" viewBox="0 0 16 16"> + + + + <%= @user.company %> > Maybe optimistically linking to a matching wiki page could help by giving the > user a way to verify for themselves. For what it’s worth, I think a verification system (whether based on the wiki or backlinks or whatever) can be separate from this PR. The existing reporting system can probably keep things from getting out of hand in the meantime. If we’re concerned about impersonation in the meantime, we could add a tooltip to this box indicating that the company affiliation is self-reported. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5987#pullrequestreview-2852066222 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Company Name on Profile Page (PR #5987)
@1ec5 commented on this pull request. > @@ -153,6 +153,14 @@ <%= @user.home_location_name %> <% end %> +<% if @user.company&.strip.present? %> + +http://www.w3.org/2000/svg"; width="16" height="16" fill="currentColor" class="bi bi-suitcase-lg-fill" viewBox="0 0 16 16"> + Similar to the location item above, the path should have a `title` containing alternative text for accessibility. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5987#pullrequestreview-2852069343 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > +# +# Indexes +# +# index_social_links_on_user_id (user_id) +# +# Foreign Keys +# +# fk_rails_... (user_id => users.id) +# + +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\Ahttps?://.+\z}, :message => :http_parse_error } + + URL_PATTERNS = { Thank you, this looks pretty good. Yeah, OHM definitely needs a more adaptable logo for situations like this, but that’s outside of the PR’s scope. 😉 -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091884846 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@1ec5 commented on this pull request. > +class SocialLink < ApplicationRecord + belongs_to :user + + validates :url, :format => { :with => %r{\A(https?://.+|@([a-zA-Z0-9_]+)@([\w\-\.]+))\z}, :message => :http_parse_error } + + URL_PATTERNS = { +:bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}, +:discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)}, +:facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)}, +:flickr => %r{\Ahttps?://(?:www\.)?flickr\.com/people/([a-zA-Z0-9@._-]+)}, +:github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)}, +:gitlab => %r{\Ahttps?://(?:www\.)?gitlab\.com/([a-zA-Z0-9_-]+)}, +:instagram => %r{\Ahttps?://(?:www\.)?instagram\.com/([a-zA-Z0-9._]+)}, +:linkedin => %r{\Ahttps?://(?:www\.)?linkedin\.com/in/([a-zA-Z0-9_-]+)}, +:line => %r{\Ahttps?://(?:www\.)?line\.me/ti/p/([a-zA-Z0-9_-]+)}, +:mastodon => %r{\Ahttps?://(?:(?:www\.)?(mastodon\.social|en\.osm\.town))/([@a-zA-Z0-9_]+)}, Yes, a leading `@` is required. Technically the `@` can still appear inside the handle in order to load a profile remotely from a different server, for example, https://mapstodon.space/@t...@en.osm.town. But I think it’s perfectly fine if we don’t handle that case, since the user should provide a direct URL anyways. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091887989 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add lang attribute to Nominatim results from CJK languages (PR #6079)
@1ec5 commented on this pull request. > @@ -12,6 +14,14 @@ def create # ask nominatim response = fetch_xml(nominatim_reverse_query_url(:format => "xml")) + # add lang attribute for frontend in certain regions + addressparts = response.elements["reversegeocode/addressparts"] + lang = nil + if addressparts +region_code = addressparts.elements["ISO3166-2-lvl3"]&.text == "CN-HK" ? "hk" : addressparts.elements["country_code"]&.text +lang = region_code ? LANGUAGE_CODES[region_code] : nil Does this assume the displayed name is always in Chinese if the result is from China? That could result in suboptimal font selection and unexpected screen reader behavior if the name is in a different language due to the interface language. Based on `extratags`, could we determine whether the display name is based on one of the preferred interface languages or falling back to `name=*`? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6079#pullrequestreview-2886672465 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Make "W" in osm wiki social icon more readable (PR #6065)
1ec5 left a comment (openstreetmap/openstreetmap-website#6065) And with my wiki hat on, the difference is very minor with the low contrast. I don’t expect this small deviation from the wiki’s current full-size logo to be a problem. For those who squint, it’s just a little more legible, so it can’t hurt. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6065#issuecomment-2923855702 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Use only differences to OSM logo in internal social link icons (PR #6072)
1ec5 left a comment (openstreetmap/openstreetmap-website#6072) What if we reduce the OHM icon to the outline of the map with the H centered inside of it, similar to [the Public Domain Map logo](https://commons.wikimedia.org/wiki/File:Public_Domain_Map_logo.svg)? This would just be an icon anyways, not necessarily the project’s official logo (which obviously needs work). The wiki icon could be something similar with a W, not sure about the others. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6072#issuecomment-2950101341 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add hide/show selection for contribution heatmap on edit profile page (PR #5853)
1ec5 left a comment (openstreetmap/openstreetmap-website#5853) > Has there been any policy decision yet? By the way, I think this is in reference to the question in https://github.com/openstreetmap/openstreetmap-website/pull/5706#issuecomment-2744397402 about whether the terms of service apply to everyone automatically or only those who’ve affirmatively checked a box on the website. We’re still waiting for the outcome of that discussion. In other tickets, there was also a discussion about whether hiding the heatmap would disadvantage other users who need to inspect contribution history to weed out misuse. Regardless, do we anticipate that the website will ultimately have an option to show or hide the heatmap? We could always fine-tune the behavior tied to this option later based on either discussion. (For example: “Display a heatmap of your contributions on your profile page to eligible logged-in users.”) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5853#issuecomment-2956198714 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
1ec5 left a comment (openstreetmap/openstreetmap-website#6127) > Copy and pasting certainly isn't the way we want to be interacting with an > upstream repository... If this becomes a built-in feature, I assume it would obviate the Chrome and Firefox plugins, right @ZeLonewolf? So probably no need to keep them in sync. > Obviously a strong point, but I'd say right now Wikimedia has more OSM > integration as the other way around. Another way of looking at it is that editors like iD have long had this same functionality. Obviously a different set of consequences for any downtime, but some mappers would probably appreciate seeing the same kind of preview that they do while editing, as with the color swatches for `colour=*` and such. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#issuecomment-2997166190 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)
1ec5 left a comment (openstreetmap/openstreetmap-website#5769) > Or we could leave it as an absolute timestamp and rely on JavaScript to > relativize it on the fly. Another advantage of client-side relative dates is that we can make them update dynamically as you’re viewing the page. For example, on this page (and also on the wiki if you have the Comments in Local Time gadget installed), the time on a recent comment updates live. However, a timestamp younger than a minute or older than than a week remains as an absolute date, so that the user doesn’t have to do the math in their head. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2920723208 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Make "W" in osm wiki social icon more readable (PR #6065)
1ec5 left a comment (openstreetmap/openstreetmap-website#6065) > It is the logo in the wiki, idk why it isn't the favicon. Tracking in openstreetmap/operations#1245. > @1ec5 was involved in the discussion about it not showing up in the vector > 2022 skin. In [that discussion](https://wiki.openstreetmap.org/wiki/Talk:Wiki#Wordmark_in_Vector_New_version), I think we were going for a logo plus a wordmark, so there wasn’t as much need to deface the logo more legibly. For the social media bar, I wonder if we even need to repeat the OSM logo motif on OSM-internal sites. Maybe we could just use a generic 📝 icon or something for the wiki, 💬 for the forum, etc., in the same stroked style as the 🌐 for unrecognized websites. > Though the label is just "iki" and the W has a label of "W" which seems quite > silly so may something added that automatically? Huh, that’s cute. Inkscape automatically adds a `` when you convert text to paths, but some other tool might add `aria-title`. I’m not confident that any screen reader will actually do anything with this label, since it’s embedded inside an `` tag (with `osm_wiki` as the alt text). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6065#issuecomment-2923348520 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Make "W" in osm wiki social icon more readable (PR #6065)
1ec5 left a comment (openstreetmap/openstreetmap-website#6065) Something like an ⌛ or 🕐 or just an **H**? Otherwise, with my OHM hat on, I’d say you can do whatever you want with the OHM logo, such as recoloring it to sepia or defacing it with a spike to represent abandoned railways. (For what it’s worth, the project is formally if indirectly affiliated to OSM. Otherwise OHM wouldn’t be allowed to use anything resembling the OSM logo. But this situation is a great example of why OHM needs a new logo.) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6065#issuecomment-2923493824 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Can't see the itinerary's duration (Issue #6094)
1ec5 left a comment (openstreetmap/openstreetmap-website#6094) Finnish, French, Guadaloupean Creole, and Punjab have long translations for [km](https://translatewiki.net/wiki/Special:Translations?message=Osm%3ADirections.show.button+km&namespace=1222) and/or [mi](https://translatewiki.net/wiki/Special:Translations?message=Osm%3ADirections.show.button+mi&namespace=1222). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/6094#issuecomment-2965124137 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] use JOSM/tag2link to linkify tag values (PR #6197)
1ec5 left a comment (openstreetmap/openstreetmap-website#6197) Or at least preferring `osmwiki:P8` and `wikidata:P1630` as sources before falling back to `wikidata:P3303`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6197#issuecomment-3084722278 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Remove u-turn side decision (PR #5777)
1ec5 left a comment (openstreetmap/openstreetmap-website#5777) I contacted the FOSSGIS routing server’s e-mail address to ask them to look into the missing parameter when running `osrm-extract`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5777#issuecomment-3093218990 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Move Intl.DisplayNames inside renderWikidataResponse (PR #6208)
@1ec5 approved this pull request. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6208#pullrequestreview-3035481036 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Support configurable coordinate format (lat, lon vs lon, lat) when displaying addresses (Issue #6165)
1ec5 left a comment (openstreetmap/openstreetmap-website#6165) > This would make copying coordinates into development tools and code snippets > much more convenient and reduce confusion or errors. If one of the internal result’s labels is just regurgitating what the user entered into the search bar, it seems unlikely to me that the user would be interested in copying the label. For what it’s worth, iD’s Measurement panel is intended for copying, so it does show coordinates in two different formats: decimal and DMS, [always putting the latitude first](https://github.com/openstreetmap/iD/blob/f5b82daf24de0bbc01bea2f82bc7a55596403a97/modules/util/units.js#L180-L185). https://github.com/user-attachments/assets/7326a4b6-25ca-41a9-8de6-a248b3d8d3ac"; width="250" alt="Location: 39°16′58″N, 84°17′7″W; 39.2826582, -84.2851886"> For search input, openstreetmap/iD#10805 added a few formats that are rather specific to OSM, just for convenience when copy-pasting URL fragments and such. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/6165#issuecomment-3033405275 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) OK, that’s fair. I do see a lot of second- and third-party Wikidata tools labeling links like “Wikipedia [es]” as well, with the language code wrapped in an `` tag that provides a tooltip for the human-readable language name. We don’t have any precedent for that in this codebase as far as I know, but personally I find it self-explanatory. On that note, we should probably surround any foreign-language text with an element that specifies a `lang=` attribute for proper font selection and screen reader support. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2186117806 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Please help with pull requests! (Issue #3815)
1ec5 left a comment (openstreetmap/openstreetmap-website#3815) > A big part of that, I think, comes down to differing review criteria between > contributors and maintainers. That’s fair to some extent, but it becomes > frustrating when a maintainer fast-tracks their PR that renders an earlier, > unreviewed PR obsolete — without any discussion or acknowledgment of the > overlap. It feels dismissive to those who spent time contributing and > reviewing. I haven’t been closely following this repository as long as you, but I didn’t notice a “queue” pattern that skips what contributors are working on. The closest thing would be that we were trying to respond to Microsoft’s contributions while we had their attention. You have quite a few PRs open, so it must be frustrating to have to juggle them all, keeping them all up to date with the master branch as it changes. Would you be interested in self-triaging these PRs, commenting on them to point out which ones are more fragile (difficult to keep in sync) or which ones need to be staged first? Or I could take a look and make an educated guess… > No, but going out of their way to submit a compact PR that is easily > reviewable (and mergeable - not self-merge though) to undermine a PR, forcing > their point with a necessary rebase rather than simply having a discussion. Would you mind elaborating on the situation on your PR or privately, so we can figure out how to handle it better next time without calling anyone out in this pinned issue? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/3815#issuecomment-3058535926 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Can we avoid inlining svgs into erb templates? (Issue #5880)
1ec5 left a comment (openstreetmap/openstreetmap-website#5880) Pardon my ignorance, but could someone remind me why we wound up using inline SVGs all over in the first place? Was there a particular benefit we were aiming for, or is it just convenient? I see some potential tangible benefits of separate source files: * We can visually inspect any changes to the image directly inside GitHub’s code review interface, just as with a PNG or JPEG. @tomhughes [doesn’t know much about SVG](https://github.com/openstreetmap/openstreetmap-website/pull/5884#issuecomment-2898778060), but he should be able to take one look at the change and tell whether it’s going to change the image size, mess with its colors, or introduce esoteric syntax that popular SVG renderers will mangle. * We could more easily integrate something like [SVGO](https://svgo.dev/) to lint and optimize the SVG, minimizing the things the reviewer would have to nitpick about more manually. * It would promote reuse. Projects like iD have seen their icons get reused in other projects because it’s easier to find and extract them from the project. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5880#issuecomment-3063135535 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) The superscript suffix style probably comes from Wikidata’s former practice of glossing any fallback label with its fallback language, for example, “openstreetmap-website English” when you view [Q115259353](https://www.wikidata.org/wiki/Q115259353) in a language other than English. Otherwise, a user might not easily intuit that a suffix like “enwiki” means the title came from the English Wikipedia. > +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + > "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) +.append($("") + .attr("href", `https://${data.article.site.slice(0, -4)}.wikipedia.org/wiki/` + encodeURIComponent(data.article.title)) The Wikidata API can return the item’s label in the relevant language. I think the label would be more relevant to OSM than the Wikipedia article, which often contains disambiguators and substitute characters for technical reasons. The label is designed to pair well with the description, which we’re using below. (Ideally, we’d fall back to the `mul` code to improve language coverage: ZeLonewolf/osm-wikidata-greasemonkey#9.) If the idea is that the Wikidata item is already linked above, maybe we could link the label to the Wikidata item redundantly, then have a separate Wikipedia link right after it, reusing app/assets/images/social_link_icons/wikipedia.svg. > +items + .filter(qid => entities[qid]) + .map(qid => getLocalizedResponse(entities[qid])) + .filter(data => data.label || data.icon || data.description || data.article) + .map(data => renderWikidataResponse(data, $btn)) + ); + }) + .catch(() => $btn.removeClass("disabled").addClass("wdt-preview")); + } + + function getLocalizedResponse(entity) { +const localizedProperty = (property, langs) => langs.reduce((out, lang) => out ?? entity[property][lang], null); +const data = { + qid: entity.id, + label: localizedProperty("labels", langs)?.value, + icon: ["P8972", "P154", "P14"].reduce((out, prop) => out ?? entity.claims[prop]?.[0]?.mainsnak?.datavalue?.value, null), For reference: * [small logo or icon (P8972)](https://www.wikidata.org/wiki/Property:P8972) * [logo image (P154)](https://www.wikidata.org/wiki/Property:P154) * [traffic sign (P14)](https://www.wikidata.org/wiki/Property:P14) P14 surprised me at first, but then I remembered that this would probably result in displaying a route marker alongside a `wikidata=*` tag when viewing a route relation. That does make some sense to me. > +items + .filter(qid => entities[qid]) + .map(qid => getLocalizedResponse(entities[qid])) + .filter(data => data.label || data.icon || data.description || data.article) + .map(data => renderWikidataResponse(data, $btn)) + ); + }) + .catch(() => $btn.removeClass("disabled").addClass("wdt-preview")); + } + + function getLocalizedResponse(entity) { +const localizedProperty = (property, langs) => langs.reduce((out, lang) => out ?? entity[property][lang], null); +const data = { + qid: entity.id, + label: localizedProperty("labels", langs)?.value, + icon: ["P8972", "P154", "P14"].reduce((out, prop) => out ?? entity.claims[prop]?.[0]?.mainsnak?.datavalue?.value, null), In case the item has multiple statements associated with one of these properties, the `claims[prop]` array will contain multiple items, but the first one isn’t guaranteed to be the best. For example, [Deutsche Post (Q157645)](https://www.wikidata.org/wiki/Q157645#P154) has four different P154 statements. The last is the most current, so the `mainsnak` has a `rank` of `preferred` rather than `normal`. > + label: localizedProperty("labels", langs)?.value, + icon: ["P8972", "P154", "P14"].reduce((out, prop) => out ?? entity.claims[prop]?.[0]?.mainsnak?.datavalue?.value, null), + description: localizedProperty("descriptions", langs)?.value, + article: localizedPr
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + icon: ["P8972", "P154", "P14"].reduce((out, prop) => out ?? > entity.claims[prop]?.[0]?.mainsnak?.datavalue?.value, null), + description: localizedProperty("descriptions", langs)?.value, + article: localizedProperty("sitelinks", wikis) +}; +return data; + } + + function renderWikidataResponse(data, $btn) { +const cell = $("") + .attr("colspan", 2) + .addClass("bg-body-tertiary"); + +if (data.icon && OSM.WIKIMEDIA_COMMONS_URL) { + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) > Did Wikimedia ever reacted to how we use their images in iD, or was it just > in wiki? Or are they already rate-limiting us in iD too but it's not very > noticeabe because images are small? Only on the wiki, because the requests to Wikimedia Commons are centralized through the wiki’s server. This client-side usage is different in that each individual user will request only the images they’re interested in. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2183556357 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Allow to agree to new terms if already agreed to old terms (PR #5706)
@1ec5 commented on this pull request. > not_agreed_with_pd: "You haven't declared that you consider your > edits to be in the Public Domain." -pd_link_text: "declare" +review: "Review the Terms" +review_and_accept: "Review and accept the Terms" +consider_pd: "Consider Public Domain" + terms_of_use: +heading: "Terms of Use" +agreed: "You have agreed to the Terms of Use on %{date}." Minor grammatical nit (also above): ```suggestion agreed: "You agreed to the Terms of Use on %{date}." ``` -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5706#pullrequestreview-2983456736 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Allow to agree to new terms if already agreed to old terms (PR #5706)
@1ec5 approved this pull request. The logic looks correct to me. Just to confirm, does this PR result in actively presenting pre-2019 users with some sort of notice about the new terms, without having to visit the account settings first? If not, we still need to do that as tail work based on the decision at last month’s LWG meeting. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5706#pullrequestreview-2983655979 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) I guess that works, though I’m not sure it’s necessary to qualify the Wikipedia link with the language, since the URL already hints at the language. The main reason Wikidata appends the language name to labels is to avoid confusion when different languages have false cognates and such, but this isn’t a risk for a link with a fixed label or icon. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2184586554 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + encodeURIComponent(data.icon)) +.append($("").attr({ src, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + const lang = data.article.site.slice(0, -4); I think this is fine, since lots of Wikimedia-related software makes the same assumption. It just needs a comment explaining the magic number −4. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2184073867 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) I guess I was thinking of something like this (for English), based on how Wikidata formats labels on its own site: * [Bench](https://www.wikidata.org/wiki/Q816714) ([Wikipedia](https://en.wikipedia.org/wiki/Bench_(British_clothing_brand))) * [Shell](https://www.wikidata.org/wiki/Q110716465) * [Q111384397](https://www.wikidata.org/wiki/Q111384397) The QID would be redundant to what’s in the normal tag view, though… -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2184105261 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > @@ -1,10 +1,16 @@ (function () { + let abortController = null; + const langs = [...new Set([...OSM.preferred_languages.map(l => l.toLowerCase()), "mul", "en"])]; + const wikis = [...new Set(langs.map(l => l.split("-")[0] + "wiki"))]; Wikimedia wiki codes don’t quite conform to ISO 639. For example, the response will include `be_x_oldwiki` for what this repository calls `be-Tarask`. But this will affect only a handful of locales that we have localizations for, so it probably isn’t critical. > @@ -101,4 +110,97 @@ scrollableList.scrollLeft = scrollableList.scrollWidth - scrollableList.offsetWidth; } } + + function previewWikidataValue($btn) { +if (!OSM.WIKIDATA_API_URL) return; +const items = $btn.data("qids"); +if (!items?.length) return; +$btn.addClass("disabled").removeClass("wdt-preview"); +fetch(OSM.WIKIDATA_API_URL + "?" + new URLSearchParams({ + action: "wbgetentities", + format: "json", + origin: "*", + ids: items.join("|"), + props: "labels|sitelinks|claims|descriptions", We can request `sitelinks/urls` here, so that each object in `sitelinks` will contain a `url` property set to the absolute URL to the article. > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + encodeURIComponent(data.icon)) +.append($("").attr({ src, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + const lang = data.article.site.slice(0, -4); Is this trimming “wiki” from the end of the sitename? > + $("") +.attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon) +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) This feature hooks into something labeled `wikidata` with a Wikidata icon, so there should probably be an explicit reference to Wikipedia to counter the assumption that the link goes to Wikidata. The reference to Wikipedia would be more relevant than the language name, since most of the time it’s going to be the user’s preferred language anyways. If we don’t want to bother with a Wikipedia icon, “(Wikipedia)” in regular text would communicate the link target pretty well. > +.append($("").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + > "Special:FilePath/" + data.icon, height: "32" })) +.addClass("float-end mb-1 ms-2") +.appendTo(cell); +} +if (data.label) { + $btn +.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`) +.clone() +.text(data.label) +.addClass("me-1") +.appendTo(cell); +} +if (data.article) { + $(`<${data.label ? "sup" : "div"}>`) +.append($("") + .attr("href", `https://${data.article.site.slice(0, -4)}.wikipedia.org/wiki/` + encodeURIComponent(data.article.title)) Oh, I think I misread this part of the diff. I didn’t realize we’re always showing the label if available, followed by the superscript link to Wikipedia. I thought it was all one link based on an earlier screenshot. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-2984838528 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Stop Commons from redirecting outside CSP (PR #6202)
@1ec5 commented on this pull request. This is another subtle difference between Special:Redirect and the MediaWiki API, which is why the initial request for the item details doesn’t run into this problem. > @@ -171,8 +171,8 @@ .addClass("bg-body-tertiary"); if (icon && OSM.WIKIMEDIA_COMMONS_URL) { - let src = OSM.WIKIMEDIA_COMMONS_URL + "Special:Redirect/file/" + encodeURIComponent(icon); - if (!icon.endsWith(".svg")) src += "?width=128"; + let src = OSM.WIKIMEDIA_COMMONS_URL + "Special:Redirect/file/" + encodeURIComponent(icon) + "?mobileaction=toggle_view_desktop"; In cursory testing, this doesn’t cause subsequent user-initiated page loads on Commons to switch back to desktop view, which is good. Still a bit counterintuitive in this code, so a comment explaining the parameter would be a good idea. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6202#pullrequestreview-3031368828 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add Cross-Origin-Opener-Policy header (2ff4d6a)
A fix is pending in facebook/Rapid#1724. See the temporary workaround at https://github.com/facebook/Rapid/issues/1722#issuecomment-3060409827. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/commit/2ff4d6a4e633e479568572090eb6a16074103cd9#commitcomment-162322980 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
@1ec5 commented on this pull request. > @@ -1,10 +1,18 @@ (function () { + let abortController = null; + const languagesToRequest = [...new Set([...OSM.preferred_languages.map(l => l.toLowerCase()), "mul", "en"])]; @lucaswerkmeister [suggested](https://wikis.world/@LucasWerkmeister/114876146945706671) passing in `languagefallback=1` instead of manually requesting a list of languages. I believe it would cause the response to use MediaWiki’s internal [language fallback chain](https://meta.wikimedia.org/wiki/Wikidata/Notes/Language_fallback) rather than the OSM setting or browser setting. @hlfan would it be a better match for the intended behavior here? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-3039419713 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Including the smooth-zoom of the Qwant-map (#2283)
1ec5 left a comment (openstreetmap/openstreetmap-website#2283) As explained in https://github.com/openstreetmap/openstreetmap-website/issues/2283#issuecomment-506391221, the lack of smooth zooming is just a symptom of using Leaflet. We’re still using Leaflet, only with MapLibre GL JS drawing off-screen behind the scenes and relying on the [maplibre-gl-leaflet](https://github.com/maplibre/maplibre-gl-leaflet/) plugin as a compatibility shim. #2686 and gravitystorm/openstreetmap-website#289 discuss migrating to MapLibre GL JS for real. We aren’t going to migrate to [Erdapfel](https://github.com/Qwant/erdapfel/) as implied by the original post, so we should track any migration to GL JS in a separate issue rather than this one. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/2283#issuecomment-3104898458 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Shortbread vector tiles >=z24 causes strange panning behavior (Issue #6222)
1ec5 left a comment (openstreetmap/openstreetmap-website#6222) Possibly related to maplibre/maplibre-gl-leaflet#73. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/6222#issuecomment-3105082844 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev