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
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
Download
Patches
Plain diff
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
Bram Driesen
requested to merge
issue/language_cookie-3193793:3193793-add-option-to
into
2.0.x
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
13
Expand
0
0
Merge request reports
Compare
2.0.x
version 1
c3a13054
3 years ago
2.0.x (base)
and
latest version
latest version
53f9330d
2 commits,
3 years ago
version 1
c3a13054
1 commit,
3 years ago
13 files
+
207
−
24
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
assets/js/language_cookie.set-cookie.js
0 → 100644
+
18
−
0
Options
/**
* @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