|
| 1 | +# Translation Docs |
| 2 | + |
| 3 | +This directory contains documentation on translation configs and dependencies. |
| 4 | + |
| 5 | +## Translation Switcher |
| 6 | + |
| 7 | +All language configs reside inside APP object and will be responsible for driving the translation switcher. |
| 8 | + |
| 9 | +```json |
| 10 | +"languageSwitcherConfigs": { |
| 11 | + "English": { |
| 12 | + "param": "en" |
| 13 | + }, |
| 14 | + "ជនជាតិខ្មែរ": { |
| 15 | + "param": "khmer" |
| 16 | + } |
| 17 | + }, |
| 18 | +``` |
| 19 | + |
| 20 | +You can have the translation switcher on the map or have it on the superset iframe views. To choose this set this flag accordingly. |
| 21 | + |
| 22 | +```json |
| 23 | +"mapLanguageTranslation": false, |
| 24 | +``` |
| 25 | + |
| 26 | +## Components Translations |
| 27 | + |
| 28 | +A look up object will be responsible for handling the various translations. The strings for the various components will reside in the languageTranslation object keyed by the language with the translations for the various strings as values. |
| 29 | + |
| 30 | +NB - The language key in languageTranslation object must match param value provided on languageSwitcherConfigs params. |
| 31 | + |
| 32 | +All components i.e legend, titlebar, layers, menu sections or subsections will require the entire string to be translated added to the lookup object, except for the popup which will require every individual string to be added on the lookup object. |
| 33 | + |
| 34 | +### Iframe translations |
| 35 | + |
| 36 | +The Iframe translation currently works by switching the iframe link and can be added to the languageTranslations lookup object as shown below |
| 37 | + |
| 38 | +```json |
| 39 | +"languageTranslations": { |
| 40 | + "khmer": { |
| 41 | + // Provide the full string for layers, titlebar, menu section and subsections. |
| 42 | + "Domain 2: Capacity of the child protection system": "ជនជាតិខ្មែរ ជនជាតិខ្មែរ ជនជាតិខ្មែរ", |
| 43 | + "Indicator 2.2 RCFs ": "ជនជាតិខ្មែរ ជនជាតិខ្មែរ", |
| 44 | + "RCI": "ជនជា", |
| 45 | + "Number of RCIs in the country (all residential care facilities)": "ជនជាតិខ្មែរ ជនជាតិខ្មែរ ជនជាតិខ្មែរ ជនជាតិខ្មែរ ជនជាតិខ្មែរ ជនជាតិខ្មែរ", |
| 46 | + " Source: Inspection Database, 2018": "ជនជាតិខ្មែរ ជនជាតិខ្មែរ តិខ្មែរ ជនជា តិខ្មែរ", |
| 47 | + // replace current iframe with the translated kind |
| 48 | + "splashPage": { |
| 49 | + "link": "https://discover.ona.io/superset/dashboard/517/?standalone=true" |
| 50 | + }, |
| 51 | + "Cambodia Child Protection Profile 2018": "ជនជាតិខ្មែរ", |
| 52 | + // titlebar strings |
| 53 | + "Powered by": "ជនជាតិខ្មែរ", |
| 54 | + "Data Map": "ជនជា", |
| 55 | + // popup strings (must be supplied individually) |
| 56 | + "Mondul": "ជនជា" |
| 57 | + } |
| 58 | + }, |
| 59 | +``` |
0 commit comments