Edit resource files while keeping Rigi identifiers
Rigi creates unique identifiers for UI strings based on the file ID of a resource file and the string ID of the key within that resource file. Changing the resource files can affect those identifiers and disrupt the translation process. This article describes how to keep the Rigi identifiers when making changes to the resource files.
Developers upload a new set of files to the workspace. A resource file is moved from one folder to the other. In the workspace, the old file should be deleted, and the new file should be assigned to the workspace.
To keep Rigi identifiers, assign the old file ID to the new file.
For multiple files, use the mass rename file IDs functionality. For details, see the Mass rename file IDs guide.
In some cases, developers might want to split a resource file into multiple files. To assign the same file ID to all the derived files, the keys across those files should be unique.
The project has a file feature.json (fileId = feature). Therefore, all strings in the project have Rigi identifier: feature.{key}.
Split the file into featureA.json and featureB.json and give both files file ID = feature.
All Rigi identifiers will be feature.{key} and stay compatible with the original configuration.
Important
The strings in the file are unique. If you add new strings, consider adding a prefix to the new keys. In a JSON file, you could add a root section featureA. Then all new Rigi identifiers be feature.featureA.{key}.
In this scenario, a customer captured many HTML previews and translated the application into many languages using those HTML previews. Then, the developers decided to refactor the code. They move strings from the main resource file to multiple smaller ones. It is not possible to keep the file IDs the same because multiple resource files might have defined the same keys.
To handle this situation, use the project dependencies functionality. For details, see the Project settings – Dependencies section.
Create a clone of the project. For details, see the Clone a project guide.
Create a new project in Rigi.
In the project menu, select Settings > Project > Dependencies.
Select the original project as an associated project.
Now, when a translator opens an HTML preview in which the string identifiers cannot be found, it will show the translations from the original project.
If a new language is added from scratch, then the HTML previews of the original project are no longer useful.
If you have copied source strings from one main file to other files, you can still perform the alignment. Copy the translated main files to the location in which the smaller files are and rename them so that the alignment process can find the strings.
For more details about the alignment, see the Manage the translation of the source texts guide.