How to Use Variables & Placeholders
This article will explain GL Strings variables and placeholders and how they are utilized in GL Strings projects.
GL Strings merges multiple concepts under the term Variables on the dashboard:
%@
(iOS String) or %s
(Android String){0}
(C#), or { {var_name} }
(AngularJS)On the GL Strings dashboard placeholders are often referred to as Variables, except for placeholder conversion between android and iOS. When uploading strings to the GL Strings dashboard, placeholders found within strings are included in the upload. GL Strings variables ensure that placeholder content within source text are included in the target translation.
Variables are highlighted in gray in the Editor.
If content with variables is included in translation orders via the GL Strings Order menu, variables are removed from the editable text. The TransPerfect translators will not be able to alter the content inside a variable. This prevents any accidental issues with the code such as the removal of a bracket. When translations are delivered, they will contain the variable placed at the most appropriate section of the sentence by the translator.
If the content within variables needs to be translated, the variables can be removed from the string via the Editor interface. However, this might have an impact on the application that will be ingesting the content.
The GL Strings SDK and CLI includes a new feature to convert iOS and Android placeholders within strings. Placeholder conversion reduces the translation workload for multi-platform projects. If you are developing for multiple platforms and plan to share your translations between the platforms, our placeholder conversion can help. See the Placeholder Conversion article for more details.
If a key has a variable in the source value and that variable is completely missing or even just slightly different in the target value, the String Management Interface generates a warning. Users can filter to locate those strings with the missing variables filter.