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 ]


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.

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

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

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

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

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

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.

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

OK, thanks!

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

new1005 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',

Status:Active» Needs review

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

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

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

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.)

new1.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.

+    '#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. is a procedural file and $this is not available, so we use plain old t() there.

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

Yay, thanks :)

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

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

Issue summary:View changes

Updated issue summary.