GET /v25.0/{app-id}/translations?locale=fr_FR HTTP/1.1
Host: graph.facebook.com/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{app-id}/translations?locale=fr_FR',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */Bundle params = new Bundle();
params.putString("locale", "fr_FR");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{app-id}/translations",
params,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();NSDictionary *params = @{
@"locale": @"fr_FR",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{app-id}/translations"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| 이름 | 설명 | 유형 |
|---|---|---|
| 요청할 언어의 로캘을 지정합니다. 이 에지를 읽을 때 필수 매개변수입니다. |
|
| 이름 | 설명 | 유형 |
|---|---|---|
| 각 문자열의 고유 ID입니다. |
|
| 번역된 문자열입니다. |
|
| 문자열의 승인 상태입니다. |
|
| 번역된 원본 문자열입니다. |
|
| 문자열에 대해 제공된 설명입니다. |
|
이 에지를 사용하여 앱에서 번역할 새로운 문자열을 지정할 수 있습니다.
POST /v25.0/{app-id}/translations HTTP/1.1
Host: graph.facebook.com
native_strings=%5B%7B%22text%22%3A%22Test+String%22%2C+%22description%22%3A+%22This+is+a+test+string+for+an+app.%22%7D%5D/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{app-id}/translations',
array (
'native_strings' => '[{"text":"Test String", "description": "This is a test string for an app."}]',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */Bundle params = new Bundle();
params.putString("native_strings", "[{\"text\":\"Test String\", \"description\": \"This is a test string for an app.\"}]");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{app-id}/translations",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();NSDictionary *params = @{
@"native_strings": @"[{\"text\":\"Test String\", \"description\": \"This is a test string for an app.\"}]",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{app-id}/translations"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| 이름 | 설명 | 유형 |
|---|---|---|
벡터 | 벡터 | 벡터 |
성공하는 경우 추가된 문자열 수가 포함된 일반 응답을 수신하게 됩니다. 실패하는 경우 오류 메시지를 수신합니다.
다음의 작업을 사용하여 번역 문자열을 삭제할 수 있습니다.
<code-tabs-path language="phpsdk,iossdk,androidsdk,http" method="DELETE" param='{"native_hashes":"['hash1', 'hash2']"}' path="/{app-id}/translations" rendering_context="1" />
| 이름 | 설명 | 유형 |
|---|---|---|
| 각 번역 문자열에 대해 해시로 구성된 배열입니다. 이 해시는 각 문자열의 고유한 식별자이고 |
|
성공하는 경우 삭제된 문자열 수가 포함된 일반 응답을 수신하게 됩니다. 실패하는 경우 오류 메시지를 수신합니다.