mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-07-28 14:18:39 +00:00
Compare commits
4 Commits
9e7788f543
..
l10n
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e8b2d6f30 | |||
| 5259d007c9 | |||
| cb36725a46 | |||
| deef1bab47 |
@@ -21,6 +21,7 @@
|
|||||||
import { selection } from '$lib/logic/selection';
|
import { selection } from '$lib/logic/selection';
|
||||||
import { untrack } from 'svelte';
|
import { untrack } from 'svelte';
|
||||||
import { isSelected, toggle } from '$lib/components/map/layer-control/utils';
|
import { isSelected, toggle } from '$lib/components/map/layer-control/utils';
|
||||||
|
import { boundsManager } from '$lib/logic/bounds';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
useHash = true,
|
useHash = true,
|
||||||
@@ -90,6 +91,7 @@
|
|||||||
fileStateCollection.setEmbeddedFiles(files);
|
fileStateCollection.setEmbeddedFiles(files);
|
||||||
$fileOrder = ids;
|
$fileOrder = ids;
|
||||||
selection.selectAll();
|
selection.selectAll();
|
||||||
|
boundsManager.fitBoundsOnLoad(ids);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
type Dictionary = {
|
type Dictionary = {
|
||||||
[key: string]: string | Dictionary;
|
[key: string]: string | Dictionary;
|
||||||
};
|
};
|
||||||
@@ -10,6 +12,7 @@ function getDateFormatter(locale: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Locale {
|
class Locale {
|
||||||
|
private _store = writable(this);
|
||||||
private _lang = $state('');
|
private _lang = $state('');
|
||||||
private _isLoadingInitial = $state(true);
|
private _isLoadingInitial = $state(true);
|
||||||
private _isLoading = $state(true);
|
private _isLoading = $state(true);
|
||||||
@@ -38,6 +41,7 @@ class Locale {
|
|||||||
}
|
}
|
||||||
import(`../locales/${this._lang}.json`).then((module) => {
|
import(`../locales/${this._lang}.json`).then((module) => {
|
||||||
this.dictionary = module.default;
|
this.dictionary = module.default;
|
||||||
|
this._store.set(this);
|
||||||
if (this._isLoadingInitial) {
|
if (this._isLoadingInitial) {
|
||||||
this._isLoadingInitial = false;
|
this._isLoadingInitial = false;
|
||||||
}
|
}
|
||||||
@@ -67,6 +71,10 @@ class Locale {
|
|||||||
public get df() {
|
public get df() {
|
||||||
return this._df;
|
return this._df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public subscribe(run: (value: Locale) => void, invalidate?: (value?: Locale) => void) {
|
||||||
|
return this._store.subscribe(run, invalidate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const i18n = new Locale();
|
export const i18n = new Locale();
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ export const languages: Record<string, string> = {
|
|||||||
nl: 'Nederlands',
|
nl: 'Nederlands',
|
||||||
'pt-BR': 'Português (Brasil)',
|
'pt-BR': 'Português (Brasil)',
|
||||||
tr: 'Türkçe',
|
tr: 'Türkçe',
|
||||||
|
uk: 'Українська',
|
||||||
zh: '简体中文',
|
zh: '简体中文',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user