Skip to content

Commit 5bba8a7

Browse files
committed
fix(i18n): localize tray name, heatmap labels, tour step text and function-default props
1 parent 00a67ac commit 5bba8a7

42 files changed

Lines changed: 141 additions & 166 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/components/ErrorBoundary.vue‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
}
8181
8282
const props = withDefaults(defineProps<Props>(), {
83-
fallbackTitle: () => t('general.errorBoundary.title'),
84-
fallbackMessage: () => t('general.errorBoundary.message'),
83+
fallbackTitle: '',
84+
fallbackMessage: '',
8585
showDetails: false,
8686
showReportButton: true,
8787
});
@@ -106,7 +106,7 @@
106106
if (error.value?.name === 'NetworkError') {
107107
return t('general.errorBoundary.networkTitle');
108108
}
109-
return props.fallbackTitle;
109+
return props.fallbackTitle || t('general.errorBoundary.title');
110110
});
111111
112112
const errorMessage = computed(() => {
@@ -119,7 +119,7 @@
119119
if (error.value?.message) {
120120
return error.value.message;
121121
}
122-
return props.fallbackMessage;
122+
return props.fallbackMessage || t('general.errorBoundary.message');
123123
});
124124
125125
const errorDetails = computed(() => {

‎src/components/general/Breadcrumbs.vue‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="card flex flex-col transition duration-300 ease-in-out">
33
<div class="card-body">
44
<nav :aria-label="$t('general.breadcrumbs.label')" class="text-left">
5-
<ol v-if="current" class="breadcrumb md:flex">
5+
<ol v-if="currentText" class="breadcrumb md:flex">
66
<li
77
v-for="(item, i) in items"
88
:key="i"
@@ -20,7 +20,7 @@
2020
aria-current="page"
2121
class="breadcrumb-item active inline font-bold md:mx-1"
2222
>
23-
{{ current }}
23+
{{ currentText }}
2424
</li>
2525
</ol>
2626

@@ -47,19 +47,24 @@
4747
title: {
4848
required: false,
4949
type: String,
50-
default: () => t('general.breadcrumbs.title'),
50+
default: '',
5151
},
5252
current: {
5353
required: false,
5454
type: String,
55-
default: () => t('general.breadcrumbs.currentPage'),
55+
default: '',
5656
},
5757
drop: {
5858
type: Function,
5959
required: false,
6060
default: () => () => {},
6161
},
6262
},
63+
computed: {
64+
currentText() {
65+
return this.current || t('general.breadcrumbs.currentPage');
66+
},
67+
},
6368
};
6469
</script>
6570

‎src/components/general/ConfirmByNameDialog.vue‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import { t } from '@/i18n';
32
import {
43
AlertDialog,
54
AlertDialogCancel,
@@ -32,10 +31,7 @@
3231
title: { type: String, required: true },
3332
description: { type: String, default: '' },
3433
expectedName: { type: String, required: true },
35-
confirmLabel: {
36-
type: String,
37-
default: () => t('common.actions.confirm'),
38-
},
34+
confirmLabel: { type: String, default: '' },
3935
busy: { type: Boolean, default: false },
4036
},
4137
emits: ['update:open', 'confirm'],
@@ -90,7 +86,7 @@
9086
$t('common.actions.cancel')
9187
}}</AlertDialogCancel>
9288
<Button variant="destructive" :disabled="!canConfirm" @click="confirm">
93-
{{ confirmLabel }}
89+
{{ confirmLabel || $t('common.actions.confirm') }}
9490
</Button>
9591
</AlertDialogFooter>
9692
</AlertDialogContent>

‎src/components/general/HeatmapCalendar.vue‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@
119119

120120
<script>
121121
import { t } from '@/i18n';
122-
import {
123-
activityCountLabel,
124-
formatDayLabel,
125-
} from '@/utils/dashboard/activityDayFilter';
122+
import { formatDayLabel } from '@/utils/dashboard/activityDayFilter';
126123
import {
127124
buildHeatmapWeeks,
128125
heatmapHeadline,
@@ -390,10 +387,11 @@
390387
},
391388
392389
getDayLabel(day) {
393-
return t('general.heatmapCalendar.dayLabel', {
394-
activity: activityCountLabel(day.count),
395-
date: formatDayLabel(day.date),
396-
});
390+
return t(
391+
'general.heatmapCalendar.dayLabel',
392+
{ date: formatDayLabel(day.date) },
393+
day.count,
394+
);
397395
},
398396
399397
getTooltipText(day) {

‎src/components/general/Select.vue‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<vue-select
88
:label="labelKey"
99
:options="preparedOptions"
10-
:placeholder="placeholder"
10+
:placeholder="placeholder || $t('general.select.placeholder')"
1111
v-model="value"
1212
:clearable="false"
1313
:class="{ 'red-placeholder': hasError }"
@@ -27,7 +27,6 @@
2727
</template>
2828

2929
<script setup lang="ts">
30-
import { t } from '@/i18n';
3130
import VueSelect from '@/plugins/VueSelect';
3231
import { computed } from 'vue';
3332
@@ -53,7 +52,7 @@
5352
const props = withDefaults(defineProps<Props>(), {
5453
labelKey: 'label',
5554
valueKey: 'value',
56-
placeholder: () => t('general.select.placeholder'),
55+
placeholder: '',
5756
showErrorInTooltip: true,
5857
selectClass: '',
5958
});

‎src/components/general/TextField.vue‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
hasError && '!border-red-500 placeholder:text-red-400',
99
]"
1010
:name="name"
11-
:placeholder="placeholder"
11+
:placeholder="placeholder || $t('general.textField.placeholder')"
1212
v-model="value"
1313
:readonly="readonly"
1414
/>
@@ -26,7 +26,6 @@
2626
</template>
2727

