-
Type: Bug Report
-
Status: Needs Review
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 5.2.2
-
Component/s: Other
-
Labels:None
-
Change Log Group:Fixed
-
Change Log Message:The phrase specified in "empty_label" parameter of "PredefinedOptions" tag was translated twice.
-
Story Points:1
-
Copy Issue Key:
-
Patch Instructions:
When using "inp_edit_options" block with phrase label given in "empty_label" attribute, then this phrase is translated twice:
first time: in the "PredefinedOptions" tag (which is used inside of "inp_edit_options" block)
second time: by the "m_Phrase" tag, located inside of "inp_option_phrase" block (used by "PredefinedOptions" tag)
leading to wrong text being displayed. For example <inp2:PredefinedOptions ... empty_label="lu_opt_Empty"/> would result in "Unable to render embedded object: File (EMPTY) not found." instead of "Empty".
To fix this I'm proposing to:
- look at "use_phrases" option within the field, which options are being printed
- if "use_phrases" option is set and is truthy (evaluates to true), then don't translate label given via "empty_label" parameter, since it will be translated anyway later
- if "use_phrases" option isn't set or set to falsy (evaluates to false), then translate label given via "empty_label" parameter, since nobody will translate it otherwise
- don't translate given label, when label value starts with "+" (keep current behavior)