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
Merge requests
!6351
new branch patch 179 applied
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
new branch patch 179 applied
issue/drupal-2313309:2313309-179-11.x
into
11.x
Overview
0
Commits
3
Pipelines
3
Changes
19
Open
new branch patch 179 applied
Carlos Romero
requested to merge
issue/drupal-2313309:2313309-179-11.x
into
11.x
Jan 28, 2024
Overview
0
Commits
3
Pipelines
3
Changes
19
Closes
#2313309
0
0
Merge request reports
Compare
11.x
version 2
dc6695e8
Jan 28, 2024
version 1
3421c28d
Jan 28, 2024
11.x (base)
and
latest version
latest version
20ea392b
3 commits,
Jan 28, 2024
version 2
dc6695e8
2 commits,
Jan 28, 2024
version 1
3421c28d
1 commit,
Jan 28, 2024
19 files
+
1269
−
58
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
19
core/lib/Drupal/Core/Cache/Context/AccountAdminLanguageCacheContext.php
0 → 100644
+
53
−
0
View file @ 20ea392b
Edit in single-file editor
Open in Web IDE
<?php
namespace
Drupal\Core\Cache\Context
;
use
Drupal\Core\Cache\CacheableMetadata
;
use
Drupal\Core\Session\AccountProxyInterface
;
/**
* Defines an AdminLanguageCacheContext service, for "admin language" caching.
*
* Cache context ID: 'user.admin_language'.
*/
class
AccountAdminLanguageCacheContext
implements
CacheContextInterface
{
/**
* The current user.
*
* @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
();
}
/**
* {@inheritdoc}
*/
public
function
getCacheableMetadata
()
{
return
new
CacheableMetadata
();
}
}
Loading