This bookmarklet improves support for right-to-left languages in DHIS2. For instructions on how to use and install, go to: https://dhis2.github.io/dhis2-rtl-bookmarklet/.
rtl_bookmarklet.mov
Before | After |
---|---|
If you prefer to not use the syles in this repo, and upload your own CSS fixes for RTL, then follow the steps below:
- Locally on your machine, create a file named
style.css
and add - as an example - this CSS snippet to it:
.formSection {
direction: rtl !important;
}
or alternatively download style.css from this repo which fixes many of the rtl issues, and change/add as you see fit.
- Open a terminal, and navigate to where the style.css file is located. Then Run the curl command described in this documentation link. In your case, the command will be:
curl --data-binary @style.css "https://url_to_dhis_2_instance/api/files/style" -H "Content-Type:text/css" -u user:password
changing url_to_dhis_2_instance
, user
and password
to the values from your DHIS2 instance.
-
In the browser, go to
https://url_to_dhis_2_instance/api/files/style
and you should be able to see the CSS file you just uploaded. -
Then go to a form, and do a hard refresh ("Empty cache and hard reload" in Chrome), and the forms should then display right-to-left, with the styles applied to it. It's important to do a hard refresh, as otherwise the previous CSS will be cached and served instead.