找到你要的答案

Q:When exporting XLIFF from Xcode, how to exclude dummy strings?

Q:当出口XLIFF从Xcode,如何排除假弦?

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.

How do I exclude such strings from XLIFF file?

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文件这样的字符串?

answer1: 回答1:

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.

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.

answer2: 回答2:

For me I use this XLIFF Online Editor to edit the xliff file. It will be easy to you to ignore the dummy text or anything you need.

我用这个XLIFF在线编辑器编辑XLIFF文件。这将是你很容易忽略虚拟文本或任何你需要。

xcode  scripting  localization