janhq / jan

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer. Multiple engine support (llama.cpp, TensorRT-LLM)
https://jan.ai/
GNU Affero General Public License v3.0
23.18k stars 1.35k forks source link

feat: RTL (right-to-left) automatic detection for setting text direction #3020

Open Yasand123 opened 4 months ago

Yasand123 commented 4 months ago

Problem Both LTR and RTL writing systems in Jan are left to right. This is good for LTR languages such as English, but not for RTL languages such as Arabic.

Success Criteria It would be nice to automatically set text direction based on the character set used. If the first character in a message is detected to be Arabic for example, that message will have RTL text direction. This should be per text field (message, input prompt, instructions, etc).

Note there's a difference between text alignment, and text direction. Simple text alignment will not work properly.

Thank you.

imtuyethan commented 4 months ago

Wow this is such a nice suggestion, thanks for raising this!

0xSage commented 2 months ago

related #2184

Yasand123 commented 2 months ago

related #2184

You probably thought of that already, but just in case.

Having multiple localizations is definitely great, but I think this behavior (setting text direction based on the char set) should apply regardless of which language you pick for the UI. As many people are bilingual and prefer English in general, but with the occasional Arabic/Hebrew/Persian messages.

Moreover, this would make it so you can use multi-lingual language models in a convenient way without having to keep switching the UI.