Skip to content

Resource Strings and Localization

Resource strings are constants used throughout the project and in the properties of custom actions. Their main purpose is to facilitate the localization (translation) of your package. For example, to create a package that supports both French and English, you can use resource strings instead of manually translating every field.

Using Resource Strings

Resource strings look like this: #BrowseFolders, with a # prefix. They act as identifiers that the package replaces with their corresponding values at runtime. You can use resource strings almost anywhere, except for specific fields like Package Title, Company Name, Email Address, and Destination Folder.

  • To insert a resource string into a field, click the button to open the Resource String Editor.
  • Resource strings are grouped into languages, making it easy to manage translations for multilingual packages.

Example:
For the Component Selection dialog, entering #DefSelCompPrompt in the Prompt field displays "Use the check boxes to ..." when the package runs. Changing the value of #DefSelCompPrompt in another language updates the displayed text accordingly.

About Languages

A language in Paquet Builder is a group of resource strings translated into a specific language (e.g., English, French). Multilingual packages display texts in the language selected by the user. If the user's language is not available, the default language is used.

Manage the languages in your package via the language manager.

Editing Resource Strings and Languages

Use the Resource String Editor to manage resource strings and their translations. Access it via the Resource Strings button in the ribbon or the Select Languages page.

Editing Strings

  • Identifier (ID): A unique constant prefixed with #. Example: #BrowseFolder, #UserError. Global strings (predefined) cannot be renamed or deleted.
  • Value: The text that replaces the identifier at runtime. Example: #UserError becomes "User Error" in English and "Erreur utilisateur" in French.

Managing Languages

  • Add Resource Strings: Adds a new identifier and value to all languages in the collection. The value must be translated manually for each language.
  • Remove Resource Strings: Deletes custom strings (not global ones) from the selected language.
  • Edit Language Properties: Change the language name, LCID (language identifier), author, email, and reading direction (left-to-right or right-to-left).

Language Files

Paquet Builder language files use the .pbr extension and are stored in UTF-8 format. They can be edited with any XML editor. When exporting or importing language files, ensure they conform to Paquet Builder's XML schema.

Creating Multilingual Packages

To create multilingual packages:

  1. Add desired languages to the package using the language manager.
  2. Use resource strings for all text fields.
  3. Translate resource strings for each language in the collection.

The package will display in the user's language if available. Otherwise, it defaults to the primary language.

Tools for Managing Languages

  • Export Language: Save a language as a .pbr file for use in other projects.
  • Import Language: Add an existing .pbr file to the package.
  • Start Empty Language: Create a new language file based on the U.S. English template.

Example Use Case

  1. Add resource string #WelcomeMessage with values "Welcome!" (English) and "Bienvenue!" (French).
  2. Use #WelcomeMessage in your package's Welcome Screen field.
  3. When the package runs, the displayed message matches the user's selected language.