Moved to new locales for tests.

This commit is contained in:
Martin Edenhofer 2015-04-27 15:06:37 +02:00
parent 16a12dc923
commit 13e219f06e
4 changed files with 33 additions and 33 deletions

View file

@ -93,7 +93,7 @@ push translations to online
get list of translations get list of translations
list = Translation.list('de') list = Translation.list('de-de')
=end =end
@ -142,7 +142,7 @@ get list of translations
translate strings in ruby context, e. g. for notifications translate strings in ruby context, e. g. for notifications
translated = Translation.translate('de', 'New') translated = Translation.translate('de-de', 'New')
=end =end

View file

@ -62,82 +62,82 @@ class NotificationFactoryTest < ActiveSupport::TestCase
:result => 'Hi Nicole,', :result => 'Hi Nicole,',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Hi #{recipient.firstname},', :string => 'Hi #{recipient.firstname},',
:result => 'Hi Nicole,', :result => 'Hi Nicole,',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Hi #{recipient.firstname}, Group: #{ticket.group.name}', :string => 'Hi #{recipient.firstname}, Group: #{ticket.group.name}',
:result => 'Hi Nicole, Group: Users', :result => 'Hi Nicole, Group: Users',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => '#{config.http_type} some text', :string => '#{config.http_type} some text',
:result => 'http some text', :result => 'http some text',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'i18n(New) some text', :string => 'i18n(New) some text',
:result => 'Neu some text', :result => 'Neu some text',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => '\'i18n(#{ticket.state.name})\' ticket state', :string => '\'i18n(#{ticket.state.name})\' ticket state',
:result => '\'neu\' ticket state', :result => '\'neu\' ticket state',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'a #{not_existing_object.test}', :string => 'a #{not_existing_object.test}',
:result => 'a #{not_existing_object / no such object}', :result => 'a #{not_existing_object / no such object}',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'a #{ticket.level1}', :string => 'a #{ticket.level1}',
:result => 'a #{ticket.level1 / no such method}', :result => 'a #{ticket.level1 / no such method}',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'a #{ticket.level1.level2}', :string => 'a #{ticket.level1.level2}',
:result => 'a #{ticket.level1 / no such method}', :result => 'a #{ticket.level1 / no such method}',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'a #{ticket.title.level2}', :string => 'a #{ticket.title.level2}',
:result => 'a #{ticket.title.level2 / no such method}', :result => 'a #{ticket.title.level2 / no such method}',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'by #{ticket.updated_by.fullname}', :string => 'by #{ticket.updated_by.fullname}',
:result => 'by Nicole Braun', :result => 'by Nicole Braun',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Subject #{article.from}, Group: #{ticket.group.name}', :string => 'Subject #{article.from}, Group: #{ticket.group.name}',
:result => 'Subject Zammad Feedback <feedback@example.org>, Group: Users', :result => 'Subject Zammad Feedback <feedback@example.org>, Group: Users',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Body #{article.body}, Group: #{ticket.group.name}', :string => 'Body #{article.body}, Group: #{ticket.group.name}',
:result => 'Body some text, Group: Users', :result => 'Body some text, Group: Users',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => '\#{puts `ls`}', :string => '\#{puts `ls`}',
:result => '\#{puts `ls`} (not allowed)', :result => '\#{puts `ls`} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'test i18n(new)', :string => 'test i18n(new)',
:result => 'test neu', :result => 'test neu',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'test i18n()', :string => 'test i18n()',
:result => 'test ', :result => 'test ',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'test i18n(new) i18n(open)', :string => 'test i18n(new) i18n(open)',
:result => 'test neu offen', :result => 'test neu offen',
}, },
@ -181,17 +181,17 @@ class NotificationFactoryTest < ActiveSupport::TestCase
) )
tests = [ tests = [
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Subject #{ticket.title}', :string => 'Subject #{ticket.title}',
:result => 'Subject some title <b>äöüß</b> 2', :result => 'Subject some title <b>äöüß</b> 2',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Subject #{article.from}, Group: #{ticket.group.name}', :string => 'Subject #{article.from}, Group: #{ticket.group.name}',
:result => 'Subject Zammad Feedback <feedback@example.org>, Group: Users', :result => 'Subject Zammad Feedback <feedback@example.org>, Group: Users',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'Body #{article.body}, Group: #{ticket.group.name}', :string => 'Body #{article.body}, Group: #{ticket.group.name}',
:result => 'Body some text :result => 'Body some text
next line, Group: Users', next line, Group: Users',
@ -236,44 +236,44 @@ next line, Group: Users',
) )
tests = [ tests = [
{ {
:locale => 'de', :locale => 'de-de',
:string => '\#{puts `ls`}', :string => '\#{puts `ls`}',
:result => '\#{puts `ls`} (not allowed)', :result => '\#{puts `ls`} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article.destroy}', :string => 'attack#1 #{article.destroy}',
:result => 'attack#1 #{article.destroy} (not allowed)', :result => 'attack#1 #{article.destroy} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#2 #{Article.where}', :string => 'attack#2 #{Article.where}',
:result => 'attack#2 #{Article.where} (not allowed)', :result => 'attack#2 #{Article.where} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article. :string => 'attack#1 #{article.
destroy}', destroy}',
:result => 'attack#1 #{article. :result => 'attack#1 #{article.
destroy} (not allowed)', destroy} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article.find}', :string => 'attack#1 #{article.find}',
:result => 'attack#1 #{article.find} (not allowed)', :result => 'attack#1 #{article.find} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article.update(:name => "test")}', :string => 'attack#1 #{article.update(:name => "test")}',
:result => 'attack#1 #{article.update(:name => "test")} (not allowed)', :result => 'attack#1 #{article.update(:name => "test")} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article.all}', :string => 'attack#1 #{article.all}',
:result => 'attack#1 #{article.all} (not allowed)', :result => 'attack#1 #{article.all} (not allowed)',
}, },
{ {
:locale => 'de', :locale => 'de-de',
:string => 'attack#1 #{article.delete}', :string => 'attack#1 #{article.delete}',
:result => 'attack#1 #{article.delete} (not allowed)', :result => 'attack#1 #{article.delete} (not allowed)',
}, },

View file

@ -16,7 +16,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
:roles => roles, :roles => roles,
:groups => groups, :groups => groups,
:preferences => { :preferences => {
:locale => 'de', :locale => 'de-de',
}, },
:updated_by_id => 1, :updated_by_id => 1,
:created_by_id => 1, :created_by_id => 1,
@ -31,7 +31,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
:roles => roles, :roles => roles,
:groups => groups, :groups => groups,
:preferences => { :preferences => {
:locale => 'en_CA', :locale => 'en-ca',
}, },
:updated_by_id => 1, :updated_by_id => 1,
:created_by_id => 1, :created_by_id => 1,

View file

@ -14,14 +14,14 @@ class TranslationTest < ActiveSupport::TestCase
# test 2 # test 2
{ {
:locale => 'de', :locale => 'de-de',
:string => 'New', :string => 'New',
:result => 'Neu', :result => 'Neu',
}, },
# test 3 # test 3
{ {
:locale => 'de', :locale => 'de-de',
:string => 'not translated - lalala', :string => 'not translated - lalala',
:result => 'not translated - lalala', :result => 'not translated - lalala',
}, },