akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Can't translate empty_replacement attribute #637

Closed f-liva closed 7 years ago

f-liva commented 7 years ago

I have this form:

<?xml version="1.0" encoding="UTF-8"?>
<form type="browse">
    <headerset>
        <header name="review_date" type="Field" label="COM_FOO_DATE_LABEL" sortable="true"/>
    </headerset>
    <fieldset name="items">
        <field name="review_date" type="Calendar" empty_replacement="COM_FOO_REWIED_DATE_EMPTY"/>
    </fieldset>
</form>

In MySQL, the field rewiew_date is a nullable DATETIME and by default is NULL.

When my browse view list a record with a null date here, it displays the date of the current day (first issue) so I added the empty_replacement attribute with a string I need to translate as:

COM_FOO_REWIED_DATE_EMPTY = "Never"

The second issue is that I cannot translate the string passed via empty replacement attribute.

How do that?

nikosdion commented 7 years ago

Regarding the first issue. You have a different key than the language string you said you created. Is that what you are asking me?

Regarding the second issue, it was indeed a bug in the Calendar and Email fields. Fixed.

f-liva commented 7 years ago

Sorry a mistake, the string is the same in the language file ;)

Ok for the translation, the NULL datetime field is still converted to the current day date