mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-01 08:12:32 +00:00
potential fix for missing initial locale
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
updateSelectionFromKey
|
||||
} from '$lib/stores';
|
||||
import { selectAll, selection } from '$lib/components/file-list/Selection';
|
||||
import { derived, get } from 'svelte/store';
|
||||
import { derived } from 'svelte/store';
|
||||
import { canUndo, canRedo, dbUtils, fileObservers, settings } from '$lib/db';
|
||||
import { anySelectedLayer } from '$lib/components/layer-control/utils';
|
||||
import { defaultOverlays } from '$lib/assets/layers';
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import type { Coordinates } from "gpx";
|
||||
import { TrackPoint, distance } from "gpx";
|
||||
import { get, writable } from "svelte/store";
|
||||
import { derived, get, writable } from "svelte/store";
|
||||
import { settings } from "$lib/db";
|
||||
import { _ } from "svelte-i18n";
|
||||
import { _, locale } from "svelte-i18n";
|
||||
import { map } from "$lib/stores";
|
||||
|
||||
const { routing, routingProfile, privateRoads } = settings;
|
||||
@@ -20,11 +20,13 @@ export const routingProfileSelectItem = writable({
|
||||
value: '',
|
||||
label: ''
|
||||
});
|
||||
routingProfile.subscribe((value) => {
|
||||
if (value !== get(routingProfileSelectItem).value) {
|
||||
|
||||
derived([routingProfile, locale], ([profile, l]) => [profile, l]).subscribe(([profile, l]) => {
|
||||
console.log(profile, l);
|
||||
if (profile !== get(routingProfileSelectItem).value && l !== null) {
|
||||
routingProfileSelectItem.update((item) => {
|
||||
item.value = value;
|
||||
item.label = get(_)(`toolbar.routing.activities.${value}`);
|
||||
item.value = profile;
|
||||
item.label = get(_)(`toolbar.routing.activities.${profile}`);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user