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 [2016/03/29 18:04] – [Formatting Language Files] demiankatz | development:architecture:localization [2020/09/22 14:23] – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Language Support ====== | ====== Language Support ====== | ||
- | // This page refers to VuFind 2.x and later; | + | // This page refers to VuFind 2.x and later; |
Keywords: localization, | Keywords: localization, | ||
Line 15: | Line 15: | ||
* 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 2.4, a convenient [[https:// | + | * Starting with VuFind 2.4, a convenient [[https:// |
==== Formatting Language Files ==== | ==== Formatting Language Files ==== | ||
Line 25: | Line 25: | ||
* 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. | ||
- | For an example of a full language file, see [[https:// | + | For an example of a full language file, see [[https:// |
- | 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 === | ||
Line 38: | Line 38: | ||
==== 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 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: | ||
Line 45: | Line 46: | ||
==== Customizing Language Files ==== | ==== Customizing Language Files ==== | ||
- | If you need to customize the language files residing in VUFIND_HOME/ | + | If you need to customize the language files residing in VUFIND_HOME/ |
Starting with VuFind 2.5, you can also put a languages directory inside a [[development: | Starting with VuFind 2.5, you can also put a languages directory inside a [[development: | ||
Line 114: | Line 115: | ||
$translator-> | $translator-> | ||
+ | |||
+ | or | ||
+ | |||
+ | $translator-> | ||
on a valid $translator object would return "The translation" | on a valid $translator object would return "The translation" | ||
+ | Text domains currently used by VuFind: | ||
+ | |||
+ | * CallNumberFirst - used for translation of main classification category | ||
+ | * CreatorRoles - used for translating author relator terms (such as [[https:// | ||
+ | * 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) | ||
===== Help Screen Translation ===== | ===== Help Screen Translation ===== | ||
development/architecture/localization.txt · Last modified: 2024/01/10 13:56 by demiankatz