[openstreetmap/openstreetmap-website] include iD as npm package (PR #6565)

Pablo Brasero notifications at github.com
Wed Nov 26 14:22:22 UTC 2025


@pablobm commented on this pull request.



> @@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module ID
-  LOCALES = Locale.list(Rails.root.join("vendor/assets/iD/iD/locales").entries.filter_map { |p| p.basename.to_s[/(.*)\.min\.json/] && Regexp.last_match(1) })
+  LOCALES = Locale.list(Rails.root.join("node_modules/@openstreetmap/id/dist/locales").entries.filter_map { |p| p.basename.to_s[/(.*)\.min\.json/] && Regexp.last_match(1) })

I know this is just the same what was there before but, since we are at it, I think it's a good opportunity to refactor this a bit:

```suggestion
  ID_PATH = Rails.root.join("node_modules/@openstreetmap/id")
  LOCALES = Locale.list(Rails.root.join(ID_PATH, "dist/locales").entries.filter_map { |p| p.basename.to_s[/(.*)\.min\.json/] && Regexp.last_match(1) })
```

I would go further than that, and perhaps will, but for the purposes of this PR I think this would be sufficient.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6565#pullrequestreview-3511205977
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6565/review/3511205977 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251126/7373aef6/attachment.htm>


More information about the rails-dev mailing list