Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "keep direction" functionality to do not translate function #2854

Closed
osmers opened this issue Jun 17, 2024 · 3 comments · Fixed by #2873
Closed

Add "keep direction" functionality to do not translate function #2854

osmers opened this issue Jun 17, 2024 · 3 comments · Fixed by #2873
Assignees
Labels
💡 feature New feature or request 🆘 prio: urgent Needs to be resolved now(?)
Milestone

Comments

@osmers
Copy link

osmers commented Jun 17, 2024

Motivation

With the new phone number format, phone numbers are written with spaces between them.
image
This means that when translating this number into rtl languages, their order gets mixed up:
image

Proposed Solution

Extend the do not translate function with the function that texts keep their direction: e.g. all texts that are marked as do not translate are always ltr

Alternatives

Add an extra button if the municipalities want to keep direction and keep the functionality seperate from do not translate (not recommended bcs it adds extra difficulty and possibilites of making mistakes)

User Story

As a user of the app I want to read the phone number in the correct order, even when using the app in rtl languages so that I always dial the correct number.
As a CMS user I want no extra work when using formatted phone numbers and translating content so that I can keep the time I need to work on Integreat as low as possible.

Additional Context

Mattermost Thread: https://chat.tuerantuer.org/digitalfabrik/pl/zu3x4bscy7bcfgen8p7fgngacc
@svenseeberg already tested the function and it seems to work, even between two rtl texts...
image (5)

Design Requirements

None since it will be an invisible functionality.

@osmers osmers added 💡 feature New feature or request 🆘 prio: urgent Needs to be resolved now(?) labels Jun 17, 2024
@osmers osmers added this to the 24Q2 milestone Jun 17, 2024
@svenseeberg
Copy link
Member

svenseeberg commented Jun 17, 2024

The <span> element can get a dir="ltr" to achieve that. AFAICT it should not be harmful in any way, as by definition the content is not translated (and should therefore also remain ltr).

As the app sanitizes the content, it might need a change as well.

@JoeyStk
Copy link
Contributor

JoeyStk commented Jun 18, 2024

I couldn't get it to work. I added direction:ltr to the do-not-translate span. That didn't work. Also adding it to the telephone link didn't work.

This is because the parent element <p style="direction: rtl; ;text-align: right;"><a class="link-external" style="direction: ltr;" href="tel:+491111111" data-bcup-haslogintext="no"><span class="notranslate" style="direction: ltr;" translate="no">+49 (0) 1111111</span></a></p> overwrites it with rtl again. I tried to manipulate this and set the closest p to ltr, how a. it was still overwritten and b. even if it worked, then we would have problems with the other elements within that parent element.

Any further ideas are welcome! @svenseeberg

@charludo charludo self-assigned this Jun 19, 2024
@svenseeberg
Copy link
Member

svenseeberg commented Jun 21, 2024

<span dir="ltr"> does work AFAICT, CSS doesnt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 feature New feature or request 🆘 prio: urgent Needs to be resolved now(?)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants