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

RTL languages #557

Open
GreatBahram opened this issue Jun 15, 2018 · 4 comments
Open

RTL languages #557

GreatBahram opened this issue Jun 15, 2018 · 4 comments

Comments

@GreatBahram
Copy link

HI
Does Lektor support RTL languages like Farsi or Arabic? is there any data type for this situation like some sort of html tags that do the job?
Thanks

@nixjdm
Copy link
Member

nixjdm commented Jun 15, 2018

I'm not familiar with doing this sort of thing. You can use Unicode within html, and I've googled and found the Right-to-left mark. Is that sufficient?

@emmapeel2
Copy link

on the main template we do:
<html xmlns="http://www.w3.org/1999/xhtml" {% if bag('alternatives', this.alt, 'direction') == 'text-right' %}dir="rtl"{% endif %}> at the start of the document and it works: https://lektor-staging.torproject.org/tor-browser-manual/staging/fa/

@shula
Copy link

shula commented Sep 21, 2023

I'm not familiar with doing this sort of thing. You can use Unicode within html, and I've googled and found the Right-to-left mark. Is that sufficient?

it is definitly not enough; intentional development is required:

  1. at the front-end layer, i.e. mostly CSS.
  2. at the authoring components.

It's very hard to write or edit RTL content with and inside LTR gadgets.
I have this issue, e.g. with many Wordpress components & plugins (namely: Most gutenberg widgets, Elementor, and many others).

It's very time consumning to adjust LTR layout to RTL. I've done this several times; Unless there's a built-in support for RTL, than it will not be cost-effective for most RTL users (developers, content writers, designers)

@dairiki
Copy link
Contributor

dairiki commented Sep 21, 2023

I, too, have no experience dealing with RTL languages, but, here's my guess as to the issues. Correct if wrong.

As far as the core of Lektor goes (i.e. generating HTML output by running lektor build) there should be no issue with RTL languages. All the templates used to generate HTML are user configurables so whatever HTML and CSS is required can be generated.

The only issue, I think, is the admin GUI. Here's my guess as to what's required:

  • (When appropriate) add dir="rtl" somewhere in the admin GUI markup. (Where somewhere is probably all the <input>s and <textinput>s in the admin GUI.)

  • Make sure, in the admin GUI, we use direction-agnostic CSS — e.g. text-align: start rather than text-align: left.

  • When to switch the admin GUI to RTL mode can, I think, be determined from the setting of the primary site locale in the project file, or, when editing pages with an explicit alt, from the locale configured for that alt.

  • Ideally, we would also add a UI translation for the RTL language(s) in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants