OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform Translating Logging Entity Modifications (AuditField)

This topic contains 2 replies, has 2 voices, and was last updated by  farzam.sayeh 5 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36987

    farzam.sayeh
    Participant

    Hi everyone,

    I want to translate the field names in Logging Modifications that is shown to the user. For example in an entity there is a field named as owner. If it changes in a record, the log will show old owner and new owner with label ‘owner’ (exactly the field name).
    I changed “collKey” to “collKey|trans” in “new.html.twig” and “old.html.twig” in Oro/Bundle/DataAuditBundle/Resources/view/Datagrid/Property.

    So the problem is how should I create translation keys according to bundle name and Entity name for fields? (For example the “owner” field in “AddressBundle/Address”)

    Any suggestion?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36988

    Mike Kudelya
    Participant

    Hi,

    As one of solutions i suggest create new label field in the AuditField entity and call createField function with label. Label you can get from config. Then change call $field->getField() to $field->getLabel() (new function). After that you can translate your field.

    #36989

    farzam.sayeh
    Participant

    Hi Mark,

    Thank you. That was a nice solution. What I did was creating a function using objectClass and field in AbstractAudit class that makes a key for translation. Like orocrm.account.account.owner

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform’ is closed to new topics and replies.

Back to top

You will be redirected to [title]. Would you like to continue?

Yes No

You will be redirected to [title]. Would you like to continue?

Yes No