Skip to content

Commit d4d4739

Browse files
authored
Merge pull request #413 from OpenHistoricalMap/id-bug-plus-test-fixes
Id bug plus test fixes
2 parents fe2f94a + c87f611 commit d4d4739

74 files changed

Lines changed: 1139 additions & 1997 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/controllers/searches/nominatim_queries_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def create
6464
elsif extratag.attributes["key"] == "end_date"
6565
end_date = extratag.attributes['value']
6666
end
67-
end
67+
end unless place.elements["extratags"].nil?
6868
if start_date || end_date
6969
suffix = t "geocoder.search_osm_nominatim.suffix_format", :dates => DateRange.new(start_date, end_date).to_s
7070
end

test/lib/i18n_test.rb

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,60 @@
1+
# frozen_string_literal: true
12
require "test_helper"
23

34
class I18nTest < ActiveSupport::TestCase
45
I18n.available_locales.each do |locale|
5-
test locale.to_s do
6-
without_i18n_exceptions do
7-
# plural_keys = plural_keys(locale)
6+
# OHM variant: upstream does not use the 'qqq' dummy language for documenting messages
7+
unless locale.to_s == 'qqq'
8+
test locale.to_s do
9+
without_i18n_exceptions do
10+
# plural_keys = plural_keys(locale)
811

9-
translation_keys.each do |key|
10-
variables = []
12+
translation_keys.each do |key|
13+
variables = []
1114

12-
default_value = I18n.t(key, :locale => I18n.default_locale)
15+
default_value = I18n.t(key, :locale => I18n.default_locale)
1316

14-
if default_value.is_a?(Hash)
15-
variables.push("count")
17+
if default_value.is_a?(Hash)
18+
variables.push("count")
1619

17-
default_value.each_value do |subvalue|
18-
subvalue.scan(/%\{(\w+)\}/) do
20+
default_value.each_value do |subvalue|
21+
subvalue.scan(/%\{(\w+)\}/) do
22+
variables.push(Regexp.last_match(1))
23+
end
24+
end
25+
else
26+
default_value.scan(/%\{(\w+)\}/) do
1927
variables.push(Regexp.last_match(1))
2028
end
2129
end
22-
else
23-
default_value.scan(/%\{(\w+)\}/) do
24-
variables.push(Regexp.last_match(1))
25-
end
26-
end
2730

28-
variables.push("attribute") if key =~ /^(active(model|record)\.)?errors\./
31+
variables.push("attribute") if key =~ /^(active(model|record)\.)?errors\./
2932

30-
value = I18n.t(key, :locale => locale, :fallback => true)
33+
value = I18n.t(key, :locale => locale, :fallback => true)
3134

32-
if value.is_a?(Hash)
33-
value.each do |subkey, subvalue|
34-
# assert plural_keys.include?(subkey), "#{key}.#{subkey} is not a valid plural key"
35+
if value.is_a?(Hash)
36+
value.each do |subkey, subvalue|
37+
# assert plural_keys.include?(subkey), "#{key}.#{subkey} is not a valid plural key"
3538

36-
next if subvalue.nil?
39+
next if subvalue.nil?
3740

38-
subvalue.scan(/%\{(\w+)\}/) do
39-
assert_includes variables, Regexp.last_match(1), "#{key}.#{subkey} uses unknown interpolation variable #{Regexp.last_match(1)}"
41+
subvalue.scan(/%\{(\w+)\}/) do
42+
assert_includes variables, Regexp.last_match(1), "#{key}.#{subkey} uses unknown interpolation variable #{Regexp.last_match(1)}"
43+
end
4044
end
41-
end
4245

43-
assert_includes value, :other, "#{key}.other plural key missing"
44-
else
45-
assert_kind_of String, value, "#{key} is not a string"
46+
assert_includes value, :other, "#{key}.other plural key missing"
47+
else
48+
assert_kind_of String, value, "#{key} is not a string"
4649

47-
value.scan(/%\{(\w+)\}/) do
48-
assert_includes variables, Regexp.last_match(1), "#{key} uses unknown interpolation variable #{Regexp.last_match(1)}"
50+
value.scan(/%\{(\w+)\}/) do
51+
assert_includes variables, Regexp.last_match(1), "#{key} uses unknown interpolation variable #{Regexp.last_match(1)}"
52+
end
4953
end
5054
end
51-
end
5255

53-
assert_includes %w[ltr rtl], I18n.t("html.dir", :locale => locale), "html.dir must be ltr or rtl"
56+
assert_includes %w[ltr rtl], I18n.t("html.dir", :locale => locale), "html.dir must be ltr or rtl"
57+
end
5458
end
5559
end
5660
end

