hook_schema() allows specifying a description for fields.

In the case of entity properties, if the description exists, we should use it instead of the default generic description provided by Entity API.

Comments

alexweber’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

Patch attached!

hass’s picture

Status: Needs review » Needs work

First of all ucfirst on translatable string is nightmare for translators. It may be correct case in one language, but not in others and not in context.

Schema descriptions are not translatable strings. Cannot used here.

alexweber’s picture

@hass, ucfirst() is already there, its the default implementation.

If schema descriptions are not translatable string we could at least wrap them in t().

Either way, it makes no sense if you define a description to have Entity API do the whole ucfirst() thing instead of use the description thats already there.

alexweber’s picture

StatusFileSize
new1.2 KB

Updated patch which wraps schema description in a t() function

alexweber’s picture

Status: Needs work » Needs review
hass’s picture

Status: Needs review » Needs work

Sorry, but this does not make the schema string translatable. Localization server does not work this way and cannot extract the strings that needs translation. Additionally we don't like to translate schema strings... This is a developer rule.

I see ucfirst is already in the code, but this don't make it right... This is a bug :-)