Commit 8c93477
authored
feat: add support for multilingual UI (#1479)
Updated code across the app to support a truly multilingual UI.
While `angular-translate` was already set up to facilitate adding more languages, the app's controllers and views still expected data to be provided in either English or French. This meant that setting the app to a new language would break the majority of the data display. The PR linked below moves the responsibility to the listener to provide translated strings and data, with a fallback language when the requested language isn't available. This allows the app to receive and display data in any language, and allows the user to set the UI to a language other than English or French.
The following example describes the most common change required for a multilingual UI. Suppose a piece of data has a description; the data would come from the listener with fields `Description_EN` and `Description_FR`. The app view would then display `Description_${language}`. However, with the app in Spanish (for example), the view would be trying to access `Description_ES`, which doesn't exist. To fix this problem, the code was changed to expect just a `Description`, already translated by the listener either in the correct language or a fallback language.
Extra changes:
- Deleted unused `src/views/personal/documents/pdf-view.html`. Then renamed `pdf-view.directive.css` to `pdf-viewer.directive.css` for clarity.
- Installed `@babel/plugin-proposal-throw-expressions` to allow the syntax `return data || throw error;` (used in `dynamicContentService.js` when a link is missing in the chosen language and in the fallback language).1 parent b5a24d6 commit 8c93477
81 files changed
Lines changed: 304 additions & 877 deletions
File tree
- content
- env
- src
- Languages
- angular-locales
- appTranslationTablesViews
- all-views
- login
- top-view
- css
- directives
- js
- controllers
- announcements
- appointments
- checkIn
- diagnoses
- documents
- educational
- home
- init
- notifications
- settings
- test-results
- txTeamMessages
- models
- personal
- appointments
- test-results
- settings
- services
- tests
- views
- general/announcements
- home
- checkin
- personal
- appointments
- diagnosis
- documents
- education
- notifications
- test-results
- treatment-team-messages
- settings
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
0 commit comments