그래프 API 버전

/{app-id}/translations

Facebook의 번역 도구를 사용하여 번역된 이 앱의 문자열입니다.

읽기

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
}];

권한

  • 해당 앱에 대한 번역을 반환하려면 앱 액세스 토큰이 필요합니다.

수정자

이름 설명 유형

locale

요청할 언어의 로캘을 지정합니다. 이 에지를 읽을 때 필수 매개변수입니다.

enum{locale}

필드

이름 설명 유형

id

각 문자열의 고유 ID입니다.

string

translation

번역된 문자열입니다.

string

approval_status

문자열의 승인 상태입니다.

enum{auto-approved, approved, unapproved}

native_string

번역된 원본 문자열입니다.

string

description

문자열에 대해 제공된 설명입니다.

string

게시

이 에지를 사용하여 앱에서 번역할 새로운 문자열을 지정할 수 있습니다.

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" />

권한

  • 해당 앱에서 번역 문자열을 삭제하려면 앱 액세스 토큰이 필요합니다.

필드

이름 설명 유형

native_hashes

각 번역 문자열에 대해 해시로 구성된 배열입니다. 이 해시는 각 문자열의 고유한 식별자이고 translation FQL 테이블을 사용하여 가져올 수 있습니다.

string[]

응답

성공하는 경우 삭제된 문자열 수가 포함된 일반 응답을 수신하게 됩니다. 실패하는 경우 오류 메시지를 수신합니다.