必需配置
可选配置字段
sourceLanguagetargetLanguagestimeoutSecondsfileFormat(当mode为files时必填)
模式
strings:使用 Phrase key 和翻译 API 进行拉取和推送。files:使用 Phrase 导出/导入任务进行拉取和推送。
常见问题
- 未找到标记:export
PHRASE_API_TOKEN - 模式验证错误:将
mode设置为strings或files - 文件模式导入失败:请验证
fileFormat是否与你的项目设置一致
Phrase CLI 配置
文件工作流命令也可以读取 Phrase 的.phrase.yml格式:
hyperlocalise phrase config validate --config .phrase.ymlhyperlocalise phrase upload sources --config .phrase.ymlhyperlocalise phrase download translations --config .phrase.yml
--config,Hyperlocalise 会先检查 PHRASEAPP_CONFIG,然后检查当前目录中的 .phrase.yml,再检查 $HOME/.phrase.yml。