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

Few changes to allow the support of right to left languages #658

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AmrBarghouthi
Copy link

@AmrBarghouthi AmrBarghouthi commented Dec 5, 2020

This to makes it possible to flip the image in RecolorImage which is needed for some icons when translating Apps to support Right to Left languages

@AmrBarghouthi AmrBarghouthi changed the title Adding mirror property to RecolorImage Few changes to allow the support right to left languages Dec 7, 2020
@AmrBarghouthi AmrBarghouthi changed the title Few changes to allow the support right to left languages Few changes to allow the support of right to left languages Dec 7, 2020
@AmrBarghouthi
Copy link
Author

I added a function to indicate the language direction to be used in QML files
example use is adding the following to row layout elements parent

LayoutMirroring.enabled: catalog.i18nIsRightToLeft()
LayoutMirroring.childrenInherit: true

@Ghostkeeper
Copy link
Collaborator

I'm a bit confused as to why you would want to mirror images in right-to-left scripts?

And the solution of adding a translated string may not be very robust either. It would be better to get this from the metadata of the translation. I think gettext.info() can read that.

@AmrBarghouthi
Copy link
Author

@GhostKeep image mirroring is going to be for stuff like arrows

as for metadata of the translation I will look into it

@AmrBarghouthi
Copy link
Author

I update it the i18nIsRightToLeft function to get the direction from language metadata
thanks @Ghostkeeper for the suggestion

@Ghostkeeper
Copy link
Collaborator

The only directional arrows that we have are really the folding arrows in the setting category headers. But those are not really related to any text, are they?

@AmrBarghouthi
Copy link
Author

yes but it's not only for arrows
for example
2020-12-04 (1)
these icons look way better when mirrored in right to left application
anyway it is a feature of Uranium that doesn't really do any harm if added

@@ -20,6 +21,7 @@ Item
visible: false
sourceSize.width: parent.width
sourceSize.height: parent.height
layer.enabled: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this to layer.enabled: mirror to save some rendering performance. These images are used a lot (e.g. with every setting) so performance is important.

@Ghostkeeper
Copy link
Collaborator

Ghostkeeper commented Apr 12, 2021

I can't seem to be able to get this to work.

I added this property to the Dutch translation .po files (all 4):

"Language-Direction: rtl\n"

Alternatively I also tried without the newline and space, in case that mattered (though I think Gettext filters that out):

"Language-Direction:rtl"

I then recompiled the .po files to .mo files and printed the isRightToLeft() function from QML:

print(catalog.i18nIsRightToLeft());

However it still returns qml: false.

Setting the mirror property works, but setting it to depend on being right-to-left never mirrors the image.

@jellespijker jellespijker added the PR: Community Contribution 👑 Community Contribution PR's label Nov 30, 2022
@Joeydelarago Joeydelarago marked this pull request as draft December 30, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Community Contribution 👑 Community Contribution PR's
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants