Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:architecture:localization
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
development:architecture:localization [2020/09/22 13:28] – demiankatz | development:architecture:localization [2023/08/17 20:11] – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Language Support ====== | ====== Language Support ====== | ||
- | |||
- | // This page refers to VuFind 2.x and later; use of earlier versions is no longer recommended. // | ||
Keywords: localization, | Keywords: localization, | ||
- | VuFind | + | VuFind® |
===== Translate Function ===== | ===== Translate Function ===== | ||
- | VuFind | + | VuFind® |
Notes: | Notes: | ||
Line 15: | Line 13: | ||
* If you attempt to translate a string that is not found in a language map, the original string will be displayed untranslated. | * If you attempt to translate a string that is not found in a language map, the original string will be displayed untranslated. | ||
* Many of the translated strings in the language files are simply chunks of English text. However, more recent additions are represented as shorter tokens (i.e. " | * Many of the translated strings in the language files are simply chunks of English text. However, more recent additions are represented as shorter tokens (i.e. " | ||
- | * Starting with VuFind | + | * Starting with VuFind® |
- | ==== Formatting Language Files ==== | + | ===== Formatting Language Files ===== |
When modifying an existing language file or creating a new one, you should observe these standards: | When modifying an existing language file or creating a new one, you should observe these standards: | ||
- | * Save the file in UTF-8 format without a Byte Order Marker (BOM). | + | * Save the file in UTF-8 format without a Byte Order Marker (BOM). |
- | * Make sure the file is sorted in a case-insensitive manner; | + | * Make sure the file is sorted in a case-insensitive manner; |
* Put double-quotes around multi-word phrases on the right side of the equals sign. Do NOT put quotes around phrases on the left side of the equals sign. | * Put double-quotes around multi-word phrases on the right side of the equals sign. Do NOT put quotes around phrases on the left side of the equals sign. | ||
Line 29: | Line 27: | ||
:!: Note: If modifications to a language file do not take effect, sometimes it is necessary to clear out the local directory language cache by removing the local/ | :!: Note: If modifications to a language file do not take effect, sometimes it is necessary to clear out the local directory language cache by removing the local/ | ||
- | === Sorting Language Files === | + | ==== Sorting Language Files ==== |
To sort a directory full of language files, simply go to the command line, and from your $VUFIND_HOME directory, run: | To sort a directory full of language files, simply go to the command line, and from your $VUFIND_HOME directory, run: | ||
Line 35: | Line 33: | ||
php public/ | php public/ | ||
| | ||
- | VuFind | + | VuFind® |
- | ==== Adding a New Language ==== | + | ===== Adding a New Language |
- | - Create a new language file as described [[# | + | - Create a new language file as described [[# |
- If you also wish to translate strings inside text domains (see below) you will need to create appropriate subdirectories inside languages, and put additional language files inside these directories. | - If you also wish to translate strings inside text domains (see below) you will need to create appropriate subdirectories inside languages, and put additional language files inside these directories. | ||
- If desired, translate help screens as described [[#help screen translation|above]]. | - If desired, translate help screens as described [[#help screen translation|above]]. | ||
- Edit [[configuration: | - Edit [[configuration: | ||
+ | ===== Updating a Language ===== | ||
- | ==== Customizing | + | If you wish to maintain an existing set of language files, but you are not sure which strings have been recently added, VuFind® includes a language tool which will generate lists of missing strings in all supported languages. To access it, turn on [[development: |
- | If you need to customize the language files residing in VUFIND_HOME/languages but do not want to commit this customization | + | Note also that there are [[administration: |
- | Starting with VuFind | + | ===== Customizing Language Files ===== |
- | === Defining an Explicit Parent Language File === | + | |
+ | If you need to customize the language files residing in VUFIND_HOME/ | ||
+ | |||
+ | Starting with VuFind® | ||
+ | ==== Defining an Explicit Parent Language File ==== | ||
In addition to the above mentioned implicit inheritance of language .ini files VuFind\Il8n\Translator offers a similiar feature as the configuration .ini file's [Parent_Config] section: by adding the line @parent_ini = " | In addition to the above mentioned implicit inheritance of language .ini files VuFind\Il8n\Translator offers a similiar feature as the configuration .ini file's [Parent_Config] section: by adding the line @parent_ini = " | ||
- | == Example 1 == | + | === Example 1 === |
* language is set to " | * language is set to " | ||
Line 64: | Line 67: | ||
The content of vufind2/ | The content of vufind2/ | ||
- | == Example 2 == | + | === Example 2 === |
Using customized language files for a multisite-setup. | Using customized language files for a multisite-setup. | ||
Line 102: | Line 105: | ||
- | ==== Text Domains ==== | + | ===== Text Domains |
- | Starting with VuFind | + | Starting with VuFind® |
For example, suppose you added: | For example, suppose you added: | ||
Line 122: | Line 125: | ||
on a valid $translator object would return "The translation" | on a valid $translator object would return "The translation" | ||
- | Text domains currently used by VuFind: | + | Text domains currently used by VuFind®: |
* CallNumberFirst - used for translation of main classification category | * CallNumberFirst - used for translation of main classification category | ||
Line 128: | Line 131: | ||
* HoldingStatus - used for displaying complex item availability messages (not supported by all ILS drivers) | * HoldingStatus - used for displaying complex item availability messages (not supported by all ILS drivers) | ||
* Exception - used for exception messages (currently not the exclusive location for these kinds of messages, but refactoring may eventually occur) | * Exception - used for exception messages (currently not the exclusive location for these kinds of messages, but refactoring may eventually occur) | ||
+ | |||
===== Help Screen Translation ===== | ===== Help Screen Translation ===== | ||
- | VuFind's help screens contain too much text for the standard translation mechanism to be a practical way of presenting them in multiple languages. | + | VuFind®'s help screens contain too much text for the standard translation mechanism to be a practical way of presenting them in multiple languages. |
+ | |||
+ | ===== Troubleshooting Language Strings ===== | ||
+ | |||
+ | Starting with VuFind® 9.1, if you activate the " | ||
+ | |||
+ | ===== Video ===== | ||
+ | This topic is discussed in the [[videos: | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/architecture/localization.txt · Last modified: 2024/01/10 13:56 by demiankatz