diff options
| author | Marc Florisson | 2015-02-28 15:12:33 +0100 |
|---|---|---|
| committer | Marc Florisson | 2015-02-28 15:12:33 +0100 |
| commit | b55347596bf7f385c577ce0e28baa755030c4887 (patch) | |
| tree | 0e52b54076732c9bd322e72b005f3352d7e4183f | |
| parent | c06aa8023372e9da4e5674d2dbf9bc02203dd782 (diff) | |
| download | chouette-core-b55347596bf7f385c577ce0e28baa755030c4887.tar.bz2 | |
add missing locale for hub constraints
| -rw-r--r-- | config/locales/hub.en.yml | 5 | ||||
| -rw-r--r-- | config/locales/hub.fr.yml | 5 | ||||
| -rw-r--r-- | lib/ninoxe_extension/hub/route_restrictions.rb | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/config/locales/hub.en.yml b/config/locales/hub.en.yml new file mode 100644 index 000000000..74f6ad9ec --- /dev/null +++ b/config/locales/hub.en.yml @@ -0,0 +1,5 @@ +en: + hub: + routes: + wayback_code_exclusive: "Waybak already used for another route" + max_by_line: "HUB format allows a maximum of 2 routes for a line" diff --git a/config/locales/hub.fr.yml b/config/locales/hub.fr.yml new file mode 100644 index 000000000..2ff5b7365 --- /dev/null +++ b/config/locales/hub.fr.yml @@ -0,0 +1,5 @@ +fr: + hub: + routes: + wayback_code_exclusive: "Une autre séquence existe déjà dans le même sens (Aller ou Retour)" + max_by_line: "Le format HUB n'autorise que 2 séquences d'arrêts au plus pour une ligne" diff --git a/lib/ninoxe_extension/hub/route_restrictions.rb b/lib/ninoxe_extension/hub/route_restrictions.rb index 6b996ec3d..a5f4c8019 100644 --- a/lib/ninoxe_extension/hub/route_restrictions.rb +++ b/lib/ninoxe_extension/hub/route_restrictions.rb @@ -10,13 +10,13 @@ module NinoxeExtension::Hub # HUB-37 def wayback_code_limitation return unless hub_restricted? - errors.add( :wayback_code, "déjà pris!") if line.routes.reject {|r| r.id==id}.map(&:wayback_code).include?( wayback_code) + errors.add( :wayback_code, I18n.t('hub.routes.wayback_code_exclusive')) if line.routes.reject {|r| r.id==id}.map(&:wayback_code).include?( wayback_code) end # HUB-37 def max_instance_limitation return unless hub_restricted? - errors.add( :flash, "2 routes max") + errors.add( :flash, I18n.t('hub.routes.max_by_line')) end # HUB-38 |
