When exporting XLIFF from Xcode, how do I exclude dummy strings?

I use Xcode Editor > Export For Localization... to export an XLIFF file for translation, but translations for Main.storyboard include many unnecessary lines, mostly placeholders / mannequins, which are useful during development.

How to exclude such lines from an XLIFF file?

+6
source share
2 answers

I wrote a script that excludes a specific translation.

How it works?
cmd string: python strip_loc.py input .xliff output .xliff exclude_list .txt [-v]

Using an example:
python strip_loc.py en.xliff en-stripped.xliff exclude_words.txt -v

The exclude_list.txt file is a file with a line in line. The script parses this list and creates a dictionary of forbidden words. If a translation is found with a source containing one of these lines, the entire translation unit is deleted from the output xml / xliff file.

+3
source

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

0
source

Source: https://habr.com/ru/post/986232/


All Articles