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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!1713
Issue
#2313309
: Admin toolbar should always be rendered in the admin language (if set)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#2313309
: Admin toolbar should always be rendered in the admin language (if set)
issue/drupal-2313309:2313309-admin-toolbar-language
into
9.3.x
Overview
0
Commits
2
Pipelines
0
Changes
14
Open
David López
requested to merge
issue/drupal-2313309:2313309-admin-toolbar-language
into
9.3.x
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
14
Expand
0
0
Merge request reports
Compare
9.3.x
version 3
e5007afc
3 years ago
version 2
17f82a5e
3 years ago
version 1
17f82a5e
3 years ago
9.3.x (HEAD)
and
latest version
latest version
464f49f3
2 commits,
3 years ago
version 3
e5007afc
1 commit,
3 years ago
version 2
17f82a5e
1 commit,
3 years ago
version 1
17f82a5e
94 commits,
3 years ago
14 files
+
497
−
109
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Cache/Context/AccountAdminLanguageCacheContext.php
0 → 100644
+
51
−
0
Options
<?php
namespace
Drupal\Core\Cache\Context
;
use
Drupal\Core\Cache\CacheableMetadata
;
use
Drupal\Core\Session\AccountProxyInterface
;
/**
* Defines the AdminLanguageCacheContext service, for "per admin language" caching.
*
* Cache context ID: 'user.admin_language'.
*/
class
AccountAdminLanguageCacheContext
implements
CacheContextInterface
{
/**
* @var \Drupal\Core\Session\AccountProxyInterface
*/
protected
AccountProxyInterface
$currentUser
;
/**
* Constructs a new AccountAdminLanguageCacheContext service.
*
* @param \Drupal\Core\Session\AccountProxyInterface $current_user
* The current user.
*/
public
function
__construct
(
AccountProxyInterface
$current_user
)
{
$this
->
currentUser
=
$current_user
;
}
/**
* {@inheritdoc}
*/
public
static
function
getLabel
()
{
return
t
(
"Account's administration language"
);
}
/**
* {@inheritdoc}
*/
public
function
getContext
()
{
return
$this
->
currentUser
->
getPreferredAdminLangcode
(
TRUE
);
}
/**
* {@inheritdoc}
*/
public
function
getCacheableMetadata
()
{
return
new
CacheableMetadata
();
}
}
Loading