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 language Support #769
Comments
Thank you for using the doccano! Do you mean the order of the word become opposite if you add the annotation? |
yes! |
doccano uses Vuetify to implement the frontend and the framework supports RTL. So if we use the feature, the problem will may be solved. If you give some Arabic test cases, they will help to analyze the problem. |
@Hironsan apologies for replying late, the problem appears when i start by annotating an entity, when an annotation for an entity is added, that span is then divided to multiple spans, one for text before the entity annotation box, one for the entity annotation box itself and one for the text afterwards. the problem comes from the order of those spans, by default they are ordered left to right, therefore the sentence gets out of order after the annotation: when i add those properties to the parent div (source)
i get the order correct, but it also breaks it for English likewise. Finally, i don't have enough experience in front-end though, so i might be doing something wrong here of course ✋ Regarding the test cases, i don't know how to provide such cases in a helpful way, because it's mainly UI thing. Thanks! |
Forgot to mention that i tried to enable the RTL feature as instructed, and tried also editing nuxt config to pass the flag rtl=true to Vuetify and didn't have any difference. |
Thank you for your information. The |
Well, this is quite inaccurate, configuring rtl=true for Vuetify worked but by turning the whole app to RTL (which isn't a good solution). it was just me using the production docker compose file, therefore any changes i make wasn't reflected 😞 On the other hand, after some tinkering i managed to get it to work well for both English and Arabic for the sequence labeling task (the one i'm currently using) on a fork i modified EntityItemBox component such that:
if this seems to be an acceptable solution, i can open a pull request and review it further. |
FYI: We've found that in the meantime, <1.0 versions handle RTL languages pretty well. You can most easily run these by using: |
Thanks to @muhnashX it is easy to adjust code so it would handle other RTL languages, simply change in: |
Did you try to set the RTL setting by yourself in vuetify: {
rtl: true, // add RTL support
theme: {
primary: colors.blue.darken2,
.. |
Apologies for late reply! @bakrianoo 👋
while my main problem was to get sentences of both languages AR/EN displayed correctly on the same doccano instance. |
Thanks a lot @muhnashX for opening this issue and documenting your steps to solve it! I am having a similar problem, although I am annotating only Arabic (no English). I followed your instructions on the web inspector of my browser and was able to fix it for the div I am looking at. But how to carry over this fix to the rest of the application? I could not find a local file called Unfortunately I don't have experience with JS, is there still something I can do? |
@Maroussia glad those steps did a bit of help! and in order for a fix to be persistent, you have to do it into the code itself, the browser inspector is kind a test/playground if we can say, and changes made there are volatile and will go away whenever you close the page. so roughly you would clone the doccanno repo, do some changes, then build/run docanno from your own clone. Second, back to your problem, Since you only annotating Arabic, i'd say setting the whole UI to rtl (@bakrianoo comment) is straight forward and simpler solution for that task, but i think it'd look a bit odd (and maybe discouraging?) the other option is to try the workaround i used, you will have the UI as it is, with Arabic handled with no problems |
here's |
Thank you @muhnashX for your quick reply. It's great to find people like you when learning! Unfortunately (it took me a while to find out what was happening) the Maybe @Hironsan you know whether the changes from @muhnashX could successfully be applied elsewhere? I tried the newest version (1.2.2) to check whether there were any improvements for RTL, but no luck... |
Solved in #1511 (only sequence labeling project) |
Hi,
i'm not sure whether this should be a feature request or a bug (apologies in advance),
but the annotations boxes in sequence labeling tasks get wrong positions and doesn't align with the actual order of the words, in case of a RTL language.
more specifically i'm using doccano for Arabic project and here's an example:
original text rendered right(correct order)
after adding a label:
hope this example makes it clear (focus on the order of the words and the part "جملة اختبار")
Thanks!
The text was updated successfully, but these errors were encountered: