Replies: 5 comments 1 reply
-
Unfortunately, the syntax of the message format syntax only supports modifiers for linked messages. {
"device": "Device",
"add": "Add @.lower:{'device'}"
} |
Beta Was this translation helpful? Give feedback.
-
If anyone else runs into this issue: I ended up just using a message function: {
add: ({ list }: MessageContext<VueMessageType>) => `Add ${String(list(0)).toLowerCase()}`,
} |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi, Found a Solution: en.json:
|
Beta Was this translation helpful? Give feedback.
-
I got it working in version {
// CRUD
"Create": "Create",
"Update": "Update",
"Delete": "Delete",
// Entity crud
"Create entity": "@:Create @.lower:{entity}",
"Update entity": "@:Update @.lower:{entity}",
"Delete entity": "@:Delete @.lower:{entity}",
// Entities
"User": "User | Users",
} And use it like this: <template>
<div v-text="$t('Create entity', { entity: 'User' })" />
<div v-text="$t('Create entity', { entity: 'User' }, 2)" />
</template> Which results in:
My code: const i18n = createI18n<[MessageSchema], 'en-US'>({
locale: userPreferences.value.lang ?? defaultLocale,
fallbackLocale: 'en-US',
messages: locales,
legacy: false, // I use Vue 3
// silentFallbackWarn: true,
silentTranslationWarn: true
}) Hope this helps anyone! |
Beta Was this translation helpful? Give feedback.
-
Hey, I'm wondering if there is a way to control the capitalization of interpolated messages.
Assuming the following setup:
I'd intend to use it this way:
which would result in the following interpolated message:
While the
de
version is correct, "Device" in theen
version should be lowercase ("Add device" instead of "Add Device"). Is there a way to control this in the message syntax?I'm basically looking for something like the following (based on how it works with linked messages):
Beta Was this translation helpful? Give feedback.
All reactions