[MAGNOLIA-7778] Implement @I18nText fallback parameter Created: 23/Apr/20  Updated: 29/Sep/20  Resolved: 05/May/20

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.1

Type: Improvement Priority: Neutral
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 7h 23m
Original Estimate: Not Specified

Issue Links:
Relates
relates to MAGNOLIA-7866 I18nText fallback as I18n key Closed
causality
is causing MAGNOLIA-7826 Description not shown on text field Closed
dependency
is depended upon by MGNLPER-132 CLONE - Use i18nText fallback paramet... Closed
is depended upon by MGNLUI-5841 Use i18nText fallback parameter in Se... Closed
documentation
to be documented by MAGNOLIA-7794 DOC: I18nText fallback parameter Closed
supersession
supersedes MGNLUI-2207 Cleanup and reviewing overriding of l... Closed
supersedes MAGNOLIA-5315 I18nizer: allow default values, optio... Closed
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)
Documentation update required:
Yes
Sprint: UI Framework 22, UI FW 1
Story Points: 5

 Description   

Steps to reproduce the problem

  1. Giving info.magnolia.ui.field.TextFieldDefinition#getPlaceholder
  2. Provide no translation
  3. field.setPlaceholder(getDefinition().getPlaceholder())

Expected results

Placeholder is empty. 

Actual results

Placeholder contains i18n key.

Workaround

String placeholder = getDefinition().getPlaceholder();
if (placeholder != null && !isMessageKey(placeholder)) {
  field.setPlaceholder(placeholder);
}

 



 Comments   
Comment by Roman Kovařík [ 23/Apr/20 ]

Implemented fallback parameter for @I18nText annotation which is used if no translation is found.

@I18nText(fallback = "")

Generated at Mon Feb 12 04:26:45 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.