从Xcode导出XLIFF时,如何排除虚拟字符串? [英] When exporting XLIFF from Xcode, how to exclude dummy strings?
问题描述
我正在使用Xcode的Editor > Export For Localization...
导出XLIFF文件进行翻译
但是Main.storyboard的翻译中包含许多不必要的字符串,其中大多数是占位符/虚拟对象,这些在设计时很有用.
I'm using the Xcode's Editor > Export For Localization...
to export XLIFF file for translation
but the translations for the Main.storyboard includes a lot of unnecessary strings, mostly placeholders/dummies that are useful at design time.
如何从XLIFF文件中排除此类字符串?
How do I exclude such strings from XLIFF file?
推荐答案
I've written a script that excludes certain translation.
How it works?
cmd-line: python strip_loc.py input.xliff output.xliff exclude_list.txt [-v]
Example usage:python strip_loc.py en.xliff en-stripped.xliff exclude_words.txt -v
The exclude_list.txt is a file with a string per line. The script parses this list and creates a dictionary of banned words. If a translation with source containing one of these strings is encountered, the whole translation unit is removed from the output xml/xliff.
这篇关于从Xcode导出XLIFF时,如何排除虚拟字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!