i18next / react-i18next

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

How to use Trans component for Arabic language? #1793

Closed AsuraKev closed 3 weeks ago

AsuraKev commented 3 weeks 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 weeks 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 weeks 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.