User Tools

Site Tools


newdevs:i18n

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
newdevs:i18n [2023/09/22 13:43] smayonewdevs:i18n [2025/07/29 11:01] (current) – CLDR sleary
Line 54: Line 54:
 VALUES ('en-PINES', 'eng', 'PINES', 'PINES English');</code> VALUES ('en-PINES', 'eng', 'PINES', 'PINES English');</code>
  
-Add the generated seed data if it was not already installed: +Add the generated seed data if it was not already installed. Navigate to /Evergreen/build/i18n/locale/cs-CZ and run:
  
-<code>psql -U evergreen -a -f build/i18n/locale/cs-CZ/950.data.seed-values.sql</code>+<code>psql -U evergreen -a -f 950.data.seed-values.sql</code>
 ==== 3. Modify eg_vhost.conf ==== ==== 3. Modify eg_vhost.conf ====
  
 +  - Switch to root
   - File location: etc/apache2/eg_vhost.conf    - File location: etc/apache2/eg_vhost.conf 
-  - Look for the "Locale messages files" section around line 650+  - Look for the "Locale messages files" section around line 700
   - Uncomment or add lines for the new languages you are adding: <code>PerlAddVar OILSWebLocale "cs_cz"   - Uncomment or add lines for the new languages you are adding: <code>PerlAddVar OILSWebLocale "cs_cz"
 PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/cs-CZ.po"</code> PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/cs-CZ.po"</code>
Line 72: Line 73:
 The newer Angular administration interfaces provide a button to add translations (for example, the MARC Coded Value Map controls the Audience dropdown fields in the OPAC advanced search), but you will need to edit a file in order to enable it for each language. The newer Angular administration interfaces provide a button to add translations (for example, the MARC Coded Value Map controls the Audience dropdown fields in the OPAC advanced search), but you will need to edit a file in order to enable it for each language.
  
 +  - Switch to opensrf user
   - Edit Open-ILS/src/eg2/src/environments/environment.prod.ts   - Edit Open-ILS/src/eg2/src/environments/environment.prod.ts
   - Modify the locales array (eg, locales: ['en-US','cs-CZ','es-ES']   - Modify the locales array (eg, locales: ['en-US','cs-CZ','es-ES']
   - Recompile Angular: Go to the Open-ILS/src/eg2 folder and run: ng build   - Recompile Angular: Go to the Open-ILS/src/eg2 folder and run: ng build
          
-===== Marking Up Evergreen (Angular Pages) =====+===== Marking Up Evergreen (Angular HTML Template Pages) =====
  
 Most strings only require the addition of "i18n" to the innermost tag surrounding text:  Most strings only require the addition of "i18n" to the innermost tag surrounding text: 
Line 93: Line 95:
   * [[https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=a581623b2cfd56d072a1c3b00ad138811a448d50|LP#1951307: Contextual confirm dialog button text]]   * [[https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=a581623b2cfd56d072a1c3b00ad138811a448d50|LP#1951307: Contextual confirm dialog button text]]
  
 +===== Marking Up Evergreen (Angular TypeScript Pages) =====
 +
 +When creating a message in TypeScript, use the $localize tag handler with backticks around the text. 
 +
 +Example: 
 +<code>warning_msg = $localize`Watch out!`;</code>
 +
 +Example:
 +<code>warning_msg = $localize`There is a problem with ${this.barcode}`;</code>
  
 ===== Marking Up Evergreen (Template Toolkit Pages) ===== ===== Marking Up Evergreen (Template Toolkit Pages) =====
Line 114: Line 125:
   * When selecting a language on one screen, it affects other areas of Evergreen.  Ex: Changing the selector to Spanish in the OPAC will also cause the staff side to show Spanish.   * When selecting a language on one screen, it affects other areas of Evergreen.  Ex: Changing the selector to Spanish in the OPAC will also cause the staff side to show Spanish.
   * When changing languages, it's best to refresh your browser and clear your browser cache   * When changing languages, it's best to refresh your browser and clear your browser cache
 +
 +===== Finding common translations using CLDR data: Czech, Spanish, French =====
 +
 +The [[https://cldr.unicode.org/|Unicode CLDR project]] has a wealth of information on locale-based data. For example, the [[https://cldr.unicode.org/translation/date-time/date-time-names|Date/Time Names]] and [[https://cldr.unicode.org/translation/date-time/date-time-patterns|Date/Time Patterns]] can be helpful when working with dates. The summary tables serve as a concise reference for our most common languages.
 +
 +Find the Field Name you need in the documentation (e.g. weekdayOfMonth) and then reference the summary tables to find translations:
 +
 +  * [[https://unicode.org/cldr/charts/42/summary/cs.html|Czech (cz) locale data summary]]
 +  * [[https://www.unicode.org/cldr/cldr-aux/charts/28/summary/fr.html|French (fr) locale data summary]]
 +  * [[https://www.unicode.org/cldr/cldr-aux/charts/28/summary/es.html|Spanish (es) locale data summary]]
  
 ===== Additional Resources ===== ===== Additional Resources =====
Line 126: Line 147:
  
  
 +{{tag>i18n devdocs}}
  
  
newdevs/i18n.1695404635.txt.gz · Last modified: 2023/09/22 13:43 by smayo

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.