Skip to content

Commit

Permalink
Move i18n init
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Apr 7, 2024
1 parent 0994cf0 commit a697f40
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
14 changes: 6 additions & 8 deletions ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import '../node_modules/quill/dist/quill.core.css';
import '../node_modules/quill/dist/quill.snow.css';
import Navaid from 'navaid';
import { onDestroy, onMount } from 'svelte';
import { onDestroy } from 'svelte';
import { AppConfig, appRoutes } from './config';
import apiclient from './apiclient';
Expand Down Expand Up @@ -34,12 +34,12 @@
import WarriorProfile from './pages/user/UserProfile.svelte';
import { setLocale } from './i18n/i18n-svelte';
import { detectLocale } from './i18n/i18n-util';
import { loadLocaleAsync } from './i18n/i18n-util.async';
import Confirmation from './pages/subscription/Confirmation.svelte';
import Pricing from './pages/subscription/Pricing.svelte';
import PrivacyPolicy from './pages/support/PrivacyPolicy.svelte';
import TermsConditions from './pages/support/TermsConditions.svelte';
import Support from './pages/support/Support.svelte';
import { loadLocale } from './i18n/i18n-util.sync';
const {
FeaturePoker,
Expand All @@ -55,6 +55,10 @@
activeWarrior = w;
});
const detectedLocale = activeWarrior.locale || detectLocale();
loadLocale(detectedLocale);
setLocale(detectedLocale);
$: if (document.dir !== $dir) {
document.dir = $dir;
}
Expand Down Expand Up @@ -534,12 +538,6 @@
});
}
onMount(async () => {
const detectedLocale = activeWarrior.locale || detectLocale();
await loadLocaleAsync(detectedLocale);
setLocale(detectedLocale);
});
onDestroy(router.unlisten);
</script>

Expand Down
34 changes: 17 additions & 17 deletions ui/src/components/poker/AddStory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
export let planId = '';
export let planName = '';
export let planType = '';
export let planType = `${$LL.planTypeStory()}`;
export let referenceId = '';
export let planLink = '';
export let description = '';
Expand Down Expand Up @@ -201,14 +201,14 @@
{#if descriptionExpanded}
<div class="mb-2">
<div class="bg-white">
{#await import('../Editor.svelte') then Editor}
<Editor.default
content="{description}"
placeholder="{$LL.planDescriptionPlaceholder()}"
id="storyDescription"
handleTextChange="{c => (description = c)}"
/>
{/await}
<!--{#await import('../Editor.svelte') then Editor}-->
<!-- <Editor.default-->
<!-- content="{description}"-->
<!-- placeholder="{$LL.planDescriptionPlaceholder()}"-->
<!-- id="storyDescription"-->
<!-- handleTextChange="{c => (description = c)}"-->
<!-- />-->
<!--{/await}-->
</div>
</div>
{/if}
Expand All @@ -232,14 +232,14 @@
{#if acceptanceExpanded}
<div class="mb-2">
<div class="bg-white">
{#await import('../Editor.svelte') then Editor}
<Editor.default
content="{acceptanceCriteria}"
placeholder="{$LL.planAcceptanceCriteriaPlaceholder()}"
id="acceptanceCriteria"
handleTextChange="{c => (acceptanceCriteria = c)}"
/>
{/await}
<!--{#await import('../Editor.svelte') then Editor}-->
<!-- <Editor.default-->
<!-- content="{acceptanceCriteria}"-->
<!-- placeholder="{$LL.planAcceptanceCriteriaPlaceholder()}"-->
<!-- id="acceptanceCriteria"-->
<!-- handleTextChange="{c => (acceptanceCriteria = c)}"-->
<!-- />-->
<!--{/await}-->
</div>
</div>
{/if}
Expand Down

0 comments on commit a697f40

Please sign in to comment.