adminjs
adminjs copied to clipboard
rename child fields
Is it possible to rename the child fields of the displayed tables?
I want rename filed cart.totalQty but I can't
locale: {
language: 'en',
translations: {
resources: {
Order: { // or whatever the resource id is
properties: {
'cart.totalQty': 'Total Quantity'
}
}
}
}
}
This should work, theoretically. https://docs.adminjs.co/tutorials/internationalization-i18n
@dziraf I want to rename a label, but despite reading all the issues and the docs about using locale, I still can't get the desired result. This is my code:
const organizationSchema = new Schema({
phone: { type: String }
})
export const Organization = model('Organization', organizationSchema)
import AdminJS from 'adminjs'
import { Database, Resource } from '@adminjs/mongoose'
import { Organization } from '../models/organization.js'
AdminJS.registerAdapter({ Database, Resource })
new AdminJS({
resources: [Organization],
locale: {
language: 'en',
translations: {
resources: {
Organization: {
properties: {
phone: 'something else'
}
}
}
}
}
}