-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
[4.x] RTL support in the Control Panel #9447
Conversation
Amazing. We were about to do this ourselves. |
You're welcome 🤗. I like Statamic and would suggest it to whole world in any language and any region... |
Maybe the translation can be changed if it's a RTL language. e.g. instead of saying |
# Conflicts: # resources/css/components/items.css # resources/css/elements/tables.css # resources/js/components/blueprints/Listing.vue # resources/js/components/blueprints/RegularField.vue # resources/js/components/blueprints/Section.vue # resources/js/components/data-list/ColumnPicker.vue # resources/js/components/data-list/Table.vue # resources/js/components/entries/PublishForm.vue # resources/js/components/field-validation/Builder.vue # resources/js/components/fields/Settings.vue # resources/js/components/fieldtypes/bard/Set.vue # resources/js/components/fieldtypes/date/RangePopover.vue # resources/js/components/fieldtypes/date/SinglePopover.vue # resources/js/components/fieldtypes/replicator/Set.vue # resources/js/components/globals/Sites.vue # resources/js/components/nav/Builder.vue # resources/js/components/structures/Branch.vue # resources/js/components/terms/PublishForm.vue # resources/js/components/users/Listing.vue # resources/views/blueprints/index.blade.php # resources/views/nav/updates.blade.php # resources/views/usergroups/show.blade.php # resources/views/utilities/partials/email-l6.blade.php # resources/views/utilities/partials/email-l7.blade.php # resources/views/utilities/phpinfo.blade.php
Hey @peimn why did slug fields need to be |
@jasonvarga It is common for slugs to be written in Latin words, and we prefer to write it in Latin words as non-Latin writers. It is easy to remember and write. Furthermore, Statamic itself converts non-latin words to Latin. Therefore, I decided to make it a ltr. |
Okay I will leave it how you had it then. Thanks! |
This reverts commit 3916260.
…from the config or a user preference.
I've made a change to how the text direction of the CP is decided. You had it so that it depends on the selected site. I've changed it so that it's based on the configured locale or preference. If you have configured a language that should be RTL (like Arabic or Hebrew), it will be RTL. Similar to #9452, I didn't feel it was right that the whole control panel changed depending on what site you were targeting. If I speak one language, and I've set my preference to a specific language, I don't want the whole CP to change. However I do think it's a good idea to change the direction of the fields inside the publish forms when you're editing an entry in a specific site. This behavior is consistent with how Craft CMS works, and they do a great job with localization and RTL support. See in this screenshot, everything is in English/LTR (my preferred language) except the field (I only configured one) which is RTL because the current entry is Arabic. We can adjust that behavior in another PR though. There's so much in this one already. (It's fantastic!) |
I haven't work with Craft CMS though I get the idea from your words. in #9452 we first had a look for prefered language and if user hadn't set any then switch would be done. But you are right, if we could apply language prefered direction to input fields and editors, it will suit to user needs. |
@peimn Do you have translation files for Persian? Everything seems to be ready to merge but I'm just curious what you are actually using since we don't include any RTL languages. |
@jasonvarga yes I've, and I was waiting for this request to be merged then request to merge Persian language. I will send it in a minute. |
@jasonvarga #9707 now has Persian translation. Sorry it took a time. |
This PR will add rtl styles for RTL languages like Arabic, Persian, Hebrew...