Amer Mograbi
Amer Mograbi

Reputation: 489

facebook chatbot localization of greeting message not working

I'm trying to localize the greeting message in my facebook chatbot. Here is the curl command I sent to do this: curl -X POST -H "Content-Type: application/json" -d '{ "greeting":[ { "locale":"default", "text":"Hi {{user_first_name}}" }, { "locale":"ar_AR", "text":"مرحبا {{user_first_name}}"
} ] }' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=MY_TOKEN_HERE"

This command succeeded.

When my smartphone's language is set to english I get the english one normally. However, when I switch my phone to arabic, I get question marks instead of the arabic text saying 'مرحبا'.

I would like to know why I'm getting question marks even though my text is in arabic. What I ultimately want to do (If possible) is to set the default text to arabic text so it always shows that even if the smartphone's language is set to english or something else.

P.S. I got the arabic locale string representation from here.

Upvotes: 0

Views: 342

Answers (1)

C3roe
C3roe

Reputation: 96151

You need to properly escape non-ASCII characters.

{"text":"\u0645\u0631\u062d\u0628\u0627 {{user_first_name}}"} would be the proper JSON representation of an array containing one element with the key text and the content مرحبا {{user_first_name}}

Upvotes: 2

Related Questions