Translations |
Tanslation Maintenance Page |
|
|
Basic Translation and Language Maintenance |
The Translation Maintenance page (System Admin → Configuration → Translations) provides these operations:
![]() |
Operation | Procedure | ||||||||||||||||||||
Add a Language SDI | Click "Add Language" in the toolbar.
In the resulting dialog, enter the identifier and (if desired) description
of the Language SDI. Select this "Language" in the User
Maintenance Page to assign this language to a user. The language is
added to the list of "Languages" at the left of the page. You
can also add a Lanuage SDI from the System Admin → Configuration →
Languages tramstop:
Note the "Right To Left" option. For this specific Language, this option determines if the User Interface is presented left-to-right or right-to-left. To use this feature:
When the User logs onto LabVantage, the User Interface will be presented right-to-left.
|
||||||||||||||||||||
Choose a Language SDI for viewing or editing | Select the language from the list of "Languages" at the left of the page. | ||||||||||||||||||||
Add a text string to the Translation Master List and translate the string |
Note that any translated text that is not defined in the TransMaster table at runtime is stored in the TransMasterTemp table if the "Auto fill temporary translation table" is set to "Yes" in System Configuration → Miscellaneous Options → Translations. |
||||||||||||||||||||
Search for and retrieve text strings in the Translation Master List |
You can edit the Translation of any text string returned by the search. |
||||||||||||||||||||
Edit translations for text strings in the Translation Master List |
|
General Text Matching Methodology |
In general, TextId is matched first to maintain backward-compatibility with previous LabVantage versions. If no match found, the following lenient matching operations are sequentially attempted on TextId until a match is found:
1. | Leading and trailing spaces are ignored. |
2. | Trailing period, comma, question mark, semicolon, and colon are ignored. If a match is found, they are attached to the end of the translated text. |
3. | TextId is matched case-insensitively. If a match is found and TextId contains all upper case, the translated text is converted to all upper case. If the first character of TextId is upper case, the first character of the translated text is capitalized. |
For example, for this single translation entry in French:
add more examples → ajouter d'autres exemples
All of these texts are translated:
add more examples → ajouter d'autres exemples
Add more examples → Ajouter d'autres exemples
Add more examples. → Ajouter d'autres exemples.
Add more examples: → Ajouter d'autres exemples:
ADD MORE EXAMPLES? → AJOUTER D'AUTRES EXEMPLES?
Other Operations |
Export Search To Excel |
This exports the search results of Text Ids, Contexts, and other translation information in a fixed Excel format. Exported Excel can be edited in Excel, then imported using "Import from Excel".
Import From Excel |
This opens a dialog that lets you choose a client-side Excel file, which must have the same format as that created using the "Export Search To Excel" operation. For your convenience, the "Transmaster Spreadsheet" directory of the LabVantage Distribution provides Excel spreadsheets that contain many of the TextIds used in the OOB LabVantage configuration. The Transmaster spreadsheets for LabVantage 8 were not available at the time this was written, so check the LabVantage 8 Release Notes for details regarding the actual spreadsheets that are provided in the LabVantage Distribution.
You can use Transmaster spreadsheets to form the basis of your Translation table for a given Language. The spreadsheet contains the Text Id, Context, and CF columns. Enter your Language Id in the first row of the fourth column, then save the file. You can then enter your translations in the fourth column, then use "Import From Excel" to populate the TransMaster and TransLanguage tables and work with the translations in the GUI.
If a matching TextId and Context are found in the TranslationMaster table, the corresponding translated text is inserted or updated if the Excel file contains the translation. If the TextId and Context does not exist in the TranslationMaster table, they are inserted into the TranslationMaster table first. The Client Flag (CF) is updated from the imported Excel file, which must contain correct "CF" values if exported from the TransMasterTemp table.
Find Missing Transmaster Texts |
This is a development tool that consumes a great deal of resources. Never use it on a production system. To use this, logon as a user with the relevant language and clear the Web Page Designer cache (see Monitoring → System Monitor → Cache Sizes).
This operation loads a JSP page that retrieves all Web Page Designer pages containing translated texts that are not in the TransMaster table. The page refreshes to generate progress feedback, as the operation requires a considerable amount of time. This also collects Text Ids from Reference Values/Reference Display Values, column labels in the data model, single/plural SDCIds, Query names, Query argument titles, and Report argument titles.
Export Transmastertemp |
This exports the Transmastertemp table in a fixed Excel format.
Context Translation |
|
|
Overview |
When the same text for a given language must have multiple translations depending on usage or context, you can use "Context Translation" to differentiate among the common text. For example, the text string "Add" may be "Add" on a advancedtoolbar button, but "Add Single" on an sdclinkmaint button. The TranslationContext Reference Type contains these predefined contexts OOB (you can add more if required):
• | W |
• | button |
• | button.text |
• | column |
• | column.title |
A context of "W" indicates that all instances of the text will be translated everywhere throughout the application. For the Reference Values, a dot syntax of context translation follows an inheritance structure. Context is matched case-sensitively from the most specific context to the least specific context (which is W) until a match is found. If a TextId has only one context, the context is ignored.
For example, button.text is a subcontext of button W (the default context that defines everything). To translate "Add" on a Button text property where the translation context is button.text:
1. | sapphire.accessor.TranslationProcessor.translate( 'Add', 'button.text') is called. |
2. | If there is only one TextId 'Add', the TranslationProcessor returns the translated text. |
3. | If there are multiple contexts for 'Add', the TranslationProcessor looks for translated text with a context of "button.text", then "button", then "W" until a translation is found. |
Context translation is not supported by the JavaScript API (translate and translate.Partial called on sapphire object). those methods build the JavaScript only for TextIds in the TransMaster and TransMasterTemp tables with ClientSideFlag set to Y. The "Auto fill temporary translation table" in System Configuration → Miscellaneous Options → Translations sets the ClientSideFlag to Y if a missing translation is client-side.
Web Page Designer |
When translating properties in the Web Page Designer, a default context will replace "W" (or be appended to the existing Element property) if the existing <Root> level context is specified and is not "W". For example, if the existing context is column.title, the final context at page rendering time will be column.title.Sample on the Sample List page, and column.title.Address on the Address List page. Default context is determined in the following sequence:
1. | SDCId in the Element property. |
2. | SDCId defined by the pagedata object. |
3. | WebPageId if the SDCId cannot be determined (as in SiteMap pages). |
The default context in list, maint, and sdclinkmaint Elements is:
• | SDCId (except for Reference Type value.). |
• | RefTypeId for Reference Type values. |
You can choose the context at the <Root> node of each property tree. This affects all child (descendant) nodes. Dynamic Lookup is also supported. Single translation is also available using the icon shown below.
![]() |
The maint and sdclinkmaint Elements contain the property Columns → Translate Value → No (Allow Edit Translations). For the column modes specified in the maint and sdclinkmaint Elements, this adds an icon to to the field which (onClick) opens a Translation Maintenance page for single translation by the user on the page detail itself:
![]() |
header columns in gwtdataentrygrid Elements are translated server-side. If the header is ParamListId, VariantId, ParamId, or ParamType, the default SDCId context is ParamListId. For other headers, the default context is the primary SDCId.
Finding Untranslated Text |
|
|
"Untranslated text" refers to text that should be translated but is not. There are two type of untranslated text:
• | The text is not in the TransMaster table or is not translated to the language in the TransLanguage table. |
• | The text is not translated at all. This is usually caused by a configuration error (such as when a property is not marked for translation). |
To assist in finding untranslated text, the "Show Translations" option in System Configuration → Miscellaneous Options → Translations lets you see translation status throughout the application. Set "Show Translations" to "Yes", then restart the Application Server and logon as the User having the Language you want to test. Then examine all of the pages you want to debug.
All texts that are translated server-side or client-side are tagged with a dollar sign ($) at the beginning and end if a translation does not exist. When a translation is found, the text is replaced with the first letter followed by an underscore (_____). For translations with defined Context, the context is shown (such as button.text.Sample below). A text is not tagged at all if it is not translated by code.
![]() |
Java API for Translations |
|
|
Context translation is supported by these API methods in sapphire.accessor.TranslationProcessor:
• | setTextType( String context ) |
• | translate( String textid, String context ) |
• | saveTranslation( String languageid, String textid, String transtext, String texttype ) |
Context translation in Reports in also supported by sapphire.report.JasperReportScriptlet using translate( String text, String context ). Specifically, this default translation context is supported:
• | ReportId for static texts (static texts are translated at compile time without SDC context. |
• | SDCId or ReportId (if the SDCId cannot be determined) for data fields at Report fill time. |
Here are some guidelines for best coding practices:
• | Use sapphire.accessor.TranslationProcessor.translate( textid, bindMap
) whenever possible to allow translation of mixed dynamic data and static
text. For example:
'Please get sample [keyid1] from [storageunitid].'
will translate to ' This avoids wrong code such as translate( "Please get sample" + s1 + "from" + su1 ), or questionable code such as translate ( "Please get sample" ) + s1 + translate( "from" ) + su1 |
• | Do not use HTML tags in translatable texts. |
• | Do not use leading and trailing spaces. |
• |
Do not use line feed or carriage return characters in translatable texts.
For example:
var alreadyFiled = sapphire.translate("The trackitem has already been filed.\n\nDo you want to file it again?"); should be changed to var alreadyFiled = sapphire.translate("The trackitem has already been filed.") + "\n\n" + sapphire.translate("Do you want to file it again?"); |