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 in html #3

Open
ibrahimBeladi opened this issue Feb 5, 2020 · 6 comments
Open

RTL in html #3

ibrahimBeladi opened this issue Feb 5, 2020 · 6 comments

Comments

@ibrahimBeladi
Copy link
Member

Add direction attribute with value rtl in case of arabic language to html tag, so that <html lang="ar"> will become <html dir="rtl" lang="ar"> instead.

@usernane
Copy link
Member

usernane commented Feb 6, 2020

You mean if language is set, the 'dir' Attribute should be set automatically?

@ibrahimBeladi
Copy link
Member Author

Yes.
For example, if it is English then dir attribute should be set to ltr, and if it is Arabic, then it is rtl.

@usernane
Copy link
Member

usernane commented Feb 6, 2020

ISO 3166-1 alpha-2 code has 249 country codes. Will have to consider all which kinda difficult task unless you have another Idea.

@ibrahimBeladi
Copy link
Member Author

You can let the user set dir attribute without the need to consider the country code.
For example, default dir="ltr", but with ::setRTL(true) it will use dir="rtl" instead.

@usernane usernane transferred this issue from WebFiori/framework Feb 7, 2020
@usernane
Copy link
Member

usernane commented Feb 7, 2020

If you didn't notice, the class HTMLNode has a method to set the writing direction which is ::setWritingDir()

So, it is possible to set writing direction by using something like that:

$doc = new HTMLDoc();
$doc->getDocumentRoot()->setWritingDir('ltr')

Do you think that I should add a default value for the attribute or keep it empty?

@ibrahimBeladi
Copy link
Member Author

You can default it to ltr unless specified.

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

2 participants