지원되는 파일 유형(Strings)

.JSON - React-Intl Simple (Strings)

컨텐츠는 영어 텍스트를 Phrase Language AI를 이용해 기계 번역한 것입니다.

파일 확장명

.json

API 확장

react_simple_json

가져오기

내보내기

복수형 지원

설명 지원

네, 기본 메시지 추출을 사용합니다.

React-Intl는 기본적으로 React에서 개발된 어플리케이션을 위한 국제화(i18n) 및 (현지화)를 단순화하기 위해 설계된 JavaScript 라이브러리입니다. 기본적으로 React-Intl은 .js 파일을 사용하여 현지화된 컨텐츠 저장합니다. 현지화된 컨텐츠 소스 참조할 표준화된 .JSON 파일(React-Intl Simple JSON)으로 분리됩니다.

중첩된 메시지를 사용하는 경우 React-Intl 중첩된 JSON 형식 사용. 이 기능은 React Intl v2에서 사용이 중단됩니다.

AI 채팅봇은 .JSON 파일에서 키 목록 생성하는 데 매우 효과적입니다.

코드 샘플

{
  "boolean_key": "--- true\n",
  "empty_string_translation": "",
  "key_with_description": "검토하세요! 이 키에는 설명이 있습니다! (최소 일부 형식으로)",
  "key_with_line-break": "This translations contains\na line-break.",
  "nested.deeply.key": "내가 중첩된 키.",
  "nested.key": "이 키는 네임스페이스 내에 중첩되어 있습니다.",
  "null_translation": null,
  "pluralized_key.one": "하나의 고양이만 발견되었습니다.",
  "pluralized_key.other": "Wow, you have %s kittens!",
  "pluralized_key.zero": "고양이 없음.",
  "sample_collection": [
    "first item",
    "second item",
    "third item"
  ],
  "simple_key": "간단한 키, 간단한 메시지, 정말 간단해."
  "unverified_key": "이 번역은 아직 확인되지 않았으며 기다리고 있습니다. (일부 형식에서는 이 상태도 내보냅니다.)"
}

React Intl 사용

번역이 일반적으로 .js 파일에 있습니다.

module.exports = {
    "locales": ["en-US"],
    "messages": {
        "hello" : "World",
        other_hello : '기타 세계',
    },
    "formats": {}
};

메시지를 별도의 로캘 파일로 이동합니다(예: en-US.json:

{
    "hello" : "World",
    other_hello : '기타 세계',
}

메시지에 유효한 .JSON 구문이 있는지 확인하십시오.

{
    "hello" : "World",
    "other_hello" : "기타 세계"
}

필요 명령이 포함된 메시지를 포함합니다.

module.exports = {
    "locales": ["en-US"],
    "messages": require('./en-US.json'),
    "formats": {}
};

이제 React-Intl Simple JSON 형식 사용하여 React Intl 로캘 파일을 업로드/다운로드할 수 있습니다.

JSON 파일에 대한 복수

다양한 라이브러리에 있는 복수의 키 메시지의 가장 일반적인 형식:

"messages": {
    "one": "One message received.",
    "other": "%s messages received.",
    "zero": "No messages received."
}
도움이 되었습니까?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.