Resource Strings and Localization

Resource strings are specific string constants you can use in the project and custom actions’ properties. The main purpose of resource strings is the localization (language translation) of the package. Imagine you want to build a package both in French and English. Instead of translating all texts in the different fields, finding all options, actions, etc… you just need to modify a list of strings: this is the goal of the resource string editor.

Resources strings look like this #BrowseFolders with the sign # before a constant. These “string identifiers” take the place of string variables or literals. The package replaces each string identifier with its string value at runtime.

You can use resource strings almost anywhere (except for some fields such as Package Title, Company Name, E-Mail address, Destination Folder…). Just type the # character followed by the constant (or identifier) of your resource string. Please ensure this resource string is available in the Resource String list! You may also use your own resource strings: just add them using the Resource String Editor described below.

Press the buttons near the fields to open the Resource String Editor and select an existing resource string: it will be automatically inserted in the associated field.

A group of resource strings is called a language.

For example we entered #DefSelCompPrompt in the Prompt field of the Component Selection dialog. #DefSelCompPrompt was then replaced by: “Use the check boxes to ….” sentence as you can see on this screenshot:

It gives this result:
See the complete dialog:
When creating the package in another language, we just need to change the value of #DefSelCompPrompt. That’s all.

About Languages

A language in Paquet Builder is a group of resource strings translated into a given human language (English, French…). Paquet Builder can create multilanguage packages: that means the package is compiled with several languages and will display in the language selected by the end user.

For example if the user is French, the package can display its texts in French instead of English (default language), provided that you included the French language in the language collection of the package.

To manage languages that should be compiled into the package, please refer to the language manager’s help topic.

Editing languages and resource strings

Languages and their resource strings may be edited using the Resource String editor. You can open it by clicking “Resource Strings” in the ribbon or going to the Select Languages page and double-clicking a language in the list.

About the third column named “Type”

This column indicates whether the resource string is Global or Custom. Global resource strings are pre-defined and generally contain error messages, default button captions… you cannot remove or rename them. Custom resource strings are user-defined: they can be renamed and removed if necessary.

Edit Language

This combo box lets you select the language you wish to edit. It lists the different languages available in the package’s language collection that you can manage using the Language Manager. Before you select another language or close the editor, all modifications done to the current language are automatically saved.

Adding, editing resource strings

Just select the string in the list that you would like to edit or press the Add button to add a new resource string. The String Editor allows you to change the value of the resource string or specify a new name for it.

  • Identifier (ID): A unique constant preceded by the sign #. Remember that all resource strings are unique! If you try to add the same resource string twice, you will get an error message. Some examples: #BrowseFolder, #UserError, #MyCustomString… Please note that global resource strings cannot be renamed.

  • Value: the related value that will replace the identifier when the package is run. For example #UserError will be replaced by “User Error” (English) or “Erreur utilisateur” (French).

Click OK to save your changes or Cancel to exit.

Note: when you add new resource strings, they are also automatically added to the other languages in the collection. You will need to translate them too!

Removing resource strings

Select the resource string you want to delete and press Remove. Note that you cannot remove global resource strings (the Remove button is disabled when you select a global resource string).

Creating language files and configuring their properties

Languages have some properties that you can access using the Language Tools button in the Resource Strings editor.

When you create or export language files, Paquet Builder asks you to check or modify these properties.

  • Language Name: indicates the name of the language (English, French…). This name is used to identify the language in the language manager and it will be displayed to end users when they are prompted to select the language they want the package to be displayed in.

  • Language ID (LCID): this is the numeric “language identifer” (LCID) of the language and it plays a role in auto-detecting the most appropriate language to use by default. Visit http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx for the list of available language identifiers.

  • Author: name of the language’s author. For information purposes only.

  • E-Mail: where to contact the author of the language. For information purposes only.

Note: Paquet Builder language files have the .pbr extension and may be edited with any XML editor. They must be stored in UTF-8 format since Paquet Builder accepts Unicode. Be sure to include a BOM (Byte-Order-Mark).

Language Tools

This button lets you

Modify Language Properties

Modify the properties of the language file, as explained above.

Export to Language File

Exports the current language to an external language file (.pbr extension). You can then edit this language file in an XML editor or use it later for future packages.

Add Language From File

Imports an existing language file (.pbr) and adds it to the language list. Please note however that language files should only be added using the language manager (consider this button as a shortcut).

Start Empty Language

Lets you create a new language file using the default template in U.S. English. You can still create languages without using this command (just by clicking the Save Language button), but if you want to start a real new language especially for exporting, then this function is for you.

© G.D.G. Software 2018. All rights reserved.