Maintenance: Make several untranslatable strings / settings translatable.

This commit is contained in:
Martin Gruner 2022-05-13 12:37:07 +02:00
parent 6f2f507385
commit a19fee34f6
No known key found for this signature in database
GPG key ID: 1F24F3A68E149925
8 changed files with 131 additions and 56 deletions

View file

@ -452,7 +452,7 @@ class App.UiElement.ticket_perform_action
name: "#{name}::internal" name: "#{name}::internal"
multiple: false multiple: false
null: false null: false
options: { true: 'internal', false: 'public' } options: { true: __('internal'), false: __('public') }
value: meta.internal || 'false' value: meta.internal || 'false'
translate: true translate: true
) )

View file

@ -34,7 +34,8 @@ class App.MultiLocalesRow extends App.Controller
name: name name: name
value: value value: value
null: false null: false
placeholder: __('Select locale…') translate: true
placeholder: App.i18n.translatePlain('Select locale…')
options: [] #formattedLocales options: [] #formattedLocales
class: 'form-control--small' class: 'form-control--small'
) )

View file

@ -39,11 +39,11 @@ class App.Group extends App.Model
cssClass: cssClass.join(' ') cssClass: cssClass.join(' ')
@accesses: -> @accesses: ->
read: 'Read' read: __('Read')
create: 'Create' create: __('Create')
change: 'Change' change: __('Change')
overview: 'Overview' overview: __('Overview')
full: 'Full' full: __('Full')
signature_id_is_display_warning: (signature_id) -> signature_id_is_display_warning: (signature_id) ->
!App.Signature.find(signature_id).active !App.Signature.find(signature_id).active

View file

@ -6,7 +6,7 @@ class App.Macro extends App.Model
{ name: 'name', display: __('Name'), tag: 'input', type: 'text', limit: 100, null: false }, { name: 'name', display: __('Name'), tag: 'input', type: 'text', limit: 100, null: false },
{ name: 'perform', display: __('Actions'), tag: 'ticket_perform_action', null: true { name: 'perform', display: __('Actions'), tag: 'ticket_perform_action', null: true
}, },
{ name: 'ux_flow_next_up', display: __('Once completed…'), tag: 'select', default: 'none', options: { { name: 'ux_flow_next_up', display: __('Once completed…'), tag: 'select', default: 'none', translate: true, options: {
none: __('Stay on tab'), next_task: __('Close tab'), next_task_on_close: __('Close tab on ticket close'), next_from_overview: __('Advance to next ticket from overview') none: __('Stay on tab'), next_task: __('Close tab'), next_task_on_close: __('Close tab on ticket close'), next_from_overview: __('Advance to next ticket from overview')
} }
}, },

View file

@ -6,7 +6,7 @@ class App.Webhook extends App.Model
{ name: 'name', display: __('Name'), tag: 'input', type: 'text', limit: 100, null: false }, { name: 'name', display: __('Name'), tag: 'input', type: 'text', limit: 100, null: false },
{ name: 'endpoint', display: __('Endpoint'), tag: 'input', type: 'text', limit: 300, null: false, placeholder: 'https://target.example.com/webhook' }, { name: 'endpoint', display: __('Endpoint'), tag: 'input', type: 'text', limit: 300, null: false, placeholder: 'https://target.example.com/webhook' },
{ name: 'signature_token', display: __('HMAC SHA1 Signature Token'), tag: 'input', type: 'text', limit: 100, null: true }, { name: 'signature_token', display: __('HMAC SHA1 Signature Token'), tag: 'input', type: 'text', limit: 100, null: true },
{ name: 'ssl_verify', display: __('SSL Verify'), tag: 'boolean', null: true, options: { true: 'yes', false: 'no' }, default: true }, { name: 'ssl_verify', display: __('SSL Verify'), tag: 'boolean', null: true, translate: true, options: { true: 'yes', false: 'no' }, default: true },
{ name: 'note', display: __('Note'), tag: 'textarea', note: '', limit: 250, null: true }, { name: 'note', display: __('Note'), tag: 'textarea', note: '', limit: 250, null: true },
{ name: 'active', display: __('Active'), tag: 'active', default: true }, { name: 'active', display: __('Active'), tag: 'active', default: true },
{ name: 'updated_at', display: __('Updated'), tag: 'datetime', readonly: 1 }, { name: 'updated_at', display: __('Updated'), tag: 'datetime', readonly: 1 },

View file

@ -0,0 +1,29 @@
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class MarkSettingsAsTranslatable < ActiveRecord::Migration[6.0]
def change
return if !Setting.exists?(name: 'system_init_done')
settings_update = %w[
postmaster_follow_up_search_in
postmaster_sender_based_on_reply_to
ticket_define_email_from
pretty_date_format
storage_provider
password_min_2_lower_2_upper_characters
password_need_digit
password_need_special_character
]
settings_update.each do |name|
fetched_setting = Setting.find_by(name: name)
next if !fetched_setting
fetched_setting.options = fetched_setting.options.tap do |options|
options[:form].first[:translate] = true
end
fetched_setting.save!
end
end
end

