From a35b71f68f86f66a243fb7eac0a9b8542d5389f5 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 27 Feb 2020 21:33:03 +0100 Subject: [PATCH] Proper inflection for de and nl --- Gemfile.lock | 4 ++-- app/views/layouts/application.html.haml | 2 +- app/views/moderations/index.html.haml | 4 ++-- app/views/orgas/_aside.html.haml | 4 ++-- app/views/tags/_aside.html.haml | 2 +- config/initializers/inflections.rb | 7 +++++-- config/locales/models/de.yml | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b4bd423d..1130878d 100644 --- a/Gemfile.lock +++ b/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) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 41167c3a..f85705e0 100644 --- a/app/views/layouts/application.html.haml +++ b/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' diff --git a/app/views/moderations/index.html.haml b/app/views/moderations/index.html.haml index 6b676573..810299a7 100644 --- a/app/views/moderations/index.html.haml +++ b/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 diff --git a/app/views/orgas/_aside.html.haml b/app/views/orgas/_aside.html.haml index 07554f57..63cfa6a0 100644 --- a/app/views/orgas/_aside.html.haml +++ b/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 diff --git a/app/views/tags/_aside.html.haml b/app/views/tags/_aside.html.haml index 4aba9a1a..d83d2812 100644 --- a/app/views/tags/_aside.html.haml +++ b/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 diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 017a5bb6..89ef0fcd 100644 --- a/config/initializers/inflections.rb +++ b/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: diff --git a/config/locales/models/de.yml b/config/locales/models/de.yml index a21c20ec..32cb3b4a 100644 --- a/config/locales/models/de.yml +++ b/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