Found in
Updated: Comment #0


Editor module allows to specify the weight and height of uploaded images and uses the HTML placeholder attribute to create a "[width] x [height] pixels" interface.
The Editor module image upload form showing the described user interface for entering width and height.
These placeholders are not translated.

Proposed resolution

Translate the placeholders! :-)

Remaining tasks

In #1932652: Add image uploading to WYSIWYGs through editor.module it was discussed whether the placeholder values should uppercase. This needs to be resolved before working on a patch.

#16 2067119-translate-image-placeholders-16.patch1.86 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 59,326 pass(es). View
#11 translate-placeholder-2067119-11.patch1005 bytespameeela
PASSED: [[SimpleTest]]: [MySQL] 58,855 pass(es). View


webchick’s picture

Issue tags: +Usability

While I realize our general standard is to "Capitalize" all strings in the interface, in this case I actually think it would add too much visual emphasis. Not sure. Tagging for the UX team to weigh in on.

Gábor Hojtsy’s picture

Issue tags: +Needs usability review

"Needs usability review" would be the right tag I guess.

Wim Leers’s picture

Wim Leers’s picture

Title: 'width' and 'height' HTML placeholder attributes are not translated in WYSIWYG uploads » 'width' and 'height' HTML placeholder attributes in image dialog are not translated, yet should be lcfirst
Issue tags: +Spark
Bojhan’s picture

I have no particular preference, how do we lead in general with placeholder text capitalization?

Wim Leers’s picture

#5 can you rephrase that? I don't understand the usage of the verb "lead" in that phrase.

Bojhan’s picture

As in, what do we commonly use with or without capital?

longwave’s picture

The only core uses of #placeholder at present are:

core/modules/block/lib/Drupal/block/BlockListController.php:      '#placeholder' => t('Filter by block name'),
core/modules/editor/    '#placeholder' => 'width',
core/modules/editor/    '#placeholder' => 'height',
core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php:      '#placeholder' => 'width',
core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php:      '#placeholder' => 'height',
core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php:      '#placeholder' => $this->t('Enter test name…'),
core/modules/system/lib/Drupal/system/Form/ModulesListForm.php:      '#placeholder' => $this->t('Enter module name'),
core/modules/system/tests/modules/form_test/form_test.module:      '#placeholder' => 'placeholder-text',

So we do not have any existing one-word examples other than this and a test module.

I agree with webchick that lowercase seems more aesthetically pleasing and less visually prominent here.

Bojhan’s picture

Ok, then I think we have a decision, no uppercase.

tstoeckler’s picture

OK, thanks!

Now we now what to do: Simply add a t() around the existing strings.

pameeela’s picture

1005 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,855 pass(es). View

Patch attached, should the field suffix 'pixels' also get translated?

As well should there be another issue to add it to these, based on #8:

core/modules/editor/    '#placeholder' => 'width',
core/modules/editor/    '#placeholder' => 'height',
pameeela’s picture

Status: Active » Needs review

Status: Needs review » Needs work
Issue tags: -Novice

The last submitted patch, translate-placeholder-2067119-11.patch, failed testing.

Wim Leers’s picture

Status: Needs work » Needs review
Issue tags: +Novice
Wim Leers’s picture

Yes, the "pixels" suffix should also be translated.

Thanks so much pameeela for pushing this forward!

(Queued for retesting because it was probably a random failure.)

longwave’s picture

1.86 KB
PASSED: [[SimpleTest]]: [MySQL] 59,326 pass(es). View

Let's translate at the same time, as the code is almost identical. This patch adds that and also translates the 'pixels' suffix.

pameeela’s picture

+    '#placeholder' => t('height'),
+    '#field_suffix' => t('pixels'),

Should it be $this->t() or does t() suffice? May not make a difference but thought I'd check.

If no difference then this is good for RTBC.

longwave’s picture is a procedural file and $this is not available, so we use plain old t() there.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +quickfix

Yay, thanks :)

Wim Leers’s picture

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.