In the output tab, select Language Variables from the left panel.
- RoboHelp User Guide
- Introduction
- Projects
- Collaborate with authors
- PDF Layout
- Editing and formatting
- Format your content
- Create and manage cross-references
- Create and manage links
- Single-source with snippets
- Work with images and multimedia
- Create and use variables for easy updates
- Work with Variable Sets
- Use Find and Replace
- Auto save your content
- Side-by-side editing in Split View
- Use the Spell Check feature
- Create and Edit Bookmarks
- Insert and update fields
- Switch between multiple views
- Autonumbering in CSS
- Import and linking
- TOCs, indexes, glossaries, and citations
- Conditional content
- Microcontent
- Review and Collaboration
- Translation
- Generating output
- Publish output
- Publish to a RoboHelp Server
- Publish to an FTP server, a Secure FTP server, or a File System
- Publish to SharePoint Online
- Publish to Zendesk Help Center
- Publish to Salesforce Knowledge Base
- Publish to ServiceNow Knowledge Base
- Publish to Zoho Knowledge Base
- Publish to Adobe Experience Manager
- Publish to Atlassian Confluence Knowledge Base
- Publish to a RoboHelp Server
- Appendix
RoboHelp provides the feature to use language variables. You can use language variables to define localized strings in the PDF output or to localize any static text in the output templates. You can use CSS styles to localize the strings coming from a CSS.
Use language variables in the PDF output
You can use language variables to define a localized version of the out-of-the-box labels like Note, Caution, and Warning or static text in the PDF output. The variable name is the same for all languages but can have different values for the various languages. You can update the value for these variables in one or more languages, and then the localized value is automatically picked in the PDF output.
For example, you can have the following ways to present the label Note in the PDF output:
- English: Note
- French: Remarque
- German: Hinweis
If the value for any variable isn’t defined in a particular language, then RoboHelp picks the string from the language of the UI (User Interface of the application) as a fallback mechanism.
If you've not defined the value in the language of the UI, it looks for English (en_us), or else it picks the English(en) value and displays the same in the PDF output.
Types of language variables
RoboHelp supports two types of variables: Application and User variables.
Application variables
RoboHelp provides a set of predefined or out-of-the-box application variables. You can use these predefined variables to add information about a document specific to RoboHelp projects. For example, the chapter-number variable, if included in a page, displays the chapter number to which the page belongs. The author-label variable displays the name of the document author.
You can override the value for an application variable.
User variables
You can also create new language variables. For example, you can create a user variable Publisher for the label of the publisher for the document.
You should have administrative privileges to create user variables and edit the application variables.
Add a new language variable
-
-
Select Edit to open the Language Variables window. The application and the user variables present in the selected language are listed in alphabetical order. The values are displayed according to the selected language. For example, if you select the French language, “Tip” is displayed as “Conseil.”
-
From the Language dropdown, select the desired language in which you want to edit a variable.
Uwaga:If you don't view the desired languages, enable the desired language from the Language Variable Settings. Select Settings to open the Language Variables Settings dialog.
-
Enter the variable name in the Name column and its value in the Value column.
Uwaga:You can use any HTML content as a variable value to display the variable value in specific formatting. For example, you can add <b> tag to the variable value to display the Publisher in bold.
-
Select Add Language Variable to add a new language variable to the selected language. Adding a variable to one language automatically adds it to all languages. You cannot create a variable with the same name as an existing variable. An error is displayed.
Uwaga:If you don’t select Add Language Variable, the variable isn't created and added to the list.
Options for a language variable
Hover over the variable to view the
You can preview both application and user variables. To view how the variable’s value is displayed in the output, select Preview from the menu of the selected variable.
You can also choose to Delete or Duplicate the user variables. Deleting a variable from one language automatically deletes it from all languages.
Edit or revert the application variables
You can also edit the values for an application variable. Later, you can revert an application variable to the original value. Revert Variable appears for an application variable with a changed value
Use language variables in the output templates
You should add language variables in your localized documents. You can insert these language variables within the page layout that appears across different pages in your localized documents. For example, you can add the language variable for the author-name that appears in the page layout’s header area (or any other part like the footer or body).
The following screenshot shows the author and the brand name localized in the PDF output generated for the French language.
To insert a language variable like your copyright label in the header area, perform the following steps:
-
Open the required page layout for editing.
Uwaga:View Customize a PDF template section for opening a page layout for customization or editing.
-
Select the header to make it active to insert a variable.
-
Select Insert Variable in the toolbar.
-
In the Insert Variable pop-up, select the name of the language variable to be inserted and select Insert to insert it in the header area.
Uwaga:You can also enter the search string in the text box. The variable names containing the given string are filtered and displayed in the list.
The selected language variable is inserted in the header area.
Apply content style to language variables
Besides the value you assign to a language variable, you can also use HTML tags to display the variable value in specific formatting. For example, you can display the value of the publisher-label in bold.
- You can also format the styles of the values using tag. For example, using the page-number language variable, you can display the page number in Roman number format in English and specify the format for other languages.
Value for English:
<span data-field="page-number" data-format="upper-roman">1</span>
Value for Tamil:
<span data-field="page-number" data-format="tamil">1</span>
Similarly, you can add language variables and format other fields listed in the Insert Fields feature of the page layouts. For more details on adding fields, view Add fields and metadata.
- You can also add localized images in the values. For example, you can add an image icon in the chapter-number language and get localized images of the icon in the PDF output.
For English, the variable value for an image can be like <img src="banner-en.jpg">, and for the same variable in German, it can be <img src="banner-de.jpg">. So, it picks up the images depending on the language.
Localize the strings using CSS styles
Using CSS styles, you can also localize the strings used in Autonumber like Chapter, Section, Figure, and Table. As these strings come from CSS files, you cannot localize them using language variables. To localize these strings, you can create CSS styles for each language in which you want to localize them.
For example, you can use the following CSS to display the Chapter prefix and the corresponding number format in various languages.
For example, you can use the following CSS to display Chapter as Hoofdstuk in German and the chapter number in decimal format. While for Japanese, you can use the Japanese number format to show the chapter numbers in the TOC.
// for English h1:before { counter-increment: h11; content: "Chapter " counter(h11, decimal)"."; } // for German :root:lang(de) h1:before { content: "Hoofdstuk " counter(h11, decimal)"."; } // for Japanese :root:lang(ja) h1:before { content: "章 " counter(h11, japanese-formal)"."; }
The following screenshots display the strings localized in German and Japanese PDF output.
Format the prefixes
Using CSS styles, you can also format the prefixes. For example, you can format the label Note to appear in red color in the PDF output of various languages.
.note .prefix-content { color: red; }