Lingo.dev + .xcstrings (Xcode)
Lingo.dev CLI는 복수형 규칙, 기기 변형 및 iOS 특정 메타데이터를 보존하면서 Xcode .xcstrings 파일을 번역합니다. CLI는 Xcode의 현지화 워크플로우와 직접 작동하고, 코드에서 접근 가능한 문자열 상수를 생성하며, 복잡한 iOS 복수형 규칙을 자동으로 처리하고, 플랫폼별 문자열 변형을 지원하며, Xcode 빌드 프로세스와 원활하게 통합됩니다.
빠른 설정
Xcode의 현대적인 문자열 카탈로그 형식을 위한 구성:
{
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"xcode-xcstrings": {
"include": ["Resources/Localizable.xcstrings"]
}
}
}
문자열 카탈로그 번역
npx lingo.dev@latest i18n
iOS 규칙을 보존하면서 복수형, 기기 변형 및 Xcode 특정 메타데이터를 자동으로 처리합니다.
문자열 카탈로그 기능
기본 현지화
{
"sourceLanguage": "en",
"strings": {
"welcome_message": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Welcome to our app!"
}
}
}
}
}
}
복수형 변형
{
"item_count": {
"localizations": {
"en": {
"variations": {
"plural": {
"zero": {
"stringUnit": {
"state": "translated",
"value": "No items"
}
},
"one": {
"stringUnit": {
"state": "translated",
"value": "%d item"
}
},
"other": {
"stringUnit": {
"state": "translated",
"value": "%d items"
}
}
}
}
}
}
}
}
기기 변형
iPhone, iPad, Apple Watch 및 기타 Apple 플랫폼에 대한 기기별 문자열을 지원합니다.
형식 보존
- 메타데이터 유지: 상태, 주석 및 추출 상태 보존
- 변형 안전: 모든 복수형 및 기기 변형 유지
- 구조 보존: JSON 계층 구조 및 Xcode 특정 키 변경 없음
- 플레이스홀더 안전:
%@
,%d
와 같은 iOS 형식 지정자 유지
고급 구성
다중 카탈로그
"xcode-xcstrings": {
"include": [
"Resources/Localizable.xcstrings",
"Resources/InfoPlist.xcstrings"
]
}
시스템 키 잠금
"xcode-xcstrings": {
"include": ["Resources/Localizable.xcstrings"],
"lockedKeys": ["CFBundleName", "NSHumanReadableCopyright"]
}
번역가 노트
Xcode .xcstrings 파일은 문자열 항목의 comment
필드를 통해 번역가 노트를 지원합니다. 이러한 노트는 번역 중 AI 모델에게 필수적인 컨텍스트를 제공하여 각 문자열의 의도와 사용법을 이해하는 데 도움을 줍니다.
{
"strings": {
"light_mode": {
"comment": "UI theme setting - refers to brightness, not weight",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Light Mode"
}
}
}
},
"records_label": {
"comment": "Medical context: patient health records, not audio recordings",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "View Records"
}
}
}
}
}
}
자세한 내용은 번역가 노트를 참조하세요.