Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
7bf9b9a5
Commit
7bf9b9a5
authored
Aug 26, 2015
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2555825
by stefan.r, cilefen: Remove SafeMarkup::set call from TranslationManager::translate
parent
c9072a41
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/StringTranslation/TranslationManager.php
+8
-3
8 additions, 3 deletions
.../lib/Drupal/Core/StringTranslation/TranslationManager.php
core/modules/views/src/Plugin/views/PluginBase.php
+1
-1
1 addition, 1 deletion
core/modules/views/src/Plugin/views/PluginBase.php
with
9 additions
and
4 deletions
core/lib/Drupal/Core/StringTranslation/TranslationManager.php
+
8
−
3
View file @
7bf9b9a5
...
...
@@ -142,10 +142,15 @@ public function getStringTranslation($langcode, $string, $context) {
public
function
translate
(
$string
,
array
$args
=
array
(),
array
$options
=
array
())
{
$string
=
$this
->
doTranslate
(
$string
,
$options
);
if
(
empty
(
$args
))
{
// This is assumed to be safe because translate should only be called
// with strings defined in code.
// We add the string to the safe list as opposed to making it an object
// implementing SafeStringInterface as we may need to call __toString()
// on the object before render time, at which point the string ceases to
// be safe, and working around this would require significant rework.
// Adding this string to the safe list is assumed to be safe because
// translate() should only be called with strings defined in code.
// @see \Drupal\Core\StringTranslation\TranslationInterface::translate()
return
SafeMarkup
::
set
(
$string
);
SafeMarkup
::
setMultiple
([
$string
=>
[
'html'
=>
TRUE
]]);
return
$string
;
}
else
{
return
SafeMarkup
::
format
(
$string
,
$args
);
...
...
This diff is collapsed.
Click to expand it.
core/modules/views/src/Plugin/views/PluginBase.php
+
1
−
1
View file @
7bf9b9a5
...
...
@@ -580,7 +580,7 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $c
// Add real languages.
foreach
(
$languages
as
$id
=>
$language
)
{
$list
[
$id
]
=
$this
->
t
(
$language
->
getName
()
)
;
$list
[
$id
]
=
$language
->
getName
();
}
return
$list
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment