Invantive Studio keeps every text of an application as a translation in the repository. A caption, a menu item, a message or the label of a column is not stored as text but as a resource code such as `itgen_description`, and the repository holds the translation of that code for each language of the application. A product built on the Invantive Producer platform replaces the codes by the translations in the language of the user, so one application serves its users in several languages without a change to the model.
## Languages
The languages themselves are listed under "Setup" and "Languages". Each language has an ISO 639-1 code such as `en` or `nl`, a description and the Oracle NLS settings which the repository uses for that language, such as the date format and the numeric characters.
Which of these languages an application offers is decided per application, under "Applications", the application and "Languages". The application language carries the option "Usable in UI". A product offers a language to its users only when this option is set; a licence can limit the choice further. The translations which Invantive supplies with its own products cover nineteen languages: Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hindi, Italian, Japanese, Korean, Norwegian Bokmål, Polish, Portuguese, Russian, Spanish and Swedish. English is the language in which the texts are written; the other languages are translations of it.
A language is taken off an application in that same list: the row of the language offers "Delete" in its context menu. This works from release 27.0; the lists of Invantive Studio showed their rows but deleted none before that. The delete asks the change right on the function of the list, here "Application Language List". A user who may only read the list sees no "Delete".
## Translations
The translations of an application are reached through its language: under "Applications", the application, "Languages", the language and then "Translations". The list shows the translations of that one language; a translation is opened from the list and can be added, changed and deleted there. A translation has the following fields:
- "Resource Code": the code under which the text is used, such as `itgen_description`. The same code has one translation per language, and the repository refuses a second translation of a code in the same language of the same application.
- "Translation": the text in that language. A text longer than 4,000 bytes continues in "Translation Part 2" to "Translation Part 4".
- "Resource": whether the translation is included in the resource files which the products read.
- "Glossary": whether the translation is a term for a glossary of translators.
- "Language Independent": whether the text is the same in every language, such as a product name.
- "Documentation": notes for the translator, such as where the text appears.
A translation may itself contain a resource code between `{res:` and `}`, which is replaced in turn, and a placeholder such as `{0}` for a value which the product fills in at run time. The placeholders of a translation must be the same as those of the English text.
When a language has no translation of a code, the product shows the English text. When the English text is missing as well, the product shows the resource code itself. The translations which Invantive supplies with its products are made by translators or by machine translation; where neither is available yet, the English text is shown.
## Adding Resources
"Add Resources..." registers a batch of new resource codes of an application, each with its text in one language. It is on the toolbar of the tab "Application" of an application and in the context menu of the list of applications. It is offered to a user who holds the change right on the translations. Available from release 27.0.
The window shows the language at the top. It starts on the language of the application, or on English when the application names none. Another language of the application can be chosen for this window only; the application itself does not change. Below the language, the list holds four columns:
- "Resource Code": the new code, such as `itgen_add_resources`.
- "Translation": the text of the code in the chosen language, at most 2,000 characters.
- "Error Code": empty until the registration of the row fails, and then the message code of the error, such as `itgenase519`.
- "Error Message": the message of that error, without its code.
A row is typed in the empty row at the top of the list, or pasted from a spreadsheet: a tab between the code and the text, and a line break between two rows. Tab in "Translation" of that row moves the row into the list and starts the next one at the top, so a series of rows is typed with the keyboard alone. Tab in "Translation" of the last row of the list does the same. The rows are drafts and are kept in the window only.
"Register" inserts the rows into the repository one by one. A row which is registered leaves the list. A row which fails stays in the list with the reason in "Error Message", for instance because the code already has a translation in that language. The row can then be corrected and registered again. A row without code and text is skipped. "Cancel" forgets every row which has not been registered. Neither button closes the window, so the next batch can follow at once. Closing the window forgets the rows which have not been registered as well.
## Glossaries
An application can carry one or more glossaries, under "Applications", the application and "Glossaries". A glossary has a code, a description, an optional language, a copyright text and documentation. Its terms are listed under "Glossary Terms": a term, its definition and whether the term is language independent. A glossary records the vocabulary of an application, so that a term is defined once and used in the same sense by everybody who works on the model.
A glossary term carries two tabs which answer the two questions a glossary is kept for. Both show their rows in the ordinary grid, so sorting, grouping, the column chooser and copying work as they do elsewhere, and both carry "Refresh" above the grid.
- "Translations" says what the term reads as in every language the application offers. The translation of a term is not stored: it is read from the keys of the application whose English text is the term itself, and the tab names those keys. A language without a translation is listed with an empty text, so that what is still to be done is visible. The right button opens or changes the translation of the selected language for each of the keys which carry the term.
- "Used In" says whether the term reads that way everywhere. It is grouped on the key, and lists every key of the application whose English text holds the term - a capital at the start of a sentence makes no difference - and under each of those keys its text in every language, the English included. A term which is translated one way in the glossary and another way in half of the sentences it stands in is visible here and nowhere else. The list holds the first 500 keys and the heading says how many hold the term. The right button opens or changes the one translation the selected line stands for.
## Copying and Distributing Translations
The translations travel with the application in two ways:
- "Copy Application" offers the options to include the translations, the application languages, the glossaries and the glossary terms in the copy.
- "Distribute", "SQL*Loader" and "Translations" write the translations of an application as SQL*Loader files, named after the prefix of the application with the suffix `_seed_i18n`. These files load the translations into another repository or into a runtime database.
Under "Tools", "Translate JasperReports" prepares the JasperReports files of an application for translation: it finds their literal texts, proposes the resource codes of the chosen application language that hold the same text, and registers new resource codes for the others. Replacing the texts in the reports by those codes, so that a report follows the language of the user like a screen does, is not yet done in release 27.0; see [[Invantive Studio/Ribbon/Translate JasperReports|Translate JasperReports]].
## Translations in the Running Products
A product built on the Invantive Producer platform downloads the translations of its language from the repository when it starts, at most once a day, and keeps them in a cache file in the folder of the product installation. It compares a checksum of the repository with the checksum of its cache, so a changed translation reaches the users within a day without an installation. Products built on Invantive UniversalSQL read the translation files which are delivered with the product; the environment variables `INVANTIVE_I18N_FOLDER` and `INVANTIVE_NO_TRANSLATE` in [[Environment Variables/Folders|Folders]] and in [[Invantive UniversalSQL/Configuration/Debugging/Translations|the translation settings of Invantive UniversalSQL]] change which files are read and whether the codes are translated at all. In SQL, the function [[Invantive UniversalSQL/Grammar/SQL Functions/TRANSLATE_RESOURCES|TRANSLATE_RESOURCES]] translates the resource codes in a text.
Access to the screens of this topic is granted through function rights such as "Language List", "Translation List" and "Glossary List".
## See Also
- [[Invantive Studio/Command Line Options|Command Line Options]]
- [[Invantive UniversalSQL/Grammar/SQL Functions/TRANSLATE_RESOURCES|TRANSLATE_RESOURCES]]