I'm working with the app store connect api. I'd like to update the keywords for an appStoreVersionLocalization.
I'm getting the following error code: ENTITY_ERROR.ATTRIBUTE.INVALID.TOO_LONG
And I've tried limiting the length of the keywords using:
let shortenedKeywords = String(keywords.prefix(100))
But I'm still running into the mentioned error.
The following string is valid:
ตัวแก้ไข xliff, การแปลเป็นภาษาท้องถิ่น, เครื่องมือ xliff, xcode, การแปล xliff, xcloc, การแปลงข้อความ
and it returns a character count of 91.
If I do something like: let shortenedKeywords = String(keywords.prefix(80))
The error goes away.
Mostly hoping to understand why/how the character limit is calculated for Thai and if it's somehow different.
Thanks!
Full error included below:
String data is: {
"errors" : [ {
"id" : "d4813683-949d-4a62-b4d2-7aac248add3c",
"status" : "409",
"code" : "ENTITY_ERROR.ATTRIBUTE.INVALID.TOO_LONG",
"title" : "An attribute value is too long.",
"detail" : "Keywords for Thai cannot be longer than 100 characters.",
"source" : {
"pointer" : "/data/attributes/keywords"
}
} ]
}
This is an example request:
curl -X "PATCH" "https://api.appstoreconnect.apple.com/v1/appStoreVersionLocalizations/{id}" \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "appStoreVersionLocalizations",
"attributes": {
"keywords": "ตัวแก้ไข xliff, การแปลเป็นภาษาท้องถิ่น, เครื่องมือ xliff, xcode, การแปล xliff, xcloc, การแปลงข้อความ xliff"
},
"id": "a4f0ba21-a8ea-4d6b-a162-bf34f36268cc"
}
}'