openai-cookbook
openai-cookbook copied to clipboard
[PROBLEM] Text Directionality Issue in Mixed RTL (Right-to-Left) and LTR (Left-to-Right) Languages
Description: When using mixed RTL languages (e.g., Persian/Arabic) and LTR languages (e.g., English), text directionality becomes problematic. Sentences that begin with LTR text cause the entire sentence, including RTL portions, to be left-aligned, disrupting structure and readability. This affects the user experience, making it difficult for those writing in RTL languages to have correctly aligned text.
Steps to Reproduce: Start a sentence with English text. Continue the sentence with Persian/Arabic text. Notice the misalignment of RTL text within the sentence.
Expected Behavior: Text should respect its natural directionality. If a sentence starts in RTL, the alignment should default to right-aligned, ensuring consistency throughout.
Suggestion: Implement automatic detection for RTL and LTR languages and adjust text direction accordingly.