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"
multiple: false
null: false
options: { true: 'internal', false: 'public' }
options: { true: __('internal'), false: __('public') }
value: meta.internal || 'false'
translate: true
)

View file

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

View file

@ -39,11 +39,11 @@ class App.Group extends App.Model
cssClass: cssClass.join(' ')
@accesses: ->
read: 'Read'
create: 'Create'
change: 'Change'
overview: 'Overview'
full: 'Full'
read: __('Read')
create: __('Create')
change: __('Change')
overview: __('Overview')
full: __('Full')
signature_id_is_display_warning: (signature_id) ->
!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: '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')
}
},

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: '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: '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: 'active', display: __('Active'), tag: 'active', default: true },
{ 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

@ -207,15 +207,16 @@ Setting.create_or_update(
options: {
form: [
{
display: '',
null: false,
name: 'pretty_date_format',
tag: 'select',
options: {
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"',
timestamp: 'timestamp - e. g. "2018-08-30 14:30"',
display: '',
null: false,
name: 'pretty_date_format',
tag: 'select',
options: {
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"'),
timestamp: __('timestamp - e. g. "2018-08-30 14:30"'),
},
translate: true,
},
],
},
@ -343,15 +344,16 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: '',
null: true,
name: 'storage_provider',
tag: 'select',
tranlate: true,
options: {
display: '',
null: true,
name: 'storage_provider',
tag: 'select',
tranlate: true,
options: {
'DB' => __('Database'),
'File' => __('Filesystem'),
},
translate: true,
},
],
},
@ -1918,14 +1920,15 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: '',
null: true,
name: 'password_min_2_lower_2_upper_characters',
tag: 'select',
options: {
display: '',
null: true,
name: 'password_min_2_lower_2_upper_characters',
tag: 'select',
options: {
1 => 'yes',
0 => 'no',
},
translate: true,
},
],
},
@ -1943,14 +1946,15 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: __('Needed'),
null: true,
name: 'password_need_digit',
tag: 'select',
options: {
display: __('Needed'),
null: true,
name: 'password_need_digit',
tag: 'select',
options: {
1 => 'yes',
0 => 'no',
},
translate: true,
},
],
},
@ -1968,14 +1972,15 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: __('Needed'),
null: true,
name: 'password_need_special_character',
tag: 'select',
options: {
display: __('Needed'),
null: true,
name: 'password_need_special_character',
tag: 'select',
options: {
1 => 'yes',
0 => 'no',
},
translate: true,
},
],
},
@ -2088,9 +2093,9 @@ Setting.create_if_not_exists(
tag: 'select',
translate: true,
options: {
'left' => 'left',
'right' => 'right',
'none' => 'none',
'left' => __('left'),
'right' => __('right'),
'none' => __('none'),
},
},
],
@ -2678,15 +2683,16 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: '',
null: true,
name: 'ticket_define_email_from',
tag: 'select',
options: {
display: '',
null: true,
name: 'ticket_define_email_from',
tag: 'select',
options: {
SystemAddressName: __('System Address Display Name'),
AgentNameSystemAddressName: __('Agent Name + FromSeparator + System Address Display Name'),
AgentName: __('Agent Name'),
},
translate: true,
},
],
},
@ -2777,15 +2783,16 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: '',
null: true,
name: 'postmaster_follow_up_search_in',
tag: 'checkbox',
options: {
display: '',
null: true,
name: 'postmaster_follow_up_search_in',
tag: 'checkbox',
options: {
'references' => __('References - Search for follow-up also in In-Reply-To or References headers.'),
'body' => __('Body - Search for follow-up also in mail body.'),
'attachment' => __('Attachment - Search for follow-up also in attachments.'),
},
translate: true,
},
],
},
@ -2804,15 +2811,16 @@ Setting.create_if_not_exists(
options: {
form: [
{
display: '',
null: true,
name: 'postmaster_sender_based_on_reply_to',
tag: 'select',
options: {
display: '',
null: true,
name: 'postmaster_sender_based_on_reply_to',
tag: 'select',
options: {
'' => '-',
'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.'),
},
translate: true,
},
],
},

View file

@ -1459,6 +1459,7 @@ msgstr ""
msgid "Certificates & Private Keys"
msgstr ""
#: app/assets/javascripts/app/models/group.coffee
#: 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/ldap.jst.eco
@ -2122,6 +2123,7 @@ msgstr ""
#: app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee
#: app/assets/javascripts/app/controllers/_profile/token_access.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_user_create.jst.eco
#: app/assets/javascripts/app/views/customer_ticket_create.jst.eco
@ -4231,6 +4233,10 @@ msgstr ""
msgid "Frontend"
msgstr ""
#: app/assets/javascripts/app/models/group.coffee
msgid "Full"
msgstr ""
#: app/assets/javascripts/app/views/getting_started/email.jst.eco
msgid "Full Name"
msgstr ""
@ -6915,6 +6921,7 @@ msgid "Outbound Call"
msgstr ""
#: app/assets/javascripts/app/controllers/overview.coffee
#: app/assets/javascripts/app/models/group.coffee
msgid "Overview"
msgstr ""
@ -7410,6 +7417,10 @@ msgstr ""
msgid "Raw"
msgstr ""
#: app/assets/javascripts/app/models/group.coffee
msgid "Read"
msgstr ""
#: app/assets/javascripts/app/views/report/time_range_picker.jst.eco
msgid "Real-time"
msgstr ""
@ -10719,6 +10730,10 @@ msgstr ""
msgid "Zip"
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
msgid "active"
msgstr ""
@ -11073,6 +11088,7 @@ msgstr ""
msgid "inactive"
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
msgid "internal"
msgstr ""
@ -11119,6 +11135,10 @@ msgstr ""
msgid "last week"
msgstr ""
#: db/seeds/settings.rb
msgid "left"
msgstr ""
#: app/assets/javascripts/app/lib/app_post/pretty_date.coffee
msgid "m"
msgstr ""
@ -11197,6 +11217,7 @@ msgstr ""
#: app/assets/javascripts/app/views/microsoft365/list.jst.eco
#: app/assets/javascripts/app/views/profile/token_access.jst.eco
#: app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco
#: db/seeds/settings.rb
msgid "none"
msgstr ""
@ -11269,6 +11290,10 @@ msgstr ""
msgid "phone"
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
msgid "published"
msgstr ""
@ -11285,6 +11310,10 @@ msgstr ""
msgid "regex mismatch"
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/views/profile/linked_accounts.jst.eco
msgid "remove"
@ -11307,6 +11336,10 @@ msgstr ""
msgid "reply"
msgstr ""
#: db/seeds/settings.rb
msgid "right"
msgstr ""
#: app/assets/javascripts/app/controllers/cti.coffee
msgid "ringing"
msgstr ""
@ -11441,6 +11474,10 @@ msgstr ""
msgid "till (relative)"
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
msgid "to"
msgstr ""