Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
search_api
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
search_api
Merge requests
!2
Issue
#3035977
: Rendered HTML Output doesnt respect activeLanguage completely
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3035977
: Rendered HTML Output doesnt respect activeLanguage completely
issue/search_api-3035977:3035977-rendered-html-output
into
8.x-1.x
Overview
1
Commits
13
Pipelines
9
Changes
4
Open
Emil Johnsson
requested to merge
issue/search_api-3035977:3035977-rendered-html-output
into
8.x-1.x
4 years ago
Overview
1
Commits
13
Pipelines
9
Changes
4
Expand
0
0
Merge request reports
Compare
8.x-1.x
version 13
e06ea585
3 months ago
version 12
16de921c
1 year ago
version 11
d565fcd0
1 year ago
version 10
df1c7f0a
1 year ago
version 9
640eb678
1 year ago
version 8
249fcdfa
1 year ago
version 7
b143896b
1 year ago
version 6
93c255a4
1 year ago
version 5
265ea349
4 years ago
version 4
75a56c52
4 years ago
version 3
265ea349
4 years ago
version 2
d6f3cd5c
4 years ago
version 1
e21aa299
4 years ago
8.x-1.x (base)
and
latest version
latest version
9f651bb6
13 commits,
1 month ago
version 13
e06ea585
12 commits,
3 months ago
version 12
16de921c
11 commits,
1 year ago
version 11
d565fcd0
10 commits,
1 year ago
version 10
df1c7f0a
9 commits,
1 year ago
version 9
640eb678
8 commits,
1 year ago
version 8
249fcdfa
7 commits,
1 year ago
version 7
b143896b
6 commits,
1 year ago
version 6
93c255a4
5 commits,
1 year ago
version 5
265ea349
4 commits,
4 years ago
version 4
75a56c52
5 commits,
4 years ago
version 3
265ea349
4 commits,
4 years ago
version 2
d6f3cd5c
3 commits,
4 years ago
version 1
e21aa299
2 commits,
4 years ago
4 files
+
130
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/Language/StaticLanguageNegotiator.php
0 → 100644
+
51
−
0
Options
<?php
namespace
Drupal\search_api\Language
;
use
Drupal\language\LanguageNegotiator
;
/**
* Provides a language negotiator that allows setting the current language.
*/
class
StaticLanguageNegotiator
extends
LanguageNegotiator
{
/**
* The language code to return for all types.
*
* @var string|null
*/
protected
$languageCode
;
/**
* {@inheritdoc}
*/
public
function
initializeType
(
$type
)
{
$language
=
NULL
;
$method_id
=
static
::
METHOD_ID
;
$availableLanguages
=
$this
->
languageManager
->
getLanguages
();
if
(
$this
->
languageCode
&&
isset
(
$availableLanguages
[
$this
->
languageCode
]))
{
$language
=
$availableLanguages
[
$this
->
languageCode
];
}
else
{
// If no other language was found use the default one.
$language
=
$this
->
languageManager
->
getDefaultLanguage
();
}
return
[
$method_id
=>
$language
];
}
/**
* Sets the language code to return for all types.
*
* @param string|null $langcode
* The language code to set.
*
* @return $this
*/
public
function
setLanguageCode
(
$langcode
)
{
$this
->
languageCode
=
$langcode
;
return
$this
;
}
}
Loading