【发布时间】:2020-09-24 14:59:21
【问题描述】:
我们在移动应用 CI 环境中使用 Weblate。到目前为止,一切都很棒。 Weblate 在 docker 环境中运行(v4.1)
现在我想改进工作流程。
我设法创建了自定义检查,这些检查验证了 Android/iOS 占位符的使用(参见下面的示例)。现在翻译者需要知道他正在使用哪个平台来使用正确的占位符并取消误报检查。
目前使用的占位符是 %1$@ 用于 iOS 和 %1$s 用于 Android
我的问题:
- 是否有更好/通用的方法可以教我的翻译人员如何编写占位符?
- 如何根据文件格式(或翻译文件后缀,即 .xml、.strings)编写支票?所以我知道,这是一个android/xml文件,占位符应该是
%1$sNOT%1$@
样品检查
class iOSPlaceholderCheck(TargetCheck):
# Used as identifier for check, should be unique
# Has to be shorter than 50 characters
check_id = "iOSPlaceholder"
# Short name used to display failing check
name = _("iOS placeholder")
# Description for failing check
description = _("Your translation contains an iOS placeholder")
# Real check code
def check_single(self, source, target, unit):
if "%1$@" in target:
return True
...
提前致谢
【问题讨论】:
标签: android ios localization weblate