diff --git a/l10n/messages.pot b/l10n/messages.pot index ad6eded33..a858a7e9e 100644 --- a/l10n/messages.pot +++ b/l10n/messages.pot @@ -154,6 +154,9 @@ msgstr "" msgid "Upload some content or sync with your devices!" msgstr "" +msgid "You are currently identified as {nickname}." +msgstr "" + msgid "You are currently not identified." msgstr "" diff --git a/lib/components/PublicAuthPrompt.vue b/lib/components/PublicAuthPrompt.vue index d772755c9..cd87c11ec 100644 --- a/lib/components/PublicAuthPrompt.vue +++ b/lib/components/PublicAuthPrompt.vue @@ -52,7 +52,7 @@ export interface PublicAuthPromptProps { const props = withDefaults(defineProps(), { nickname: '', - notice: t('You are currently not identified.'), + notice: '', submitLabel: t('Submit name'), text: '', title: t('Guest identification'), @@ -104,6 +104,20 @@ const buttons = computed(() => { return [submitButton] }) +const defaultNotice = computed(() => { + if (props.notice) { + return props.notice + } + + // If no notice is provided, use a default one + // that changes based on the nickname definition + if (name.value) { + return t('You are currently identified as {nickname}.', { nickname: name.value }) + } + + return t('You are currently not identified.') +}) + /** * Handle saving the nickname and return it. */ @@ -169,7 +183,7 @@ function onSubmit() {