diff --git a/src/components/EasyDBDetailView.svelte b/src/components/EasyDBDetailView.svelte
index e1babba..10d3056 100644
--- a/src/components/EasyDBDetailView.svelte
+++ b/src/components/EasyDBDetailView.svelte
@@ -3,18 +3,21 @@
import { pregen_instance } from "../lib/easydbPregen";
import { maskObj } from "../lib/easydbHelpers";
import { setContext } from "svelte";
- import { appLanguageStore, easydbInstanceStore, easydbDataPromiseStore } from "../lib/stores";
+ import { appLanguageStore, dataLanguagesStore, easydbInstanceStore, easydbDataPromiseStore } from "../lib/stores";
import RecursiveEasyDbDetailView from "./RecursiveEasyDBDetailView.svelte";
export let uuid = "";
export let appLanguage = "de-DE";
- export let easydb_instance = pregen_instance;
+ export let dataLanguages = ["de-DE", "en-US"];
+ export let easydbInstance = pregen_instance;
$: appLanguageStore.set(appLanguage);
- $: easydbInstanceStore.set(easydb_instance);
+ $: dataLanguagesStore.set(dataLanguages);
+ $: easydbInstanceStore.set(easydbInstance);
setContext("appLanguage", appLanguageStore);
+ setContext("dataLanguages", dataLanguagesStore);
{#await $easydbDataPromiseStore }
diff --git a/src/components/L10nTextField.svelte b/src/components/L10nTextField.svelte
index 43d0813..d2594b7 100644
--- a/src/components/L10nTextField.svelte
+++ b/src/components/L10nTextField.svelte
@@ -7,7 +7,7 @@
export let field;
export let table;
- const lang = getContext("appLanguage");
+ const lang = getContext("dataLanguages")[0];
{bestLanguage(fieldData(data, table, field), $lang)}
diff --git a/src/components/Link.svelte b/src/components/Link.svelte
index fba3709..cbd800c 100644
--- a/src/components/Link.svelte
+++ b/src/components/Link.svelte
@@ -9,7 +9,7 @@
export let data;
export let table;
- const lang = getContext("appLanguage");
+ const lang = getContext("dataLanguages")[0];
const fdata = fieldData(data, table, field);
diff --git a/src/components/OnelineL10nTextField.svelte b/src/components/OnelineL10nTextField.svelte
index 69b539f..5f4094b 100644
--- a/src/components/OnelineL10nTextField.svelte
+++ b/src/components/OnelineL10nTextField.svelte
@@ -7,7 +7,7 @@
export let field;
export let table;
- const lang = getContext("appLanguage");
+ const lang = getContext("dataLanguages")[0];
{bestLanguage(fieldData(data, table, field), $lang)}
diff --git a/src/lib/stores.js b/src/lib/stores.js
index cbc1fce..01d839c 100644
--- a/src/lib/stores.js
+++ b/src/lib/stores.js
@@ -21,9 +21,12 @@ async function pregenDefaults() {
};
}
-// This manages the global state of the current language
+// This manages the global state of the current app language
export const appLanguageStore = writable(null);
+// This manages the global state of the current data language
+export const dataLanguagesStore = writable(null);
+
// This manages the global state of the EasyDB instance we are talking to
export const easydbInstanceStore = writable(null);