Browse Source

Proper inflection for de and nl

remotes/origin/master
echarp 2 years ago
parent
commit
a35b71f68f
  1. 4
      Gemfile.lock
  2. 2
      app/views/layouts/application.html.haml
  3. 4
      app/views/moderations/index.html.haml
  4. 4
      app/views/orgas/_aside.html.haml
  5. 2
      app/views/tags/_aside.html.haml
  6. 7
      config/initializers/inflections.rb
  7. 2
      config/locales/models/de.yml

4
Gemfile.lock

@ -289,7 +289,7 @@ GEM
activerecord (>= 4.2)
request_store (~> 1.1)
parallel (1.19.1)
parser (2.7.0.2)
parser (2.7.0.3)
ast (~> 2.4.0)
piwik_analytics (1.0.2)
actionpack
@ -303,7 +303,7 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (4.0.3)
puma (4.3.1)
puma (4.3.2)
nio4r (~> 2.0)
rack (2.2.2)
rack-livereload (0.3.17)

2
app/views/layouts/application.html.haml

@ -47,7 +47,7 @@
= t '.tags'
= link_to orgas_path do
%em.fa.fa-users
= Orga.model_name.human.pluralize
= Orga.model_name.human.pluralize I18n.locale
= link_to versions_path do
%em.fa.fa-history
= t 'versions.index.title'

4
app/views/moderations/index.html.haml

@ -9,7 +9,7 @@
%th(colspan='8')
%h3
%em.fa.fa-users
= Orga.model_name.human.pluralize @orgas.count
= Orga.model_name.human.pluralize @orgas.count, I18n.locale
- @orgas.group_by { |orga| orga.region.flag }.each do |code, orgas|
%thead
@ -46,7 +46,7 @@
%th(colspan='8')
%h3
%em.fa.fa-calendar
= Event.model_name.human.pluralize @events.count
= Event.model_name.human.pluralize @events.count, I18n.locale
- @events.group_by { |event| event.region.flag }.each do |code, events|
%thead

4
app/views/orgas/_aside.html.haml

@ -7,11 +7,11 @@
%li
= link_to orgas_path q: params[:q], page: params[:page] do
%em.fa.fa-li.fa-arrow-left
= Orga.model_name.human.pluralize
= Orga.model_name.human.pluralize I18n.locale
%li
= link_to tag_path @orga.name_as_tag do
%em.fa.fa-li.fa-tag
= Event.model_name.human.pluralize
= Event.model_name.human.pluralize I18n.locale
%li
= link_to events_path tag: @orga.name_as_tag do
%em.fa.fa-li.fa-calendar

2
app/views/tags/_aside.html.haml

@ -3,7 +3,7 @@
%h2
= link_to orgas_path do
%em.fa.fa-users
= Orga.model_name.human.pluralize
= Orga.model_name.human.pluralize I18n.locale
%ul.fa-ul
- @orgas.each do |orga|
%li

7
config/initializers/inflections.rb

@ -11,11 +11,14 @@
# end
ActiveSupport::Inflector.inflections(:de) do |inflect|
inflect.plural 'veranstaltung', 'veranstaltungen'
inflect.plural 'Evenement', 'Evenementen'
inflect.plural 'Veranstaltung', 'Veranstaltungen'
inflect.plural 'Organisatie', 'Organisatien'
end
ActiveSupport::Inflector.inflections(:nl) do |inflect|
inflect.plural 'evenement', 'evenementen'
inflect.plural 'Evenement', 'Evenementen'
inflect.plural 'Organisatie', 'Organisaties'
end
# These inflection rules are supported but not enabled by default:

2
config/locales/models/de.yml

@ -17,7 +17,7 @@ de:
models:
event: Veranstaltung
user: Moderator
orga: Orga
orga: Organisatie
kind: Typ
city: Stadt
region: Region

Loading…
Cancel
Save