All region names are now translated

This commit is contained in:
echarp 2019-04-29 18:29:38 +02:00
parent ec3820ca30
commit e8b284fddc
14 changed files with 49 additions and 35 deletions

View File

@ -10,8 +10,9 @@ header.calendar-header
em.locality.fa
color: gray
span.city:after, strong.city:after, em.city:after
strong.city:after, em.city:after
content: ':'
margin-left: 0.25em
p.full_address
span:after

View File

@ -1,4 +1,4 @@
.finePre, .city:after, span.label:after
.finePre, span.label:after
margin-left: 0.25em
.finePost
margin-right: 0.25em

View File

@ -31,7 +31,7 @@
= month_calendar events: @events do |date, events|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul= render partial: :event, collection: events, cached: true
%ul.events.fa-ul= render events
.links
= raw t '.calendar_in',

View File

@ -26,8 +26,11 @@ xml.rdf :RDF,
'xmlns:georss' => 'http://www.georss.org/georss' do
xml.channel 'rdf:about' => root_url do
title = t 'layouts.application.title'
region = Region.find_by id: session[:region]
title += " [#{region.name}]" if region
region = Region.find_by id: params[:region]
if region.present?
title += " - #{t(region.code.presence ? region.code : region.name,
scope: :countries, default: region.name)}"
end
xml.title title
xml.description t 'layouts.application.subtitle'
xml.link root_url

View File

@ -18,13 +18,13 @@
%p.full_address
- if @event.place_name.present?
%span= @event.place_name
%span.place_name= @event.place_name
- if @event.address.present?
%span= @event.address
%span= link_to @event.city,
"https://fr.wikipedia.org/wiki/#{url_encode @event.city}"
%span= link_to @event.region.try(:name),
"https://fr.wikipedia.org/wiki/#{url_encode @event.region.try :name}"
%span.address= @event.address
%span.city= @event.city
%span.region
= t @event.region.code.present? ? @event.region.code : @event.region.name,
scope: :countries, default: @event.region.name
- if @event.latitude && @event.longitude
.event#map{ data: { url: maps_path(format: :json),

View File

@ -5,7 +5,7 @@
!= display_attr @event, :place_name
!= display_attr @event, :address
!= display_attr @event, :city
!= display_attr @event, :region, t(@event.region.code, scope: :countries, default: @event.region.name)
!= display_attr @event, :region, t(@event.region.code.present? ? @event.region.code : @event.region.name, scope: :countries, default: @event.region.name)
!= display_attr @event, :locality, t("attributes.locality_#{@event.locality}")
!= display_attr @event, :url
- if @event.contact.present?

View File

@ -1,20 +1,22 @@
json.array!(@events) do |event|
json.array!(@events) do |e|
json.merge!(
type: 'Feature',
properties: {
id: event.id,
name: event.title,
start_time: event.start_time, end_time: event.end_time,
submission_time: event.submission_time,
decision_time: event.decision_time,
place_name: event.place_name, address: event.address, city: event.city,
region: event.region.name, region_id: event.region_id,
tags: event.tag_list,
popupContent: link_to(event, event_url(event))
id: e.id,
name: e.title,
start_time: e.start_time, end_time: e.end_time,
submission_time: e.submission_time,
decision_time: e.decision_time,
place_name: e.place_name, address: e.address, city: e.city,
region: t(e.region.code.presence ? e.region.code : e.region.name,
scope: :countries, default: e.region.name),
region_id: e.region_id,
tags: e.tag_list,
popupContent: link_to(e, event_url(e))
},
geometry: {
type: 'Point',
coordinates: [event.longitude, event.latitude]
coordinates: [e.longitude, e.latitude]
}
)
end

View File

@ -11,13 +11,13 @@
%p.full_address
- if @orga.place_name.present?
%span= @orga.place_name
%span.place_name= @orga.place_name
- if @orga.address.present?
%span= @orga.address
%span= link_to @orga.city,
"https://fr.wikipedia.org/wiki/#{url_encode @orga.city}"
%span= link_to @orga.region.try(:name),
"https://fr.wikipedia.org/wiki/#{url_encode @orga.region.try :name}"
%span.address= @orga.address
%span.city= @orga.city
%span.region
= t @orga.region.code.present? ? @orga.region.code : @orga.region.name,
scope: :countries, default: @orga.region.name
- if @orga.latitude && @orga.longitude
.orga#map{ data: { url: maps_path(format: :json).to_s,

View File

@ -5,7 +5,7 @@
!= display_attr @orga, :address
!= display_attr @orga, :city
!= display_attr @orga, :department
!= display_attr @orga, :region, t(@orga.region.code, scope: :countries, default: @orga.region.name)
!= display_attr @orga, :region, t(@orga.region.code.present? ? @orga.region.code : @orga.region.name, scope: :countries, default: @orga.region.name)
!= display_attr @orga, :url
!= display_attr @orga, :diaspora
!= display_attr @orga, :feed

View File

@ -14,7 +14,7 @@
= t filter_region.code, scope: :countries, default: filter_region.name
- else
%em.fa.fa-shield-alt
= filter_region.name
= t filter_region.name, scope: :countries, default: filter_region.name
- if params[:region] == filter_region.id.to_s
%em.fa.fa-times
- elsif !filter_region.region && filter_region.regions.present?

View File

@ -7,11 +7,12 @@
= t selector_region.code, scope: :countries, default: selector_region.name
- else
%em.fa.fa-map
= selector_region
= t selector_region, scope: :countries, default: selector_region
- if selector_region.regions.present?
%small
%em.fa.fa-chevron-right
- if selector_region.regions.present?
.radios
= f.collection_radio_buttons :region_id,
Region.where(region: selector_region), :id, :name, include_hidden: false
Region.where(region: selector_region), :id, :name, include_hidden: false do |b|
= b.label { b.radio_button + t(b.text, scope: :countries, default: b.text) }

View File

@ -19,7 +19,10 @@
%tbody
- @regions.find_each do |region|
%tr
%td= link_to region.name, events_path(region: region.id)
%td
= link_to events_path(region: region.id) do
= t(region.code.present? ? region.code : region.name,
scope: :countries, default: region.name)
%td= link_to 'RSS', events_path(format: :rss, region: region.id)
%td= link_to :webcal,
events_path(protocol: :webcal, format: :ics, region: region.id,

View File

@ -63,7 +63,8 @@
%tbody
- @regions.each do |region|
%tr
%th.region= region
%th.region= t(region.code.presence ? region.code : region.name,
scope: :countries, default: region.name)
- total = 0
- @years.each do |year|
%td.quantity

View File

@ -0,0 +1,3 @@
nl:
countries:
Bruxelles: Brussels