Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Joe T.S.
3dgeovisclient
Commits
2ab0e1ad
Commit
2ab0e1ad
authored
Feb 23, 2021
by
Patrick
Browse files
language selector based on browser
parent
b77c43d2
Pipeline
#1988
passed with stage
in 38 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
public/rgc_website/index.html
View file @
2ab0e1ad
...
...
@@ -61,9 +61,9 @@
</select>
</div> -->
<select
class=
"selectpicker"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: #cc3125; width: 10em; border-color:#cc3125;"
data-width=
"fit"
>
<option
class=
"selectlang"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: white;"
>
English
</option>
<option
class=
"selectlang"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: white;"
>
Deutsch
</option>
<select
id=
"selectpicker1"
class=
"selectpicker"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: #cc3125; width: 10em; border-color:#cc3125;"
data-width=
"fit"
>
<option
value=
'1'
class=
"selectlang"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: white;"
>
English
</option>
<option
value=
'2'
class=
"selectlang"
data-img-src=
"imgs/flags/226-united-states.png"
style=
"background-color: white;"
>
Deutsch
</option>
</select>
<!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader"
aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
...
...
public/rgc_website/js/add_content.js
View file @
2ab0e1ad
...
...
@@ -9,9 +9,9 @@ function addcontent(item){
YouTubeHTML
=
`<a class="btn btn-sm btn-outline-danger" href="
${
YouTubelink
}
">YouTube</a>`
}
var
description
=
""
if
(
lang_setting
==
"
English
"
){
if
(
lang_setting
==
"
1
"
){
description
=
item
.
item
.
description_en
}
else
if
(
lang_setting
==
"
Deutsch
"
){
}
else
if
(
lang_setting
==
"
2
"
){
description
=
item
.
item
.
description_de
}
// Prepare Explore Link
...
...
public/rgc_website/js/language.js
View file @
2ab0e1ad
...
...
@@ -16,7 +16,7 @@ $('.selectpicker').change(function(){
// alert($(this).val());
})
var
lang_setting
=
"
English
"
var
lang_setting
=
"
2
"
function
language
(
lang
){
//Change the language settings of the general Elements
...
...
public/rgc_website/js/search.js
View file @
2ab0e1ad
...
...
@@ -49,8 +49,23 @@ $(document).ready(function(){
//Do something
}
});
var
userLang
=
navigator
.
language
||
navigator
.
userLanguage
;
console
.
log
(
"
The language is:
"
+
userLang
);
if
(
userLang
.
includes
(
"
de
"
)){
console
.
log
(
true
)
var
select1
=
document
.
getElementById
(
'
selectpicker1
'
);
console
.
log
(
select1
)
select1
.
value
=
"
2
"
;
select1
.
dispatchEvent
(
new
Event
(
'
change
'
));
}
});
// window.onload = function () {
// var e = document.getElementById("selectpicker1");
// e.value = 2;
// e.dispatchEvent(new Event('change'));
// };
// searchbar and start search
function
searchToggle
(
obj
,
evt
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment