Spaces:
Sleeping
Sleeping
Synced repo using 'sync_with_huggingface' Github Action
Browse files
client/js/change-language.js
CHANGED
@@ -3,8 +3,8 @@ document.addEventListener('DOMContentLoaded', fetchLanguages);
|
|
3 |
async function fetchLanguages() {
|
4 |
try {
|
5 |
const [languagesResponse, currentLanguageResponse] = await Promise.all([
|
6 |
-
fetch(
|
7 |
-
fetch(
|
8 |
]);
|
9 |
|
10 |
const languages = await languagesResponse.json();
|
@@ -30,7 +30,7 @@ function setLanguageOnPageLoad(language) {
|
|
30 |
}
|
31 |
|
32 |
function changeLanguage(lang) {
|
33 |
-
fetch(
|
34 |
method: "POST",
|
35 |
headers: {
|
36 |
"Content-Type": "application/json",
|
|
|
3 |
async function fetchLanguages() {
|
4 |
try {
|
5 |
const [languagesResponse, currentLanguageResponse] = await Promise.all([
|
6 |
+
fetch(`${url_prefix}/get-languages`),
|
7 |
+
fetch(`${url_prefix}/get-locale`)
|
8 |
]);
|
9 |
|
10 |
const languages = await languagesResponse.json();
|
|
|
30 |
}
|
31 |
|
32 |
function changeLanguage(lang) {
|
33 |
+
fetch(`${url_prefix}/change-language`, {
|
34 |
method: "POST",
|
35 |
headers: {
|
36 |
"Content-Type": "application/json",
|