Skip to content

Commit 7473c23

Browse files
committed
fix(settings): translate pronounce account property
Template string is not working. Additionally migrate to Typescript and directly import `t` method. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 57a375c commit 7473c23

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

apps/settings/src/components/PersonalInfo/PronounsSection.vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
:placeholder="randomPronounsPlaceholder" />
99
</template>
1010

11-
<script>
12-
import { loadState } from '@nextcloud/initial-state'
11+
<script lang="ts">
12+
import type { IAccountProperty } from '../../constants/AccountPropertyConstants.ts'
1313
14+
import { loadState } from '@nextcloud/initial-state'
15+
import { t } from '@nextcloud/l10n'
16+
import { defineComponent } from 'vue'
1417
import AccountPropertySection from './shared/AccountPropertySection.vue'
18+
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.ts'
1519
16-
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'
17-
18-
const { pronouns } = loadState('settings', 'personalInfoParameters', {})
20+
const { pronouns } = loadState<{ pronouns: IAccountProperty }>('settings', 'personalInfoParameters')
1921
20-
export default {
22+
export default defineComponent({
2123
name: 'PronounsSection',
2224
2325
components: {
@@ -33,13 +35,13 @@ export default {
3335
computed: {
3436
randomPronounsPlaceholder() {
3537
const pronouns = [
36-
this.t('settings', 'she/her'),
37-
this.t('settings', 'he/him'),
38-
this.t('settings', 'they/them'),
38+
t('settings', 'she/her'),
39+
t('settings', 'he/him'),
40+
t('settings', 'they/them'),
3941
]
4042
const pronounsExample = pronouns[Math.floor(Math.random() * pronouns.length)]
41-
return this.t('settings', `Your pronouns. E.g. ${pronounsExample}`, { pronounsExample })
43+
return t('settings', 'Your pronouns. E.g. {pronounsExample}', { pronounsExample })
4244
},
4345
},
44-
}
46+
})
4547
</script>

0 commit comments

Comments
 (0)