Skip to content
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

Added support for Arabic language and right-to-left direction #2116

Merged
merged 3 commits into from
Jun 24, 2023

Conversation

Zizwar
Copy link
Contributor

@Zizwar Zizwar commented Jun 24, 2023

hi this is the modified code to support the Arabic language and right-to-left direction. Additionally, I ensured that code snippets consistently appear in ".markdown-body pre", always from left to right.

In the ".markdown-body" section, I added a condition to check for Arabic characters in the 'test' operation. If Arabic characters are found, it will reverse the language direction. This is important because the input text from the user or GPT may contain English or other languages, and we want to maintain the original writing direction.

Please review the code and confirm the point of detecting Arabic characters. Will it affect the application's performance?

direction: /[\u0600-\u06FF]/.test(props.content) ? 'rtl' : 'ltr'"

test demo: https://jpt-ma.vercel.app
GPT-next-web

@Yidadaa Yidadaa merged commit 0658a93 into ChatGPTNextWeb:main Jun 24, 2023
alchemist139 pushed a commit to alchemist139/ChatGPT-Next-Web that referenced this pull request Sep 21, 2023
Added support for Arabic language and right-to-left direction
gaogao1030 pushed a commit to gaogao1030/ChatGPT-Next-Web that referenced this pull request May 16, 2024
Added support for Arabic language and right-to-left direction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants