Cherry Picker
The idea behind the cherry picker is that you can 'ignore' file(s) (not keys) for specific locales. Say you have ten files and you want to send 9 files to translate into French and German but not Japanese and all ten to all locales. You can. This feature sometimes lead to misunderstanding so use it with care and remember to remove/rename the cherry picker file when done cherry picking!
The mechanics:
- Create a file under the project configuration directory named
config_file_cherry_picker.xml
. - Edit that file to say what file to include for what locale in the next prep kit. If you have a 'fake' file, no files will be sent.
Example 1
For instance, let's say that you want to send 9 files out of 10 to translate into French and German and all ten for the remaining locales. You could write a Cherry Picker like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <file-cherry-picker> <locales> <!-- Send 9 files out of 10 for German & French --> <locale code="de"> <files-include> <include file="/locales/file1_de.json"/> <include file="/locales/file2_de.json"/> <include file="/locales/file3_de.json"/> <include file="/locales/file4_de.json"/> <include file="/locales/file5_de.json"/> <include file="/locales/file6_de.json"/> <include file="/locales/file7_de.json"/> <include file="/locales/file8_de.json"/> <include file="/locales/file9_de.json"/> </files-include> </locale> <locale code="fr"> <files-include> <include file="/locales/file1_de.json"/> <include file="/locales/file2_de.json"/> <include file="/locales/file3_de.json"/> <include file="/locales/file4_de.json"/> <include file="/locales/file5_de.json"/> <include file="/locales/file6_de.json"/> <include file="/locales/file7_de.json"/> <include file="/locales/file8_de.json"/> <include file="/locales/file9_de.json"/> </files-include> </locale> </locales> </file-cherry-picker>
In this example, if the locales
directory has 10 files, only 9 are sent for French and German; The other locales in this LRM project are not affected.
Example 2
Now let's say that for Chinese you do not want to send any files. You could write a Cherry Picker like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <file-cherry-picker> <locales> <!-- Put Simplified Chinese on hold --> <locale code="zh-Hans"> <files-include> <include file="/locales/fake_zh-Hans.json"/> </files-include> </locale> </locales> </file-cherry-picker>
In this example, the cherry picker is set for the zh-Hans
locale. It states that for that locale, the file to be included is a fake file, fake_zh_Hans.json
. Since that file does not exist, no files will be sent for translation. Sending resource bundles for the other locales in the LRM project are not affected.
Here is another example:
You can have as many locales as you want and include as many files as you want. When the files are ready to be prepped (for whatever reason), you can rename/delete that file and all the files for all locales will be back on the prep kit train.
Don't forget to remove or rename this file once you are done with cherry picking.