forked from MapComplete/MapComplete
UI: make WelcomeBack translatable
This commit is contained in:
parent
9a2b5d0cf7
commit
3afb306c49
2 changed files with 29 additions and 21 deletions
|
|
@ -542,6 +542,7 @@
|
||||||
"tuesday": "Tuesday",
|
"tuesday": "Tuesday",
|
||||||
"wednesday": "Wednesday"
|
"wednesday": "Wednesday"
|
||||||
},
|
},
|
||||||
|
"welcomeBack": "Welcome back",
|
||||||
"welcomeExplanation": {
|
"welcomeExplanation": {
|
||||||
"addNew": "Is an item missing? Use the button on the bottom-left to add a new point of interest.",
|
"addNew": "Is an item missing? Use the button on the bottom-left to add a new point of interest.",
|
||||||
"general": "On this map, you can see, edit and add <i>points of interest</i>. Zoom around to see the POI, tap one to see or edit the information. All data is sourced from and saved to OpenStreetMap, which can be freely reused."
|
"general": "On this map, you can see, edit and add <i>points of interest</i>. Zoom around to see the POI, tap one to see or edit the information. All data is sourced from and saved to OpenStreetMap, which can be freely reused."
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,13 @@
|
||||||
import { fade } from "svelte/transition"
|
import { fade } from "svelte/transition"
|
||||||
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
|
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
|
import If from "../Base/If.svelte"
|
||||||
|
import type { Store } from "../../Logic/UIEventSource"
|
||||||
|
import Translations from "../i18n/Translations"
|
||||||
|
import Tr from "../Base/Tr.svelte"
|
||||||
|
|
||||||
let open = false
|
let open = false
|
||||||
export let state: { osmConnection: OsmConnection }
|
export let state: { osmConnection: OsmConnection, featureSwitches: { featureSwitchEnableLogin: Store<boolean> } }
|
||||||
let userdetails = state.osmConnection.userDetails
|
let userdetails = state.osmConnection.userDetails
|
||||||
let username = userdetails.mapD((ud) => ud.name, onDestroy)
|
let username = userdetails.mapD((ud) => ud.name, onDestroy)
|
||||||
username.addCallbackAndRunD((ud) => {
|
username.addCallbackAndRunD((ud) => {
|
||||||
|
|
@ -18,25 +22,28 @@
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Popover
|
<If condition={state.featureSwitches.featureSwitchEnableLogin}>
|
||||||
class="mt-4 hidden sm:block"
|
|
||||||
defaultClass="py-2 px-3 w-fit "
|
<Popover
|
||||||
trigger="null"
|
class="mt-4 hidden sm:block"
|
||||||
placement="bottom"
|
defaultClass="py-2 px-3 w-fit "
|
||||||
transition={(e) => fade(e, { duration: 150 })}
|
trigger="null"
|
||||||
bind:open
|
placement="bottom"
|
||||||
>
|
transition={(e) => fade(e, { duration: 150 })}
|
||||||
{#if $username !== undefined}
|
bind:open
|
||||||
<div style="width: max-content" class="flex items-center">
|
>
|
||||||
{#if $userdetails.img}
|
{#if $username !== undefined}
|
||||||
<img src={$userdetails.img} alt="avatar" class="mr-4 h-10 w-10 rounded-full" />
|
<div style="width: max-content" class="flex items-center">
|
||||||
{/if}
|
{#if $userdetails.img}
|
||||||
<div>
|
<img src={$userdetails.img} alt="avatar" class="mr-4 h-10 w-10 rounded-full" />
|
||||||
<div>Welcome back</div>
|
{/if}
|
||||||
<div class="normal-background" style="width: max-content">
|
<div>
|
||||||
<b>{$username}</b>
|
<Tr t={Translations.t.general.welcomeBack}/>
|
||||||
|
<div class="normal-background" style="width: max-content">
|
||||||
|
<b>{$username}</b>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/if}
|
||||||
{/if}
|
</Popover>
|
||||||
</Popover>
|
</If>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue