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
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

View file

@ -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 <feedback@example.org>, 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 <b>äöüß</b> 2',
},
{
:locale => 'de',
:locale => 'de-de',
:string => 'Subject #{article.from}, Group: #{ticket.group.name}',
:result => 'Subject Zammad Feedback <feedback@example.org>, 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)',
},

View file

@ -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,

View file

@ -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',
},