Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Render translation text from layer & site config #502

@kahummer

Description

@kahummer

Techincal plan

  • Add currentLanguage property field to default state and set it to null
  • Add reducer and actions to handle store update and dispatch
  • Set currentLanguage on selecting a language on the switcher.
{"label": "ជនជាតិខ្មែរ", "param": "khmer"}
  • Dispatch payload to store
  • Once currentLanguage param value is set, use it to override the label here.

Additional detail on how this will work

  1. Load the current labels as the default language as provided here
  2. Provide translations config on the site config. This will be an array of objects responsible for driving the language switcher. The object will have the following properties
    * label - text rendered on the switcher
    * param - language literal responsible for rendering specific language label on the layer config
  3. Provide a language label for the languages as shown below.
"label": "Nombre de prestataires de soins alternatifs formels basés dans la 
famille dans le pays (familles d'accueil et soignants formels)"
"label-khmer": "ចំនួនអ្នកផ្ត ល់សេវាថែ ទាំតាមគ្រួ សារផ្លូវកា រនៅក្នុងប្ រទេសចិញ្ចឹម អ្នកថែ ទាំនិង (អ្នក ថែទាំសាច់ញា តិផ្លូវការ)"

NB* The language label on the layer specification should match the param added on the site config

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions