Before building a script, you must understand the basics of Codex profiles. You can find all the information about Codex and the profiles here.


Basics


For files such as properties files, if you want to extract the whole content, you can leave the script to its default configuration:

selectionPathList = []
contextsPath = []
groupingPaths = []
contentNames = []
groupingPathNames = []
targetInjections = []
targetInjectionsRange = []

You can, however, extract only some part of the content using the patterns present in the properties.

Here if you only want to extract the first part of the content, just modify your script like that:

selectionPathList = [Pair("sample.of.value", True)]


Improve your scripts


Split your large files with the groupingPaths parameter


codexSeparator parameter

Properties files can be very large and contain a lot of keys. In order to generate small bundles of keys and therefore tasks to translate, you can make use of the codexSeparator parameter for groupingPaths:

groupingPaths = [Pair("codexSeparator",".")]

When extracting .properties files using this parameter, tasks that belong to the same parent keys will be grouped together.


codexGroupingSize parameter

In case you would like to go even further with splitting tasks, you can specify the maximum number of keys within the same task using the codexGroupingSize parameter:

groupingPaths = [Pair("codexGroupingSize", "20")]

When extracting .properties files using the codexGroupingSize parameter, tasks will contain a maximum of 20 keys.


Give context to your localizable content with the contextPaths parameter


The localization process can be improved by providing translation context.

You can indicate in the script which keys should be used as translation context, and their values will then be displayed on the Details panel of the Translation Studio.

Here is a sample script to extract some content as context:

contextsPath = [Pair("different.sample.of.value", True)]

Here we've added the second group which as a pattern like different.sample.of.value as context.


URLs & Images

To have clickable URLs in the Translation Studio Details panel, make sure they are provided between "[url=" and "]" tags.

ex: [url=https://helpdesk.wezen.com]


To have images displayed in the Translation Studio Details panel, make sure they are provided between "[img=" and "]" tags.

ex: [img=https://wezen.com/yourimage.jpg]