Translation Tools - How to use the variable function?
In this article, you'll find how to use the variable function.
When to use a variable function?
Sometimes, due to a (group of) word(s) displayed several times in your content, multiple (almost similar) strings could be generated in your Translation List.
Rather than manually add the same translation rule in a very repetitive way (as shown below), you should use the variable function to only make one translation rule.
Example: Here, size or titles are repeated several times in the Translation List due to their number (another example is the order number, you'll have as many strings as your sales volume).
From your Translation Tools tab, when you set an Always Translate or a Never Translate rule, you will need to put the expression/word between two % for the position of the variable in the string: %word_of_your_choice%.
In our example, rather than exclude each "id Order", such as "2332", "2335", etc. separately, you can set
Doing this, your rule will exclude every (almost similar) repeated string.
Once a rule is set, every content which is exactly similar to your...
- ..."Never Translate" rule will be excluded from your translation process.
- ..."Always Translate" rule will be correctly replaced as defined.
If the string is 100% similar to your rule, the content taken into account will not be stored/displayed into the Translation List.
- Your translations show several strings related to your orders. However, your word count takes into account each strings.
- To avoid this, you can add a var function (Translation Tools > Translation Exceptions > Always translate), such as:
Commande n°%number% by
- Once it is done, the rule is taken into account for each related strings on your website.
- Plus, finally, there are no extra strings generated.