View file

@ -212,10 +212,11 @@ Setting.create_or_update(
name: 'pretty_date_format', name: 'pretty_date_format',
tag: 'select', tag: 'select',
options: { options: {
relative: 'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"', relative: __('relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"'),
absolute: 'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"', absolute: __('absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"'),
timestamp: 'timestamp - e. g. "2018-08-30 14:30"', timestamp: __('timestamp - e. g. "2018-08-30 14:30"'),
}, },
translate: true,
}, },
], ],
}, },
@ -352,6 +353,7 @@ Setting.create_if_not_exists(
'DB' => __('Database'), 'DB' => __('Database'),
'File' => __('Filesystem'), 'File' => __('Filesystem'),
}, },
translate: true,
}, },
], ],
}, },
@ -1926,6 +1928,7 @@ Setting.create_if_not_exists(
1 => 'yes', 1 => 'yes',
0 => 'no', 0 => 'no',
}, },
translate: true,
}, },
], ],
}, },
@ -1951,6 +1954,7 @@ Setting.create_if_not_exists(
1 => 'yes', 1 => 'yes',
0 => 'no', 0 => 'no',
}, },
translate: true,
}, },
], ],
}, },
@ -1976,6 +1980,7 @@ Setting.create_if_not_exists(
1 => 'yes', 1 => 'yes',
0 => 'no', 0 => 'no',
}, },
translate: true,
}, },
], ],
}, },
@ -2088,9 +2093,9 @@ Setting.create_if_not_exists(
tag: 'select', tag: 'select',
translate: true, translate: true,
options: { options: {
'left' => 'left', 'left' => __('left'),
'right' => 'right', 'right' => __('right'),
'none' => 'none', 'none' => __('none'),
}, },
}, },
], ],
@ -2687,6 +2692,7 @@ Setting.create_if_not_exists(
AgentNameSystemAddressName: __('Agent Name + FromSeparator + System Address Display Name'), AgentNameSystemAddressName: __('Agent Name + FromSeparator + System Address Display Name'),
AgentName: __('Agent Name'), AgentName: __('Agent Name'),
}, },
translate: true,
}, },
], ],
}, },
@ -2786,6 +2792,7 @@ Setting.create_if_not_exists(
'body' => __('Body - Search for follow-up also in mail body.'), 'body' => __('Body - Search for follow-up also in mail body.'),
'attachment' => __('Attachment - Search for follow-up also in attachments.'), 'attachment' => __('Attachment - Search for follow-up also in attachments.'),
}, },
translate: true,
}, },
], ],
}, },
@ -2813,6 +2820,7 @@ Setting.create_if_not_exists(
'as_sender_of_email' => __('Take Reply-To header as sender/from of email.'), 'as_sender_of_email' => __('Take Reply-To header as sender/from of email.'),
'as_sender_of_email_use_from_realname' => __('Take Reply-To header as sender/from of email and use the real name of origin from.'), 'as_sender_of_email_use_from_realname' => __('Take Reply-To header as sender/from of email and use the real name of origin from.'),
}, },
translate: true,
}, },
], ],
}, },

View file

