[MGNLUI-3879] i18n suffixes wrong for default locale on upload fields Created: 11/May/16 Updated: 29/Sep/22 Resolved: 13/Feb/17 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | forms, framework |
| Affects Version/s: | 5.3.12 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Cedric Reichenbach | Assignee: | Unassigned |
| Resolution: | Obsolete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| 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: | I18n fields issues | ||||||||
| Description |
|
Expectation When i18n is enabled on a form field, we expect it to be saved with suffixes for corresponding languages, e.g. title_fr for French, and without a suffix for the default language, e.g. title for German if that's the default. This works as expected for most fields. Problem When using special fields like the DAM upload field, the default language version is also stored with a suffix (e.g. myImage_de instead of myImage). Cause The reason is that DefaultI18NAuthoringSupport only handles default languages on transformers extending BasicTransformer (see line 118 of DefaultI18NAuthoringSupport in Magnolia 5.3.12), but AssetTransformer doesn't do this. Workaround As an ad-hoc workaround, we're using a custom I18nFixedAssetTransformer<T extends AssetUploadReceiver> extends BasicTransformer<T>. This one mostly adapts the behaviour of BasicTransformer, but wraps an instance of AssetTranformer and redirects the methods writeToItem(T newValue) and readFromItem() to it. This has only been tested on 5.3.12. I'm not sure what the situation on 5.4.* is, as i18n authoring seems to have changed quite a bit. |
| Comments |
| Comment by Mikaël Geljić [ 13/Feb/17 ] |
|
FileTransformer i18n support was fixed with |