vendor/assets/iD/iD.css.erb

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@
374374

375375
/* No interactivity except what we specifically allow */
376376
.ideditor .data-layer.osm *,
377-
.ideditor .data-layer.notes *,
378-
.ideditor .data-layer.keepRight * {
377+
.ideditor .data-layer.notes * {
379378
pointer-events: none;
380379
}
381380

@@ -3544,7 +3543,6 @@
35443543
/* OSM Notes and QA Layers */
35453544

35463545
.ideditor .qa-header-icon .qaItem-fill,
3547-
.ideditor .layer-keepRight .qaItem .qaItem-fill,
35483546
.ideditor .layer-osmose .qaItem .qaItem-fill {
35493547
stroke: #333;
35503548
stroke-width: 1.3px; /* NOTE: likely a better way to scale the icon stroke */
@@ -3595,79 +3593,6 @@
35953593
justify-content: center;
35963594
}
35973595

3598-
/* Keep Right Issues
3599-
------------------------------------------------------- */
3600-
.ideditor .keepRight.itemType-20,
3601-
.ideditor .keepRight.itemType-40,
3602-
.ideditor .keepRight.itemType-210,
3603-
.ideditor .keepRight.itemType-270,
3604-
.ideditor .keepRight.itemType-310,
3605-
.ideditor .keepRight.itemType-320,
3606-
.ideditor .keepRight.itemType-350 { /* improper bridge tag */
3607-
color: #ff9;
3608-
}
3609-
3610-
.ideditor .keepRight.itemType-50 { /* almost junctions */
3611-
color: #88f;
3612-
}
3613-
3614-
.ideditor .keepRight.itemType-60,
3615-
.ideditor .keepRight.itemType-70,
3616-
.ideditor .keepRight.itemType-90,
3617-
.ideditor .keepRight.itemType-100,
3618-
.ideditor .keepRight.itemType-110,
3619-
.ideditor .keepRight.itemType-150,
3620-
.ideditor .keepRight.itemType-220,
3621-
.ideditor .keepRight.itemType-380 { /* non-physical sport tag */
3622-
color: #5d0;
3623-
}
3624-
3625-
.ideditor .keepRight.itemType-130 { /* disconnected ways */
3626-
color: #fa3;
3627-
}
3628-
3629-
.ideditor .keepRight.itemType-170 { /* FIXME tag */
3630-
color: #ff0;
3631-
}
3632-
3633-
.ideditor .keepRight.itemType-190 { /* intersection without junction */
3634-
color: #f33;
3635-
}
3636-
3637-
.ideditor .keepRight.itemType-200 { /* overlapping ways */
3638-
color: #fdbf6f;
3639-
}
3640-
3641-
.ideditor .keepRight.itemType-160,
3642-
.ideditor .keepRight.itemType-230 { /* layer conflict */
3643-
color: #b60;
3644-
}
3645-
3646-
.ideditor .keepRight.itemType-280 { /* boundary issues */
3647-
color: #5f47a0;
3648-
}
3649-
3650-
.ideditor .keepRight.itemType-180,
3651-
.ideditor .keepRight.itemType-290 { /* turn restriction issues */
3652-
color: #ace;
3653-
}
3654-
3655-
.ideditor .keepRight.itemType-300,
3656-
.ideditor .keepRight.itemType-390 { /* missing tracktype */
3657-
color: #090;
3658-
}
3659-
3660-
.ideditor .keepRight.itemType-360,
3661-
.ideditor .keepRight.itemType-370,
3662-
.ideditor .keepRight.itemType-410 { /* website issues */
3663-
color: #f9b;
3664-
}
3665-
3666-
.ideditor .keepRight.itemType-120,
3667-
.ideditor .keepRight.itemType-400 { /* geometry / turn angles */
3668-
color: #c35;
3669-
}
3670-
36713596
/* Custom Map Data (geojson, gpx, kml, vector tile) */
36723597
.ideditor .layer-mapdata {
36733598
pointer-events: none;
@@ -6275,11 +6200,8 @@
62756200
user-select: none;
62766201
}
62776202

6278-
.ideditor .restriction-help span {
6279-
margin: 2px;
6280-
}
6281-
62826203
.ideditor .restriction-help .qualifier {
6204+
margin: 2px;
62836205
color: #666;
62846206
font-weight: bold;
62856207
}
@@ -8951,7 +8873,7 @@
89518873
margin-left: 5px;
89528874
}
89538875

8954-
.ideditor .user-list a:not(:last-child):after {
8876+
.ideditor .user-list a:not(:last-of-type):after {
89558877
content: ', ';
89568878
}
89578879

0 commit comments

Comments
 (0)