Skip to main content

Rigi Documentation

Project settings – Strings recognition

To access this section, in the project menu, select Settings > Сontext > Strings recognition.

Settings_-String_recognition.png

This section specifies how Rigi recognizes the following items on a web page:

  • string identifiers for the shown text determined via the Rigi tokens. For details, see the Rigi tokens section.

  • variables within recognized texts (e.g., {0}).

  • substitutions with other string identifiers for various formats (e.g., $(someId)).

Table 33.

Setting

Description

Variables in strings

This section is for information purposes. It shows the placeholders defined by the parsers in the workspace. For details, see the Generic parser settingssection.

Text substitution support

Enter the text substitution pattern (regular expression).

Note

A text substitution variable is used to replace a part of the text with a translation of another variable. For example, the string The $(goal) is having fun contains text substitution variable $(goal) , where goal is the string identifier in this project. If the translation of this variable is 'objective', the resolved string will be The objective is having fun.

Rigi Token format

By default, Rigi tokens are decoded using invisible Unicode characters.

If an application does not support Unicode characters, you can select Alphanumeric decoding.

Note

 Alphanumeric tilde decoding is similar to Alphanumeric decoding but uses ~ instead of % signs.


Projects without variables

99% of projects contain string variables. In most cases, the absence of these variables indicates a configuration error.

If no placeholders for variables are defined, developers will see a configuration error message when they attempt to capture HTML previews. Also, the String recognition section will display an additional checkbox with this label: This project has no placeholder patterns defined for variables in strings. Suppress warning messages during the capturing process of HTML Previews.

Settings_-String_recognition_option2.png

In some rare cases, variables are not present, but this is correct. In such cases, select this checkbox to confirm that the project does not contain placeholders for variables. Then, developers will no longer receive the configuration error messages mentioned above.

UI texts can contain variables. For example, the variable {0} in the string "Number of items: {0}" will be replaced with a value at run time.

Each parser has a set of default regular expressions. For example, the JSON parser detects variables such as {0}, {1}, or {{0}}. For details, see the Specific parser settings section.

It is possible to extend the set of regular expressions in the parser settings. For details, see the Configure parser settings guide.

When Rigi presents a translated string that contains a variable in a preview, it will substitute that variable with the value that was present at the moment the HTML preview was captured.

In this example, the opening times on Monday are from 7:00 AM to 8:00 PM. Rigi recognizes those values when the HTML preview is captured and substitute them when the preview is presented in the target language.

String_variables.png

A text substitution variable is used to replace a part of the text with the translation of another variable. For example, the string "The $(goal) is to have fun." contains the text substitution variable $(goal), where goal is the string identifier in this project. If the translation of that variable is "objective", then the resolved string will be "The objective is to have fun.".

To check text substitutions, perform the following steps:

  1. Open the Rigi online editor.

  2. Select a source or target string in the editor that contains a substitution variable.

    String_recognition.png

    In this example, the variable $(en.LOGIN_PAGE.LOGIN) refers to another string. Rigi Viewer will now show the Substitution button.

  3. In Rigi Viewer, click the Substitution button in the top right-hand corner of the Context mode screen.

    Substitution.png

    The Substitution popup containing both original and resolved texts will be displayed.

    String_recognition3.png

  4. Select another text in the editor. If this text also contains substitution variables, the text in the popup will be updated.