Skip to content

Commit

Permalink
Rename l10n -> appLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Jul 18, 2024
1 parent 36e64e3 commit dceabc7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{ value: 'de-DE', name: 'Deutsch'},
{ value: 'en-US', name: 'English'},
];
let selected_language = 'de-DE';
let selected_app_language = 'de-DE';
</script>

<main class="container mx-auto">
Expand Down Expand Up @@ -53,13 +53,13 @@
</div>
<div class="space-y-2 p-4">
<Label>
Language:
Application Language:
</Label>
<Select class="w-full" items={languages} bind:value={selected_language} />
<Select class="w-full" items={languages} bind:value={selected_app_language} />
</div>
</div>
<div class="w-1/2 p-4 border border-gray-300">
<EasyDbDetailView uuid={uuid} l10n={selected_language} easydb_instance={instance} />
<EasyDbDetailView uuid={uuid} appLanguage={selected_app_language} easydb_instance={instance} />
</div>
</div>
</main>
8 changes: 4 additions & 4 deletions src/components/EasyDBDetailView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import { pregen_instance } from "../lib/easydbPregen";
import { maskObj } from "../lib/easydbHelpers";
import { setContext } from "svelte";
import { l10nStore, easydbDataStore, easydbInstanceStore, easydbDataPromiseStore } from "../lib/stores";
import { appLanguageStore, easydbInstanceStore, easydbDataPromiseStore } from "../lib/stores";
import RecursiveEasyDbDetailView from "./RecursiveEasyDBDetailView.svelte";
export let uuid = "";
export let l10n = "de-DE";
export let appLanguage = "de-DE";
export let easydb_instance = pregen_instance;
$: l10nStore.set(l10n);
$: appLanguageStore.set(appLanguage);
$: easydbInstanceStore.set(easydb_instance);
setContext("l10n", l10nStore);
setContext("appLanguage", appLanguageStore);
</script>

{#await $easydbDataPromiseStore }
Expand Down
2 changes: 1 addition & 1 deletion src/components/FieldLabel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export let field;
export let table;
let lang = getContext("l10n");
let lang = getContext("appLanguage");
</script>

<span class="text-sm easydb-label">{fieldLabel(table, field, $lang)}</span>
2 changes: 1 addition & 1 deletion src/components/L10nTextField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let field;
export let table;
const lang = getContext("l10n");
const lang = getContext("appLanguage");
</script>

<span class="easydb-l10n-text-field">{bestLanguage(fieldData(data, table, field), $lang)}</span>
2 changes: 1 addition & 1 deletion src/components/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let data;
export let table;
const lang = getContext("l10n");
const lang = getContext("appLanguage");
const fdata = fieldData(data, table, field);
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/OnelineL10nTextField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let field;
export let table;
const lang = getContext("l10n");
const lang = getContext("appLanguage");
</script>

<span class="easydb-oneline-l10n-text-field">{bestLanguage(fieldData(data, table, field), $lang)}</span>
2 changes: 1 addition & 1 deletion src/components/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let table;
const options = JSON.parse(fields[0].options);
const lang = getContext("l10n");
const lang = getContext("appLanguage");
</script>

{#if hasContent(data, table, fields)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/RecursiveEasyDBDetailView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let table;
export let label = true;
const lang = getContext("l10n");
const lang = getContext("appLanguage");
const firstField = fields[0];
let tab_is_open = false;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export let table;
export let open;
const lang = getContext("l10n");
const lang = getContext("appLanguage");
const options = JSON.parse(fields[0].options);
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function pregenDefaults() {
}

// This manages the global state of the current language
export const l10nStore = writable(null);
export const appLanguageStore = writable(null);

// This manages the global state of the EasyDB instance we are talking to
export const easydbInstanceStore = writable(null);
Expand Down

0 comments on commit dceabc7

Please sign in to comment.