i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.32k stars 1.03k forks source link

How to use Trans component for Arabic language? #1793

Closed AsuraKev closed 3 months ago

AsuraKev commented 3 months ago

hi there. Is Arabic rtl supported in Trans component? Could you please give an example on how it’s done?

thanks

adrai commented 3 months ago

The Trans component is just like the t function, they are not aware of the direction, this needs to be managed by you... To check if the current language is rtl or ltr you can use the dir function: https://www.i18next.com/overview/api#dir

AsuraKev commented 3 months ago

@adrai Thanks but when I try to put a bracket <0>arabic text its jumping around. any idea how to get around it with interpolation?

I have the following arabic in the json file where the square bracket needs to be replace with <0> etc but the interpolation is not quite working

من خلال تسجيل أعضاء فريقي، فإنني أوافق على [شروط الاستخدام] الخاصة بشركة Something Elseوأوافق على [بيان الخصوصية].

By signing up my team members, I accept the Something Else <1><0>terms and acknowledge the <3><0>privacy.

SUCHiDEV commented 3 weeks ago

I have the same issue