From 13e219f06e251c83b98dcc4622c6389c37da822f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 27 Apr 2015 15:06:37 +0200 Subject: [PATCH] Moved to new locales for tests. --- app/models/translation.rb | 4 +- test/unit/notification_factory_test.rb | 54 +++++++++++++------------- test/unit/ticket_notification_test.rb | 4 +- test/unit/translation_test.rb | 4 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/models/translation.rb b/app/models/translation.rb index 8a82a4cbd..bce8448db 100644 --- a/app/models/translation.rb +++ b/app/models/translation.rb @@ -93,7 +93,7 @@ push translations to online get list of translations - list = Translation.list('de') + list = Translation.list('de-de') =end @@ -142,7 +142,7 @@ get list of translations translate strings in ruby context, e. g. for notifications - translated = Translation.translate('de', 'New') + translated = Translation.translate('de-de', 'New') =end diff --git a/test/unit/notification_factory_test.rb b/test/unit/notification_factory_test.rb index 90a4da020..82832dc74 100644 --- a/test/unit/notification_factory_test.rb +++ b/test/unit/notification_factory_test.rb @@ -62,82 +62,82 @@ class NotificationFactoryTest < ActiveSupport::TestCase :result => 'Hi Nicole,', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Hi #{recipient.firstname},', :result => 'Hi Nicole,', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Hi #{recipient.firstname}, Group: #{ticket.group.name}', :result => 'Hi Nicole, Group: Users', }, { - :locale => 'de', + :locale => 'de-de', :string => '#{config.http_type} some text', :result => 'http some text', }, { - :locale => 'de', + :locale => 'de-de', :string => 'i18n(New) some text', :result => 'Neu some text', }, { - :locale => 'de', + :locale => 'de-de', :string => '\'i18n(#{ticket.state.name})\' ticket state', :result => '\'neu\' ticket state', }, { - :locale => 'de', + :locale => 'de-de', :string => 'a #{not_existing_object.test}', :result => 'a #{not_existing_object / no such object}', }, { - :locale => 'de', + :locale => 'de-de', :string => 'a #{ticket.level1}', :result => 'a #{ticket.level1 / no such method}', }, { - :locale => 'de', + :locale => 'de-de', :string => 'a #{ticket.level1.level2}', :result => 'a #{ticket.level1 / no such method}', }, { - :locale => 'de', + :locale => 'de-de', :string => 'a #{ticket.title.level2}', :result => 'a #{ticket.title.level2 / no such method}', }, { - :locale => 'de', + :locale => 'de-de', :string => 'by #{ticket.updated_by.fullname}', :result => 'by Nicole Braun', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Subject #{article.from}, Group: #{ticket.group.name}', :result => 'Subject Zammad Feedback , Group: Users', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Body #{article.body}, Group: #{ticket.group.name}', :result => 'Body some text, Group: Users', }, { - :locale => 'de', + :locale => 'de-de', :string => '\#{puts `ls`}', :result => '\#{puts `ls`} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'test i18n(new)', :result => 'test neu', }, { - :locale => 'de', + :locale => 'de-de', :string => 'test i18n()', :result => 'test ', }, { - :locale => 'de', + :locale => 'de-de', :string => 'test i18n(new) i18n(open)', :result => 'test neu offen', }, @@ -181,17 +181,17 @@ class NotificationFactoryTest < ActiveSupport::TestCase ) tests = [ { - :locale => 'de', + :locale => 'de-de', :string => 'Subject #{ticket.title}', :result => 'Subject some title äöüß 2', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Subject #{article.from}, Group: #{ticket.group.name}', :result => 'Subject Zammad Feedback , Group: Users', }, { - :locale => 'de', + :locale => 'de-de', :string => 'Body #{article.body}, Group: #{ticket.group.name}', :result => 'Body some text next line, Group: Users', @@ -236,44 +236,44 @@ next line, Group: Users', ) tests = [ { - :locale => 'de', + :locale => 'de-de', :string => '\#{puts `ls`}', :result => '\#{puts `ls`} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article.destroy}', :result => 'attack#1 #{article.destroy} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#2 #{Article.where}', :result => 'attack#2 #{Article.where} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article. destroy}', :result => 'attack#1 #{article. destroy} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article.find}', :result => 'attack#1 #{article.find} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article.update(:name => "test")}', :result => 'attack#1 #{article.update(:name => "test")} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article.all}', :result => 'attack#1 #{article.all} (not allowed)', }, { - :locale => 'de', + :locale => 'de-de', :string => 'attack#1 #{article.delete}', :result => 'attack#1 #{article.delete} (not allowed)', }, diff --git a/test/unit/ticket_notification_test.rb b/test/unit/ticket_notification_test.rb index 968991cf5..934f4f557 100644 --- a/test/unit/ticket_notification_test.rb +++ b/test/unit/ticket_notification_test.rb @@ -16,7 +16,7 @@ class TicketNotificationTest < ActiveSupport::TestCase :roles => roles, :groups => groups, :preferences => { - :locale => 'de', + :locale => 'de-de', }, :updated_by_id => 1, :created_by_id => 1, @@ -31,7 +31,7 @@ class TicketNotificationTest < ActiveSupport::TestCase :roles => roles, :groups => groups, :preferences => { - :locale => 'en_CA', + :locale => 'en-ca', }, :updated_by_id => 1, :created_by_id => 1, diff --git a/test/unit/translation_test.rb b/test/unit/translation_test.rb index 8ceb1c6e7..2b5aa87a7 100644 --- a/test/unit/translation_test.rb +++ b/test/unit/translation_test.rb @@ -14,14 +14,14 @@ class TranslationTest < ActiveSupport::TestCase # test 2 { - :locale => 'de', + :locale => 'de-de', :string => 'New', :result => 'Neu', }, # test 3 { - :locale => 'de', + :locale => 'de-de', :string => 'not translated - lalala', :result => 'not translated - lalala', },