@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/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev