mirror of
https://github.com/directus/directus.git
synced 2026-02-11 18:55:01 -05:00
Add singular/plural collection name translations (#5302)
* Add singular/plural options to collection translations * Use singular/plural item names in related values * Use singular / plural names on item detail * Use singular/plural for drawer item * Fix translation
This commit is contained in:
@@ -122,15 +122,18 @@ export default defineComponent({
|
||||
const { info: collectionInfo } = useCollection(collection);
|
||||
|
||||
const title = computed(() => {
|
||||
if (props.primaryKey === '+') {
|
||||
return i18n.t('creating_in', {
|
||||
collection: junctionRelatedCollectionInfo?.value?.name || collectionInfo.value?.name,
|
||||
});
|
||||
const collection = junctionRelatedCollectionInfo?.value || collectionInfo.value!;
|
||||
const isNew = props.primaryKey === '+';
|
||||
|
||||
if (i18n.te(`collection_names_singular.${collection.collection}`)) {
|
||||
return isNew
|
||||
? i18n.t('creating_unit', { unit: i18n.t(`collection_names_singular.${collection.collection}`) })
|
||||
: i18n.t('editing_unit', { unit: i18n.t(`collection_names_singular.${collection.collection}`) });
|
||||
}
|
||||
|
||||
return i18n.t('editing_in', {
|
||||
collection: junctionRelatedCollectionInfo?.value?.name || collectionInfo.value?.name,
|
||||
});
|
||||
return isNew
|
||||
? i18n.t('creating_in', { collection: collection.name })
|
||||
: i18n.t('editing_in', { collection: collection.name });
|
||||
});
|
||||
|
||||
const showDivider = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user