We are trying to perform a significant number of for UI text replacements using the String overrides module and we are running into some trouble because form elements don't aways have their text labels run through the t() function at all or the context is not set.
Might it be a neat idea of an HTML element's id be used as a regular pattern, for example something like this…
t('Reference lessons', array(), array('context' => 'edit-lessons-reference-item'));
?
Either way, we think it is very important to enable site builders to take control of form elements and we agree that the String overrides route is probably the most robust way.
Thank you
Comments
Comment #2
graber commentedI'm also experiencing some issues when translating.. I think I'm ok with moving this additional context in, just wondering how specific it should be (edit-lessons-reference-item vs field-widget for example)?
Comment #3
sirclickalotAh, good question.
I think I focussed on ids so as to as specific as possible but I think your instinct probably right to go for the context as the encompassing field widget.
What is your take on making it as easy as possible to 'discover' each element's context assuming that it has been set in the
t()implementation?This was my point about using a 'regular pattern' - preferably one that can be 'looked up' quickly and easily via the browser inspector. Perhaps a class attached to widget for example,
field--widget-lms-reference-table?