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 RTL layout support and Arabic localization #159

Merged
merged 18 commits into from
Jan 26, 2022
Merged

Add RTL layout support and Arabic localization #159

merged 18 commits into from
Jan 26, 2022

Conversation

Rami-Sabbagh
Copy link
Contributor

@Rami-Sabbagh Rami-Sabbagh commented Jan 11, 2022

Hello 👋

I've put some effort and added RTL support to the awesome theme you've have made.
And added Arabic localization.

I had to use a tailwind package to achieve that. And I did update the cached prebuilt css.

I've made that so I could use it for my own blog. And thought why not share it with everyone.

Please tell me what are your thoughts.

@Rami-Sabbagh
Copy link
Contributor Author

A little note on defining RTL languages in languages.yaml: a languageDirection: rtl property should be added.

For example in Arabic:

ar:
  languageCode: ar
  languageName: العربية
  languageDirection: rtl
  contentDir: content/ar
  title: مدوّنة

@wangchucheng
Copy link
Owner

Hi @Rami-Sabbagh,

Thank you so much for adding this awesome feature, it is quite necessary for Eureka to have this. Since I have no experiences in RTL languages, do you have a RTL example with Eureka and its source code? This may help me to review this PR. Thanks again for your contribution ;-)

@Rami-Sabbagh
Copy link
Contributor Author

There's my personal blog, but the posts have not been translated to Arabic yet.
ARENsource-code

@Rami-Sabbagh
Copy link
Contributor Author

I've done some modifications today to add singular & plural formatting support for the reading time metadata of each post.
By following the hugo docs.

Updated all the existing localizations to use the new property, but I'm afraid this might introduce backwards incompatible update. (Users will have to update their localization files).

In Arabic we have a plural for dual, and a plural for 3+.
Copy link
Owner

@wangchucheng wangchucheng left a comment

Choose a reason for hiding this comment

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

Hi @Rami-Sabbagh,

Thanks for your contribution! I just have one comment as above, feel free to talk to me if you have any thoughts.

i18n/en.yaml Outdated Show resolved Hide resolved
Copy link
Owner

@wangchucheng wangchucheng left a comment

Choose a reason for hiding this comment

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

Hi @Rami-Sabbagh,

Just one little comment about the one in i18n. And if you are cool with the whole pr, I can merge it later

i18n/en.yaml Show resolved Hide resolved
@Rami-Sabbagh
Copy link
Contributor Author

Rami-Sabbagh commented Jan 25, 2022

Hello @wangchucheng

I think the RTL support is good to go now.
For any other tweaks I might be doing in my fork, will wait few weeks before opening a new PR so you can review them all at once.

Although I have one question: Can we have the footer content localized? (the one which includes the hugo-eureka link)

@wangchucheng
Copy link
Owner

Although I have one question: Can we have the footer content localized? (the one which includes the hugo-eureka link)

That's a good idea and I think it is possible. I will look into that later ;-)

@wangchucheng wangchucheng merged commit 086f1e9 into wangchucheng:master Jan 26, 2022
@wangchucheng
Copy link
Owner

wangchucheng commented Jan 26, 2022

Just one quick remainder for your further development, you need to set hugo to production in order to purge the css if you want to update the cached resources. I found that the cached assets were like 4.4mb, but after purging, it would be around 20-25kb. I have fixed this issue so don't worry about it.

@Rami-Sabbagh Rami-Sabbagh deleted the rtl-support branch January 30, 2022 10:43
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

Successfully merging this pull request may close these issues.

2 participants