Issue with RTL formatted language mixed with Latin words
There is a problem that I'm not sure it is related to Grammy or not. When using RTL language text (like Persian) that has LTR words within the Latin word get reversed. example
# fa.ftl
start = سلام { $name }! چطور میتونم کمکت کنم؟
The above sentence in English is "Hello { $name}! how can i help you?"
if name is Parsa (which is loaded from ctx.from.first_name) the result must be like below: سلام Parsa! چطور میتونم کمکت کنم؟ but the the result will be like this: سلام asraP! چطور میتونم کمکت کنم؟
I tried the Fluent playground to check if it's related to Fluent but it's not! check the link below: https://projectfluent.org/play/?id=2b91a538f800639b728f09d8853889e6
Is its result really that or is it just your client rendering it that way?
Maybe this will help. the second reply is displayed correctly in telegram.
bot.command('test', async ctx => {
await ctx.reply(ctx.t('start', { name: 'Parsa' }))
await ctx.reply('سلام Parsa! چطور میتونم کمکت کنم؟')
})
Do you have useIsolating set to false in the i18n/fluent configuration? It is recommended to be enabled for RTL languages. That should be why you're having this issue.
See for more information: https://github.com/projectfluent/fluent.js/wiki/Unicode-Isolation
Closing due to inactivity. Feel free to re-open if the issue still persists.