adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

rename child fields

Open dangtthuynhi opened this issue 2 years ago • 2 comments

Is it possible to rename the child fields of the displayed tables? image I want rename filed cart.totalQty but I can't

dangtthuynhi avatar Dec 17 '22 06:12 dangtthuynhi

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 avatar Dec 21 '22 08:12 dziraf

@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'
          }
        }
      }
    }
  }
}

petrakoww avatar Aug 23 '23 09:08 petrakoww