@ -1459,6 +1459,7 @@ msgstr ""
msgid "Certificates & Private Keys" msgid "Certificates & Private Keys"
msgstr "" msgstr ""
#: app/assets/javascripts/app/models/group.coffee
#: app/assets/javascripts/app/views/generic/login_preview.jst.eco #: app/assets/javascripts/app/views/generic/login_preview.jst.eco
#: app/assets/javascripts/app/views/integration/exchange.jst.eco #: app/assets/javascripts/app/views/integration/exchange.jst.eco
#: app/assets/javascripts/app/views/integration/ldap.jst.eco #: app/assets/javascripts/app/views/integration/ldap.jst.eco
@ -2122,6 +2123,7 @@ msgstr ""
#: app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee #: app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee
#: app/assets/javascripts/app/controllers/_profile/token_access.coffee #: app/assets/javascripts/app/controllers/_profile/token_access.coffee
#: app/assets/javascripts/app/controllers/knowledge_base/add_form.coffee #: app/assets/javascripts/app/controllers/knowledge_base/add_form.coffee
#: app/assets/javascripts/app/models/group.coffee
#: app/assets/javascripts/app/views/agent_ticket_create.jst.eco #: app/assets/javascripts/app/views/agent_ticket_create.jst.eco
#: app/assets/javascripts/app/views/agent_user_create.jst.eco #: app/assets/javascripts/app/views/agent_user_create.jst.eco
#: app/assets/javascripts/app/views/customer_ticket_create.jst.eco #: app/assets/javascripts/app/views/customer_ticket_create.jst.eco
@ -4231,6 +4233,10 @@ msgstr ""
msgid "Frontend" msgid "Frontend"
msgstr "" msgstr ""
#: app/assets/javascripts/app/models/group.coffee
msgid "Full"
msgstr ""
#: app/assets/javascripts/app/views/getting_started/email.jst.eco #: app/assets/javascripts/app/views/getting_started/email.jst.eco
msgid "Full Name" msgid "Full Name"
msgstr "" msgstr ""
@ -6915,6 +6921,7 @@ msgid "Outbound Call"
msgstr "" msgstr ""
#: app/assets/javascripts/app/controllers/overview.coffee #: app/assets/javascripts/app/controllers/overview.coffee
#: app/assets/javascripts/app/models/group.coffee
msgid "Overview" msgid "Overview"
msgstr "" msgstr ""
@ -7410,6 +7417,10 @@ msgstr ""
msgid "Raw" msgid "Raw"
msgstr "" msgstr ""
#: app/assets/javascripts/app/models/group.coffee
msgid "Read"
msgstr ""
#: app/assets/javascripts/app/views/report/time_range_picker.jst.eco #: app/assets/javascripts/app/views/report/time_range_picker.jst.eco
msgid "Real-time" msgid "Real-time"
msgstr "" msgstr ""
@ -10719,6 +10730,10 @@ msgstr ""
msgid "Zip" msgid "Zip"
msgstr "" msgstr ""
#: db/seeds/settings.rb
msgid "absolute - e. g. \"Monday 09:30\" or \"Tuesday 23. Feb 14:20\""
msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/active.coffee #: app/assets/javascripts/app/controllers/_ui_element/active.coffee
msgid "active" msgid "active"
msgstr "" msgstr ""
@ -11073,6 +11088,7 @@ msgstr ""
msgid "inactive" msgid "inactive"
msgstr "" msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee
#: app/assets/javascripts/app/controllers/knowledge_base/content_can_be_published_form.coffee #: app/assets/javascripts/app/controllers/knowledge_base/content_can_be_published_form.coffee
msgid "internal" msgid "internal"
msgstr "" msgstr ""
@ -11119,6 +11135,10 @@ msgstr ""
msgid "last week" msgid "last week"
msgstr "" msgstr ""
#: db/seeds/settings.rb
msgid "left"
msgstr ""
#: app/assets/javascripts/app/lib/app_post/pretty_date.coffee #: app/assets/javascripts/app/lib/app_post/pretty_date.coffee
msgid "m" msgid "m"
msgstr "" msgstr ""
@ -11197,6 +11217,7 @@ msgstr ""
#: app/assets/javascripts/app/views/microsoft365/list.jst.eco #: app/assets/javascripts/app/views/microsoft365/list.jst.eco
#: app/assets/javascripts/app/views/profile/token_access.jst.eco #: app/assets/javascripts/app/views/profile/token_access.jst.eco
#: app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco #: app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco
#: db/seeds/settings.rb
msgid "none" msgid "none"
msgstr "" msgstr ""
@ -11269,6 +11290,10 @@ msgstr ""
msgid "phone" msgid "phone"
msgstr "" msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee
msgid "public"
msgstr ""
#: app/assets/javascripts/app/controllers/knowledge_base/content_can_be_published_form.coffee #: app/assets/javascripts/app/controllers/knowledge_base/content_can_be_published_form.coffee
msgid "published" msgid "published"
msgstr "" msgstr ""
@ -11285,6 +11310,10 @@ msgstr ""
msgid "regex mismatch" msgid "regex mismatch"
msgstr "" msgstr ""
#: db/seeds/settings.rb
msgid "relative - e. g. \"2 hours ago\" or \"2 days and 15 minutes ago\""
msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee #: app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee
#: app/assets/javascripts/app/views/profile/linked_accounts.jst.eco #: app/assets/javascripts/app/views/profile/linked_accounts.jst.eco
msgid "remove" msgid "remove"
@ -11307,6 +11336,10 @@ msgstr ""
msgid "reply" msgid "reply"
msgstr "" msgstr ""
#: db/seeds/settings.rb
msgid "right"
msgstr ""
#: app/assets/javascripts/app/controllers/cti.coffee #: app/assets/javascripts/app/controllers/cti.coffee
msgid "ringing" msgid "ringing"
msgstr "" msgstr ""
@ -11441,6 +11474,10 @@ msgstr ""
msgid "till (relative)" msgid "till (relative)"
msgstr "" msgstr ""
#: db/seeds/settings.rb
msgid "timestamp - e. g. \"2018-08-30 14:30\""
msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee #: app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee
msgid "to" msgid "to"
msgstr "" msgstr ""