Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
80e21252
Commit
80e21252
authored
Mar 07, 2024
by
Ased Mammad
Browse files
add missing types
parent
7031aa14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/lib/i18n/index.ts
src/lib/i18n/index.ts
+5
-3
No files found.
src/lib/i18n/index.ts
View file @
80e21252
...
@@ -4,7 +4,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
...
@@ -4,7 +4,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
import
type
{
i18n
as
i18nType
}
from
'
i18next
'
;
import
type
{
i18n
as
i18nType
}
from
'
i18next
'
;
import
{
writable
}
from
'
svelte/store
'
;
import
{
writable
}
from
'
svelte/store
'
;
const
createI18nStore
=
(
i18n
:
i18n
)
=>
{
const
createI18nStore
=
(
i18n
:
i18n
Type
)
=>
{
const
i18nWritable
=
writable
(
i18n
);
const
i18nWritable
=
writable
(
i18n
);
i18n
.
on
(
'
initialized
'
,
()
=>
{
i18n
.
on
(
'
initialized
'
,
()
=>
{
...
@@ -20,7 +20,7 @@ const createI18nStore = (i18n: i18n) => {
...
@@ -20,7 +20,7 @@ const createI18nStore = (i18n: i18n) => {
return
i18nWritable
;
return
i18nWritable
;
};
};
const
createIsLoadingStore
=
(
i18n
:
i18n
)
=>
{
const
createIsLoadingStore
=
(
i18n
:
i18n
Type
)
=>
{
const
isLoading
=
writable
(
false
);
const
isLoading
=
writable
(
false
);
// if loaded resources are empty || {}, set loading to true
// if loaded resources are empty || {}, set loading to true
...
@@ -39,7 +39,9 @@ const createIsLoadingStore = (i18n: i18n) => {
...
@@ -39,7 +39,9 @@ const createIsLoadingStore = (i18n: i18n) => {
i18next
i18next
.
use
(
.
use
(
resourcesToBackend
((
language
,
namespace
)
=>
import
(
`./locales/
${
language
}
/
${
namespace
}
.json`
))
resourcesToBackend
(
(
language
:
string
,
namespace
:
string
)
=>
import
(
`./locales/
${
language
}
/
${
namespace
}
.json`
)
)
)
)
.
use
(
LanguageDetector
)
.
use
(
LanguageDetector
)
.
init
({
.
init
({
...
...
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