多平台本地化

翻译多系统平台(如 Android 和 iOS)项目时,为每个平台配置单独的部件。翻译传播 会帮助你保持字符串同步。

最佳实践:

  • 每一平台创建一个部件 (如 MyApp Android, MyApp iOS)。

  • 确保不同平台在可能的地方使用相同的源字符串和键。

  • 开启 允许同步翻译 自动地为匹配的字符串重用译文。

这一设置避免重复工作并保持不同平台上的译文一致性。

Translation propagation only reuses matching strings. The source text and context have to be identical. For monolingual formats, the key has to match as well. Propagation does not convert message syntax or semantics, so strings using different placeholder syntaxes, such as Hello {name} and Hello %s, do not match.

When consumers use the same messages but require different runtime representations, consider keeping one canonical localization format and generating consumer-specific resources in the build pipeline. This also allows the generated resources to contain only the strings and languages needed by each consumer. Use separate components when translators need to maintain genuinely different messages. Disable translation propagation for these components, or assign distinct keys or contexts to platform-specific messages, so later edits do not overwrite intentional differences.