.strings 파일을 .strings.json 파일로 변환

.strings 파일을 .strings.json 파일로 변환하려면 다음을 실행하세요.

  1. 7.12 이전 버전의 Looker를 사용하는 경우 현지화를 위한 기존 .strings 파일 기존 기능을 사용 중지하세요.
  2. 프로젝트 파일 목록의 오른쪽 상단에 있는 + 아이콘을 클릭하고 Locale Strings 파일 만들기를 선택하여 프로젝트에 새 .strings.json 파일을 만듭니다.
  3. .strings.json 파일의 이름을 지정합니다. .strings 파일의 제목은 해당 언어를 사용하는 사용자 또는 그룹에 할당된 언어 코드와 일치해야 하며 기본 언어 파일의 제목은 프로젝트의 매니페스트 파일에 있는 default_locale 값과 일치해야 합니다.
  4. .strings.json 파일에 표시되는 스니펫은 JSON 형식 지정의 예시를 제공합니다. 이 예시를 삭제하고 중괄호 {}로 바꿉니다.
  5. 이전 .strings 파일에서 키-값 쌍을 복사하여 중괄호 안에 붙여넣습니다.
  6. 모든 등호는 콜론으로 바꿉니다.
  7. 댓글을 삭제합니다. 아래 그림과 같이 개별 주석 또는 주석 배열로 형식을 다시 지정합니다.
  8. 모든 세미콜론을 쉼표로 바꿉니다.

키-값 쌍의 일반적인 .strings.json 형식은 다음과 같습니다.

{
    "flight_info" : "Flight Info",
    "id" : "Identifier",
    "airline" : "Air Carrier"
}

주석의 형식을 지정하려면 다음 형식을 사용합니다.

{
    " My Comment": {
        "my_comment_array": [
        "The name of this file should be the associated locale code followed by '.strings.json'",
        "There is one .strings.json file per locale.",
        "Define your translated strings one key at a time demonstrated below",
        "Keys can be any string; choose whatever scheme helps you stay organized",
        "Then, set your Lookml label and description parameters to the desired key values.",
        "To choose this file as the master key list and as the one to validate against",
        "set its locale code ('test') as the default_locale in the manifest file"
        ],
        "value": "Translation for My Comment"
    },
    "My Key": {
        "value": "Translation for My Key",
        "comment": "Define your translated strings with a comment or array of comments as above"
    }
}