Commit 1cbe233f authored by catch's avatar catch

Issue #657166 by mgifford, TR, Haza, cs_shadow, heaths1: Use × instead of x.

parent 48e7c025
......@@ -53,7 +53,7 @@ public function buildForm(array $form, FormStateInterface $form_state, FilterFor
// Construct strings to use in the upload validators.
$image_upload = $editor->getImageUploadSettings();
if (!empty($image_upload['dimensions'])) {
$max_dimensions = $image_upload['dimensions']['max_width'] . 'x' . $image_upload['dimensions']['max_height'];
$max_dimensions = $image_upload['dimensions']['max_width'] . '×' . $image_upload['dimensions']['max_height'];
}
else {
$max_dimensions = 0;
......@@ -134,7 +134,7 @@ public function buildForm(array $form, FormStateInterface $form_state, FilterFor
'#min' => 1,
'#max' => 99999,
'#placeholder' => $this->t('width'),
'#field_suffix' => ' x ',
'#field_suffix' => ' × ',
'#parents' => array('attributes', 'width'),
);
$form['dimensions']['height'] = array(
......
name: large
label: 'Large (480x480)'
label: 'Large (480×480)'
effects:
ddd73aa7-4bd6-4c85-b600-bdf2b1628d1d:
id: image_scale
......
name: medium
label: 'Medium (220x220)'
label: 'Medium (220×220)'
effects:
bddf0d06-42f9-4c75-a700-a33cafa25ea0:
id: image_scale
......
name: thumbnail
label: 'Thumbnail (100x100)'
label: 'Thumbnail (100×100)'
effects:
1cfec298-8620-4749-b100-ccb6c4500779:
id: image_scale
......
......@@ -193,7 +193,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
$settings = $this->getSettings();
// Add maximum and minimum resolution settings.
$max_resolution = explode('x', $settings['max_resolution']) + array('', '');
$max_resolution = explode('×', $settings['max_resolution']) + array('', '');
$element['max_resolution'] = array(
'#type' => 'item',
'#title' => t('Maximum image resolution'),
......@@ -201,7 +201,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#weight' => 4.1,
'#field_prefix' => '<div class="container-inline">',
'#field_suffix' => '</div>',
'#description' => t('The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Leave blank for no restriction. If a larger image is uploaded, it will be resized to reflect the given width and height. Resizing images on upload will cause the loss of <a href="@url">EXIF data</a> in the image.', array('@url' => 'http://en.wikipedia.org/wiki/Exchangeable_image_file_format')),
'#description' => t('The maximum allowed image size expressed as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a larger image is uploaded, it will be resized to reflect the given width and height. Resizing images on upload will cause the loss of <a href="@url">EXIF data</a> in the image.', array('@url' => 'http://en.wikipedia.org/wiki/Exchangeable_image_file_format')),
);
$element['max_resolution']['x'] = array(
'#type' => 'number',
......@@ -209,7 +209,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#title_display' => 'invisible',
'#default_value' => $max_resolution[0],
'#min' => 1,
'#field_suffix' => ' x ',
'#field_suffix' => ' × ',
);
$element['max_resolution']['y'] = array(
'#type' => 'number',
......@@ -220,7 +220,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#field_suffix' => ' ' . t('pixels'),
);
$min_resolution = explode('x', $settings['min_resolution']) + array('', '');
$min_resolution = explode('×', $settings['min_resolution']) + array('', '');
$element['min_resolution'] = array(
'#type' => 'item',
'#title' => t('Minimum image resolution'),
......@@ -228,7 +228,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#weight' => 4.2,
'#field_prefix' => '<div class="container-inline">',
'#field_suffix' => '</div>',
'#description' => t('The minimum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Leave blank for no restriction. If a smaller image is uploaded, it will be rejected.'),
'#description' => t('The minimum allowed image size expressed as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a smaller image is uploaded, it will be rejected.'),
);
$element['min_resolution']['x'] = array(
'#type' => 'number',
......@@ -236,7 +236,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#title_display' => 'invisible',
'#default_value' => $min_resolution[0],
'#min' => 1,
'#field_suffix' => ' x ',
'#field_suffix' => ' × ',
);
$element['min_resolution']['y'] = array(
'#type' => 'number',
......
......@@ -344,15 +344,15 @@ function testEditEffect() {
$this->drupalPostForm(NULL, array('label' => 'Test style effect edit', 'name' => $style_name), t('Create new style'));
$this->drupalPostForm(NULL, array('new' => 'image_scale_and_crop'), t('Add'));
$this->drupalPostForm(NULL, array('data[width]' => '300', 'data[height]' => '200'), t('Add effect'));
$this->assertText(t('Scale and crop 300x200'));
$this->assertText(t('Scale and crop 300×200'));
// There should normally be only one edit link on this page initially.
$this->clickLink(t('Edit'));
$this->drupalPostForm(NULL, array('data[width]' => '360', 'data[height]' => '240'), t('Update effect'));
$this->assertText(t('Scale and crop 360x240'));
$this->assertText(t('Scale and crop 360×240'));
// Check that the previous effect is replaced.
$this->assertNoText(t('Scale and crop 300x200'));
$this->assertNoText(t('Scale and crop 300×200'));
// Add another scale effect.
$this->drupalGet('admin/config/media/image-styles/add');
......@@ -367,8 +367,8 @@ function testEditEffect() {
// Add another scale effect and make sure both exist.
$this->drupalPostForm(NULL, array('data[width]' => '12', 'data[height]' => '19'), t('Add effect'));
$this->assertText(t('Scale 24x19'));
$this->assertText(t('Scale 12x19'));
$this->assertText(t('Scale 24×19'));
$this->assertText(t('Scale 12×19'));
// Try to edit a nonexistent effect.
$uuid = $this->container->get('uuid');
......
......@@ -18,7 +18,7 @@
*/
#}
{% if data.width and data.height -%}
{{ data.width|e }}x{{ data.height|e }}
{{ data.width|e }}×{{ data.height|e }}
{%- else -%}
{% if data.width %}
{% trans %}
......
......@@ -16,7 +16,7 @@
*/
#}
{% if data.width and data.height -%}
{{ data.width|e }}x{{ data.height|e }}
{{ data.width|e }}×{{ data.height|e }}
{%- else -%}
{% if data.width %}
{% trans %}
......
......@@ -17,7 +17,7 @@
*/
#}
{% if data.width and data.height -%}
{{ data.width|e }}x{{ data.height|e }}
{{ data.width|e }}×{{ data.height|e }}
{%- else -%}
{% if data.width %}
{% trans %}
......
......@@ -122,14 +122,14 @@ public function testConfigTranslation() {
$this->assertEqual($formatted_date, 'Tue', 'Got the right formatted date using the date format translation pattern.');
// Assert strings from image module config are not available.
$string = $this->storage->findString(array('source' => 'Medium (220x220)', 'context' => '', 'type' => 'configuration'));
$string = $this->storage->findString(array('source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration'));
$this->assertFalse($string, 'Configuration strings have been created upon installation.');
// Enable the image module.
$this->drupalPostForm('admin/modules', array('modules[Field types][image][enable]' => "1"), t('Save configuration'));
$this->rebuildContainer();
$string = $this->storage->findString(array('source' => 'Medium (220x220)', 'context' => '', 'type' => 'configuration'));
$string = $this->storage->findString(array('source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration'));
$this->assertTrue($string, 'Configuration strings have been created upon installation.');
$locations = $string->getLocations();
$this->assertTrue(isset($locations['configuration']) && isset($locations['configuration']['image.style.medium']), 'Configuration string has been created with the right location');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment