]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/CHEAT_SHEET.adoc
LP1837059 Angular local admin page
[Evergreen.git] / Open-ILS / src / eg2 / CHEAT_SHEET.adoc
1 = Evergreen Angular App Cheatsheet
2
3 == Basics
4
5 [source,sh]
6 ---------------------------------------------------------------------
7 npm update
8 npm install
9 ng lint             # check code formatting
10 npm run test        # unit tests
11 ng build --watch    # compile dev mode
12 ng build --prod     # compile production mode
13 ---------------------------------------------------------------------
14
15 == OPTIONAL: Adding a Locale 
16
17 * Using cs-CZ as an example.
18 * A cs-CZ configuration is supplied by default.  Additional configs
19   must be added where needed.
20 * Currently translation builds are only available on --prod build mode.
21 * Uncomment the locale lines in eg_vhost.conf and restart apache.
22 * TODO: expand docs on package.json file changes required to add locales.
23
24 === Exporting Source Strings
25
26 [source,sh]
27 ---------------------------------------------------------------------
28 npm run export-strings
29 ---------------------------------------------------------------------
30
31 * Then upload the messages.xmb file to the translation service
32
33 === Import and Build the Translation
34
35 1. Edit the "locales" array ./src/environments/environment.prod.ts to 
36    include cs-CZ.
37 2. Export translations as ".XTB" files from translation service.
38 3. Put the file in src/locale/messages.cs-CZ.xtb
39 4. Build the application for the selected locale by running:
40 [source,sh]
41 ---------------------------------------------------------------------
42 npm run build-cs-CZ
43 ---------------------------------------------------------------------
44