cancel
Showing results for 
Search instead for 
Did you mean: 

How to distinguish between strings when English or Japanese via ABSL?

0 Kudos

Dear All,

As the title,

How to distinguish between strings when English or Japanese via ABSL?

I tried to use regular expressions or ASCII values to judge, but none of them can be implemented.

Thanks and BR?

Jiang

Accepted Solutions (0)

Answers (2)

Answers (2)

dhruv_mehta
Active Contributor
0 Kudos

Hi @Eason,

This is because user logged in English and maintained in JAPANESE or this field is maiteined via WS.

So basically the language code is something cant be used now 😞

I am afraid you need to check if u can use some APIs which can detect languages.

like : https://cloud.google.com/translate/docs/detecting-language

Since it's a REST service you'll be able to integrate it without issues in your C4C using the SAP Cloud Application Studio.

The documentation has an example like this one:

https://translation.googleapis.com/language/translate/v2/detect?key=YOUR_API_KEY&q=Hallo Welt

And the service will return something like:

{"data":{"detections":[[{"language":"de","isReliable":false,"confidence":0.18397073}]]}}

BR

Dhruvin

former_member183363
Active Contributor
0 Kudos

Jiang,

Depending on the field you got the string from, there might be a 'languageCode' sub-field which you can use.

Lewis

0 Kudos

Hi, Lewis,

Thanks for your reply,

please help to confirm the image,the name is Japanese but the languageCode is still 'EN'.

Do you have some new idea?

Best regards,

Eason