2828
<script setup lang="ts">
29-
import { t } from '@/i18n';
3029
import { computed } from 'vue';
3130
3231
const tooltipClasses = [
@@ -49,7 +48,7 @@
4948
const props = withDefaults(defineProps<Props>(), {
5049
type: 'text',
5150
name: 'text',
52-
placeholder: () => t('general.textField.placeholder'),
51+
placeholder: '',
5352
showErrorInTooltip: true,
5453
inputClass: '',
5554
});

‎src/components/onboarding/CopyCommand.vue‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<div :class="rowClass">
44
<pre
5-
:aria-label="label"
5+
:aria-label="labelText"
66
:class="[
77
textClass,
88
'rounded-md border border-line bg-surface-sunken px-3 py-3 font-mono text-xs text-ink',
@@ -17,7 +17,9 @@
1717
]"
1818
data-testid="snippet-copy"
1919
:disabled="!code"
20-
:aria-label="$t('onboarding.copyCommand.copyLabel', { label })"
20+
:aria-label="
21+
$t('onboarding.copyCommand.copyLabel', { label: labelText })
22+
"
2123
@click="copy"
2224
>
2325
{{ copied ? $t('common.actions.copied') : $t('common.actions.copy') }}
@@ -47,10 +49,7 @@
4749
props: {
4850
code: { type: String, required: true },
4951
display: { type: String, default: undefined },
50-
label: {
51-
type: String,
52-
default: () => t('onboarding.copyCommand.defaultLabel'),
53-
},
52+
label: { type: String, default: '' },
5453
client: { type: String, default: '' },
5554
emitEvent: { type: Boolean, default: true },
5655
wrap: { type: Boolean, default: false },
@@ -85,6 +84,9 @@
8584
copied,
8685
failed,
8786
copy,
87+
labelText: computed(
88+
() => props.label || t('onboarding.copyCommand.defaultLabel'),
89+
),
8890
rowClass: SNIPPET_ROW_CLASS,
8991
buttonClass: SNIPPET_BUTTON_CLASS,
9092
textClass: computed(() => snippetTextClass(props.wrap)),

‎src/components/onboarding/StillWaiting.vue‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
{{ $t('onboarding.stillWaiting.intro') }}
1212
</p>
1313
<ol class="space-y-2 mt-3 list-decimal pl-5">
14-
<li>{{ $t('onboarding.stillWaiting.runCommand', { client }) }}</li>
14+
<li>
15+
{{ $t('onboarding.stillWaiting.runCommand', { client: clientName }) }}
16+
</li>
1517
<li>{{ $t('onboarding.stillWaiting.restart') }}</li>
1618
<i18n-t
1719
v-if="verifyCommand"
@@ -66,12 +68,14 @@
6668
name: 'StillWaiting',
6769
components: { CommandChip },
6870
props: {
69-
client: {
70-
type: String,
71-
default: () => t('onboarding.stillWaiting.defaultClient'),
72-
},
71+
client: { type: String, default: '' },
7372
verifyCommand: { type: String, default: '' },
7473
},
7574
emits: ['check-again', 'different-client', 'later'],
75+
computed: {
76+
clientName() {
77+
return this.client || t('onboarding.stillWaiting.defaultClient');
78+
},
79+
},
7680
});
7781
</script>

‎src/locales/de/general.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"fri": "Fr"
6464
},
6565
"contributionsOn": "{n} Beitrag am {date} | {n} Beiträge am {date}",
66-
"dayLabel": "{activity} am {date}"
66+
"dayLabel": "{n} Aktivität am {date} | {n} Aktivitäten am {date}"
6767
},
6868
"countdown": {
6969
"editHint": "Doppelklicken, um die Zeit zu bearbeiten",

‎src/locales/de/onboarding.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
}
7575
},
7676
"keycaps": {
77-
"systemTray": "Infobereich",
7877
"fallback": "dein Kürzel für {name} (Einstellungen → Desktop)",
7978
"shortcuts": {
8079
"quickAdd": "Schnell hinzufügen",
@@ -226,7 +225,9 @@
226225
},
227226
"s2": {
228227
"title": "Fenster schließen",
229-
"body": "Wenn du das Fenster schließt, läuft TMGR im {'{'}tray{'}'} weiter."
228+
"body": "Wenn du das Fenster schließt, läuft TMGR in der Menüleiste weiter.",
229+
"bodyMacos": "Wenn du das Fenster schließt, läuft TMGR in der Menüleiste weiter.",
230+
"bodyOther": "Wenn du das Fenster schließt, läuft TMGR im Infobereich weiter."
230231
}
231232
}
232233
},

0 commit comments

Comments
 (0)