wordpress-mobile / WordPress-Editor-Android

⛔️ [DEPRECATED] A reusable Android rich text editor component.
GNU General Public License v2.0
188 stars 50 forks source link

Image alignment class in image source is translated in non-English languages #445

Closed rachelmcr closed 8 years ago

rachelmcr commented 8 years ago

Expected behavior

When I set an image's alignment in the image settings, I expect it to add the class alignleft, aligncenter, or alignright on the image to control how the image is aligned in the post.

Actual behavior

If the device is set to a non-English language, the alignment value is translated and so the image isn't correctly aligned in the post. For example, if the device/interface language is set to Spanish, the image ends up with the class alignizquierda, aligncentrado, or alignderecha.

Steps to reproduce

  1. In the device settings, select a non-English language
  2. In the app, start a new post
  3. Add an image to the post
  4. Open the image settings and select a left/center/right alignment
  5. Save the image settings
  6. Switch to HTML view and view the image source
    Tested on Nexus 9, Android 6.0.1, WPAndroid alpha-18
    Reported in 121825-h
rachelmcr commented 8 years ago

This came up in an app review:

Picture alignment like "alignright" is translated into german "alignrechts" (left/links accordingly), which destroys the Layout since it is unknown.

This issue makes it impossible to align images in a language other than US English.

maxme commented 8 years ago

This is pretty bad, it loads the array of alignment strings (potentially translated) and use them to write the html code.