Announcement

Collapse
No announcement yet.

Formular: Translation for entity name?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formular: Translation for entity name?

    How could I translate the entity name of a custom entity?
    I tried:
    Code:
    language\translate('customEntityName','scopeNames','Global') ;
    but that did not work.

  • #2
    I don`t know, if it works with scope names (entities), but perhaps with string\replace?

    Comment


    • #3
      Scopes are named (as well as entity types) in UpperCamelCase in the system: https://docs.espocrm.com/administrat...g/#entity-type. Should be
      CustomEntityName.

      Comment


      • #4
        Thanks yuri, my bad: I already used correct UpperCamelCase since I retrieve the entity name from the parentType field but does not return the expected translation.
        So should
        Code:
        language\translate('CustomEntityName','scopeNames' ,'Global') ;
        work in you opinion or do I need to use different values for CATEGORY, SCOPE?

        Comment


        • #5
          It should work. 3rd argument can be omitted here. Note, that this function translates to the system language (set in Administration > System > Language).

          Comment

          Working...
          X