Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Moeez448's avatar

Arabic Localization for api not workin fine.

I am using localization in my app. I want to return the Api response in Arabic sometime but I am getting this error.

{"data":[],"message":"\u0639\u0630\u0631\u0627 \u060c \u0647\u0630\u0627 \u0627\u0644\u0639\u0636\u0648 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f","status":false} *

Here is my response

return $this->responseApi([], false, __("api.Sorry, This member does not exist"), 401); *

Please help me solve the issue

0 likes
1 reply
rodrigo.pedra's avatar

What is going wrong?

What you pasted is the UTF-8 serialized version of your payload.

If you try it on console, you get:

var json = {"data":[],"message":"\u0639\u0630\u0631\u0627 \u060c \u0647\u0630\u0627 \u0627\u0644\u0639\u0636\u0648 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f","status":false};

console.log(json.message);
// عذرا ، هذا العضو غير موجود

Google translates it to: "Sorry, this user does not exist", which seems correct (sorry I don't know Arabic).

You need to parse the textual JSON representation from your response. By default JSON will be encoded in UTF-8.

Please or to participate in this conversation.