Fixes #3733 - Simple quote characters (') not properly displayed.

This commit is contained in:
Dominik Klein 2021-09-30 15:57:39 +02:00 committed by Thorsten Eckel
parent c435fa4b23
commit 2bd4ceeedf
3 changed files with 23 additions and 4 deletions

View file

@ -46,7 +46,7 @@ class App.UiElement.ApplicationUiElement
result = [] result = []
for row in selection for row in selection
if attribute.translate if attribute.translate
row.name = App.i18n.translateInline(row.name) row.name = App.i18n.translatePlain(row.name)
if !_.isEmpty(row.children) if !_.isEmpty(row.children)
row.children = @getConfigOptionListArray(attribute, row.children) row.children = @getConfigOptionListArray(attribute, row.children)
result.push row result.push row
@ -65,7 +65,7 @@ class App.UiElement.ApplicationUiElement
for key in order for key in order
name_new = selection[key] name_new = selection[key]
if attribute.translate if attribute.translate
name_new = App.i18n.translateInline(name_new) name_new = App.i18n.translatePlain(name_new)
attribute.options.push { attribute.options.push {
name: name_new name: name_new
value: key value: key
@ -162,7 +162,7 @@ class App.UiElement.ApplicationUiElement
nameNew = item.name nameNew = item.name
if attribute.translate if attribute.translate
nameNew = App.i18n.translateInline(nameNew) nameNew = App.i18n.translatePlain(nameNew)
row = row =
value: item.id, value: item.id,

View file

@ -14,7 +14,7 @@
</div> </div>
<div class="form-group js-sure"> <div class="form-group js-sure">
<h3 class="danger-color"><%- @T('Warning') %></h3> <h3 class="danger-color"><%- @T('Warning') %></h3>
<p class="danger-color"><%- @T('There is no rollback of this deletion possible. If you are absolutely sure to do this, then type in "%s" into the input.', App.i18n.translateInline('delete').toUpperCase()) %></p> <p class="danger-color"><%- @T('There is no rollback of this deletion possible. If you are absolutely sure to do this, then type in "%s" into the input.', App.i18n.translatePlain('delete').toUpperCase()) %></p>
<%- @sure_html %> <%- @sure_html %>
</div> </div>
</div> </div>

View file

@ -562,6 +562,25 @@ RSpec.describe 'Ticket Create', type: :system do
end end
end end
context 'when state options have a special translation', authenticated_as: :authenticate do
let(:admin_de) { create(:admin, preferences: { locale: 'de-de' }) }
context 'when translated state option has a single quote' do
def authenticate
open_tranlation = Translation.where(locale: 'de-de', source: 'open')
open_tranlation.update(target: "off'en")
admin_de
end
it 'shows the translated state options correctly' do
visit 'ticket/create'
expect(page).to have_select('state_id', with_options: ["off'en"])
end
end
end
describe 'It should be possible to show attributes which are configured shown false #3726', authenticated_as: :authenticate, db_strategy: :reset do describe 'It should be possible to show attributes which are configured shown false #3726', authenticated_as: :authenticate, db_strategy: :reset do
let(:field_name) { SecureRandom.uuid } let(:field_name) { SecureRandom.uuid }
let(:field) do let(:field) do