[CONTEDIT-472] i18n labels for block fields Created: 10/Jan/22  Updated: 01/Jun/23

Status: Open
Project: Content Editor
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Eduard Lehel Reichenberger Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File untitled_tmp-Knowledge-base.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: AuthorX Support
Team: AuthorX

 Description   

When setting a label for a block field from a message bundle the property is displayed instead of the value.

Example:

content.editor.field.label=Field label

label: content.editor.field.label

This will display: "content.editor.field.label" instead of "Field label"



 Comments   
Comment by Lam Nguyen Bao [ 02/Mar/22 ]

Hi ereichenberger ,

Could you please let me know which version is having this problem? 
For the current Content-Editor version (2.x), the i18n key must have "blocks" prefix and be mentioned in:
https://docs.magnolia-cms.com/product-docs/6.2/Apps/Developing-a-custom-content-editor-app/Block-definition.html#_block_definition

Comment by Eduard Lehel Reichenberger [ 02/Mar/22 ]

Hello lam.nguyen,

I am using version 2.0.1

I tried adding the blocks prefix.

These are my labels:

blocks.champion.systems.imageBlock.label=Image block
blocks.champion.systems.imageCaption.label=Caption
blocks.champion.systems.imageAlt.label=Image alt
blocks.champion.systems.image.label=Image 

I am using labels from this file in content apps and they work fine

This is my block definition:

templateId: module-template:blocks/image
block:
  label: blocks.champion.systems.imageBlock.label
  properties:
    image:
      $type: damLinkField
      label: blocks.champion.systems.image.label
      required: true
    altText:
      $type: textField
      label: blocks.champion.systems.imageAlt.label
      i18n: true
      required: true
    caption:
      $type: textField
      label: blocks.champion.systems.imageCaption.label
      i18n: true 

And this is how they show up in the content app:

Comment by Lam Nguyen Bao [ 03/Mar/22 ]

Hi ereichenberger,

I have checked and see that the blocks prefix does not apply for the fields inside block. I18n syntax for block field label should be:
<blockname>.<property>.label

E.g:

image.yaml

templateId: content-editor:blocks/image
icon: file-image
block:
  properties:
    image:
      $type: damLinkField
    imageAltText:
      $type: textField
    imageCaption:
      $type: textField
    imageCredit:
      $type: textField 

image.imageAltText.label = Alt text  -> for label
image.imageAltText.placeholder = Add alt text… -> for placeholder

Thanks

 

Comment by Lam Nguyen Bao [ 10/Jun/22 ]

Hi ereichenberger,

Do you have any update on this? 

Comment by Eduard Lehel Reichenberger [ 20/Jun/22 ]

Hello Lam,

I was on vacation for two weeks. I will check today and let you know.

Thank you!

Comment by Laura Delnevo [ 20/Jun/22 ]

Thank you ereichenberger  

Comment by Eduard Lehel Reichenberger [ 20/Jun/22 ]

Hello Laura,

I get the same result even with the key as you said.

My block is also in image.yaml and I have image.image.label and image.altText.label but the keys are showing up instead of the value in the properties file.

Maybe an update will fix this. Currently I am using Magnolia 6.2.15

 

Best,

Eduard

Comment by Laura Delnevo [ 20/Jun/22 ]

Thx for following up promptly ereichenberger . We will do more discovery based on your further feedback, for this, I'll loop back lam.nguyen. Thx both muchly for the exchange. 

Generated at Mon Feb 12 00:20:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.