Make the preset list at the bottom of the screen (Airport, Bus stop,
...) translatable
This commit is contained in:
parent
9e72ed0d20
commit
cc9a9ee399
4 changed files with 61 additions and 30 deletions
|
@ -232,6 +232,12 @@ class AmfController < ApplicationController
|
||||||
help = localised["help_html"]
|
help = localised["help_html"]
|
||||||
localised.delete("help_html")
|
localised.delete("help_html")
|
||||||
|
|
||||||
|
# Populate icon names
|
||||||
|
POTLATCH_PRESETS[10].each { |id|
|
||||||
|
POTLATCH_PRESETS[11][id] = localised["preset_icon_#{id}"]
|
||||||
|
localised.delete("preset_icon_#{id}")
|
||||||
|
}
|
||||||
|
|
||||||
return POTLATCH_PRESETS+[localised,help]
|
return POTLATCH_PRESETS+[localised,help]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
airport Airport amenity=airport
|
airport amenity=airport
|
||||||
bus_stop Bus stop highway=bus_stop
|
bus_stop highway=bus_stop
|
||||||
ferry_terminal Ferry amenity=ferry_terminal
|
ferry_terminal amenity=ferry_terminal
|
||||||
parking Parking amenity=parking
|
parking amenity=parking
|
||||||
station Rail station railway=station
|
station railway=station
|
||||||
taxi Taxi rank amenity=taxi
|
taxi amenity=taxi
|
||||||
bar Bar amenity=bar
|
bar amenity=bar
|
||||||
cafe Cafe amenity=cafe
|
cafe amenity=cafe
|
||||||
cinema Cinema amenity=cinema
|
cinema amenity=cinema
|
||||||
fast_food Fast food amenity=fast_food
|
fast_food amenity=fast_food
|
||||||
pub Pub amenity=pub
|
pub amenity=pub
|
||||||
restaurant Restaurant amenity=restaurant
|
restaurant amenity=restaurant
|
||||||
theatre Theatre amenity=theatre
|
theatre amenity=theatre
|
||||||
convenience Convenience shop shop=convenience
|
convenience shop=convenience
|
||||||
hotel Hotel tourism=hotel
|
hotel tourism=hotel
|
||||||
pharmacy Pharmacy amenity=pharmacy
|
pharmacy amenity=pharmacy
|
||||||
post_box Postbox amenity=post_box
|
post_box amenity=post_box
|
||||||
recycling Recycling amenity=recycling
|
recycling amenity=recycling
|
||||||
supermarket Supermarket shop=supermarket
|
supermarket shop=supermarket
|
||||||
telephone Telephone amenity=telephone
|
telephone amenity=telephone
|
||||||
fire_station Fire station amenity=fire_station
|
fire_station amenity=fire_station
|
||||||
hospital Hospital amenity=hospital
|
hospital amenity=hospital
|
||||||
police Police station amenity=police
|
police amenity=police
|
||||||
place_of_worship Place of worship amenity=place_of_worship
|
place_of_worship amenity=place_of_worship
|
||||||
museum Museum tourism=museum
|
museum tourism=museum
|
||||||
school School amenity=school
|
school amenity=school
|
||||||
|
|
|
@ -145,3 +145,29 @@ en:
|
||||||
tip_undo: Undo $1 (Z)
|
tip_undo: Undo $1 (Z)
|
||||||
uploading: Uploading...
|
uploading: Uploading...
|
||||||
way: Way
|
way: Way
|
||||||
|
preset_icon_school: School
|
||||||
|
preset_icon_restaurant: Restaurant
|
||||||
|
preset_icon_station: Rail station
|
||||||
|
preset_icon_airport: Airport
|
||||||
|
preset_icon_police: Police station
|
||||||
|
preset_icon_pharmacy: Pharmacy
|
||||||
|
preset_icon_fast_food: Fast food
|
||||||
|
preset_icon_fire_station: Fire station
|
||||||
|
preset_icon_hotel: Hotel
|
||||||
|
preset_icon_supermarket: Supermarket
|
||||||
|
preset_icon_post_box: Postbox
|
||||||
|
preset_icon_theatre: Theatre
|
||||||
|
preset_icon_ferry_terminal: Ferry
|
||||||
|
preset_icon_bus_stop: Bus stop
|
||||||
|
preset_icon_hospital: Hospital
|
||||||
|
preset_icon_convenience: Convenience shop
|
||||||
|
preset_icon_parking: Parking
|
||||||
|
preset_icon_recycling: Recycling
|
||||||
|
preset_icon_pub: Pub
|
||||||
|
preset_icon_cafe: Cafe
|
||||||
|
preset_icon_telephone: Telephone
|
||||||
|
preset_icon_cinema: Cinema
|
||||||
|
preset_icon_bar: Bar
|
||||||
|
preset_icon_museum: Museum
|
||||||
|
preset_icon_place_of_worship: Place of worship
|
||||||
|
preset_icon_taxi: Taxi rank
|
||||||
|
|
|
@ -187,12 +187,11 @@ module Potlatch
|
||||||
end
|
end
|
||||||
|
|
||||||
# Read POI presets
|
# Read POI presets
|
||||||
icon_list=[]; icon_names={}; icon_tags={};
|
icon_list=[]; icon_tags={};
|
||||||
File.open("#{RAILS_ROOT}/config/potlatch/icon_presets.txt") do |file|
|
File.open("#{RAILS_ROOT}/config/potlatch/icon_presets.txt") do |file|
|
||||||
file.each_line {|line|
|
file.each_line {|line|
|
||||||
(icon,name,tags)=line.chomp.split("\t")
|
(icon,tags)=line.chomp.split("\t")
|
||||||
icon_list.push(icon)
|
icon_list.push(icon)
|
||||||
icon_names[icon]=name
|
|
||||||
icon_tags[icon]=Hash[*tags.scan(/([^;=]+)=([^;=]+)/).flatten]
|
icon_tags[icon]=Hash[*tags.scan(/([^;=]+)=([^;=]+)/).flatten]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -211,7 +210,7 @@ module Potlatch
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
[presets,presetmenus,presetnames,colours,casing,areas,autotags,relcolours,relalphas,relwidths,icon_list,icon_names,icon_tags]
|
[presets,presetmenus,presetnames,colours,casing,areas,autotags,relcolours,relalphas,relwidths,icon_list,nil,icon_tags]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue