Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
language_cookie
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
language_cookie
Merge requests
!5
Issue
#3193793
: Add option to set cookie client side
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Issue
#3193793
: Add option to set cookie client side
issue/language_cookie-3193793:3193793-add-option-to
into
2.0.x
Overview
0
Commits
2
Pipelines
0
Changes
13
Open
Issue #3193793: Add option to set cookie client side
Bram Driesen
requested to merge
issue/language_cookie-3193793:3193793-add-option-to
into
2.0.x
Feb 1, 2022
Overview
0
Commits
2
Pipelines
0
Changes
13
0
0
Merge request reports
Compare
2.0.x
version 1
c3a13054
Feb 1, 2022
2.0.x (base)
and
latest version
latest version
53f9330d
2 commits,
Feb 3, 2022
version 1
c3a13054
1 commit,
Feb 1, 2022
13 files
+
207
−
24
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
assets/js/language_cookie.set-cookie.js
0 → 100644
+
18
−
0
View file @ 53f9330d
Edit in single-file editor
Open in Web IDE
/**
* @file
* Behavior for setting the language_cookie cookie client-side.
*/
(
function
(
drupalSettings
,
Cookies
)
{
"
use strict
"
;
if
(
typeof
drupalSettings
.
language_cookie
!==
'
undefined
'
)
{
let
config
=
drupalSettings
.
language_cookie
;
let
currentCookie
=
Cookies
.
get
(
config
.
cookie_name
);
if
(
config
.
set_on_every_pageload
||
!
currentCookie
||
!
currentCookie
.
length
||
currentCookie
!==
config
.
cookie_value
)
{
Cookies
.
set
(
config
.
cookie_name
,
config
.
cookie_value
,
config
.
options
);
}
}
})
(
drupalSettings
,
window
.
Cookies
);
Loading