OCA / geospatial

Odoo and GIS
http://oca.github.io/geospatial/index.html
GNU Affero General Public License v3.0
190 stars 284 forks source link

Direction map with langusge #388

Open Sanazzzmi opened 4 hours ago

Sanazzzmi commented 4 hours ago

Module

geospatial/base_geoengine

Describe the bug

First Issue:

For languages like Arabic and Persian, which have a right-to-left (RTL) text direction, the map view's popup location behaves incorrectly when the user's language is changed in Odoo.

Proposed Fix:

In the file geospatial/base_geoengine/static/src/js/views/geoengine/geoengine_renderer/geoengine_renderer.xml, update line 6 by adding the following style attribute to the div with the class map_container:

<div class="map_container" style="/*rtl:ignore*/ direction: ltr /*rtl:ignore*/;">
    <div id="olmap" />
</div>

Second Issue:

The text inside the popup also displays incorrectly.

Proposed Fix:

In the same file, update line 16 by adding the text-start class to the div with the ID popup as follows:

<div id="popup" class="ol-popup text-start">

To Reproduce

Affected versions: All Odoo versions where the base_geoengine module is implemented.

Steps to reproduce the behavior:

  1. Change the user language to a right-to-left language like Arabic or Persian.
  2. Open the map view in the affected module.
  3. Observe the incorrect behavior of the popup's position and text alignment.

Expected behavior

The popup should display correctly with proper positioning and text alignment, regardless of the language's text direction.

fardinmardani commented 4 hours ago

Comment:

Thank you for bringing attention to these issues with RTL text direction in the map view. Given the importance of supporting right-to-left languages like Arabic and Persian for our users, I urge that these proposed fixes be applied as soon as possible. Proper positioning and text alignment in popups are crucial for usability and accessibility.

I appreciate your prompt attention to this matter and look forward to seeing these changes implemented in the next update. If there’s any way I can assist in expediting this process, please let me know!