Skip to content

Commit

Permalink
Moving translations section (#1687)
Browse files Browse the repository at this point in the history
* Moving translations section

* link fix

* Fix heading link

* Configuring to Managing

* Split overview section

* Update content/en/building/translations/localizing-translations.md

Co-authored-by: Andra Blaj <[email protected]>

* Update content/en/building/translations/managing-translations.md

Co-authored-by: Andra Blaj <[email protected]>

---------

Co-authored-by: Andra Blaj <[email protected]>
  • Loading branch information
esthermmoturi and andrablaj authored Nov 6, 2024
1 parent e667277 commit ce2dd28
Show file tree
Hide file tree
Showing 29 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion content/en/building/reference/forms/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ The meta information in the `{form_name}.properties.json` file defines the form'

| property | description | required |
|---|---|---|
| `title`| The form's title seen in the app. Uses a localization array using the 2-letter code, not the translation keys discussed in the [Localization section]({{< relref "building/reference/translations" >}}). | yes |
| `title`| The form's title seen in the app. Uses a localization array using the 2-letter code, not the translation keys discussed in the [Localization section]({{< relref "building/translations/localizing-translations" >}}). | yes |
| `icon` | Icon associated with the form. The value is the image's key in the `resources.json` file, as described in the [Icons section]({{< relref "building/reference/resources#icons" >}}) | yes |
| `subject_key` | Override the default report list title with a custom translation key. The translation uses a summary of the report as the evaluation context so you can include report fields in your value, for example: `Case registration {{case_id}}`. Useful properties available in the summary include: `from` (the phone number of the sender), `phone` (the phone number of the report contact), `form` (the form code), `subject.name` (the name of the subject), and `case_id` (the generated case id). Defaults to the name of the report subject. | no |
| `hidden_fields` | Array of Strings of form fields to hide in the view report UI in the app. This is only applied to future reports and will not change how existing reports are displayed. | no |
Expand Down
2 changes: 1 addition & 1 deletion content/en/building/targets/target-widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ targets.assessments.percentage.cough.title = % Population with cough
targets.households.with.assessments.title = Total households with assessments
targets.households.with.gt2.assessments.title = % Household with >=2 assessments
```
To upload *[translations]({{< ref "building/reference/translations#translations" >}})* to your local instance, run the following command:
To upload *[translations]({{< ref "building/translations/localizing-translations#translations" >}})* to your local instance, run the following command:

```zsh
cht --url=https://<username>:<password>@localhost --accept-self-signed-certs upload-custom-translations
Expand Down
7 changes: 7 additions & 0 deletions content/en/building/translations/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "CHT Translations"
linkTitle: "Translations"
weight: 4
description: >
Overview and configuration of CHT Translations
---
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
---
title: "Localization"
linkTitle: "Localization"
weight: 13
title: Configuring
linkTitle: Configuring
weight: 2
description: >
Localizing language in the CHT
relatedContent: >
core/overview/translations
building/reference/translations
building/translations/managing-translations
building/translations/localizing-translations
aliases:
- /building/tutorials/localizing-cht
- /apps/tutorials/localizing-cht
---

{{% pageinfo %}}
Given that CHT apps are used around the world, the Core Framework was designed with localization in mind. The Core Framework itself is available in English, French, Hindi, Nepali, Spanish, Swahili, and Indonesian.

This tutorial will take you through localizing the CHT to a custom language (Swahili). This will include setting up the user interface labels as well as outgoing text messages.
This section will take you through localizing the CHT to a custom language (Swahili). This will include setting up the user interface labels as well as outgoing text messages.

By the end of the tutorial you should be able to:
By the end of the section you should be able to:

- Change the CHT user interface labels to a custom language.
- Change outgoing text messages to a custom language(Swahili will be used in the guide).
{{% /pageinfo %}}

## Brief Overview of Key Concepts

*Localization* this is setting up the desired language in CHT for the end user.

*Translations* this is manually setting up extra translations of instance tabs texts or outgoing SMS text. See an outline of how to do that [here]({{< ref "../reference/translations/#translations" >}}).

## Required Resources

You should have a functioning [CHT instance with `cht-conf` installed locally]({{< ref "building/local-setup" >}}), completed a [project folder]({{< ref "building/local-setup#3-create-and-upload-a-blank-project" >}}) setup, and an [messages-sw.properties]({{< ref "../reference/translations" >}}) file.

## Implementation Steps
## Configuration Steps

Create a new file in the 'translations/' folder called `messages-sw.properties`.

Expand Down Expand Up @@ -66,7 +56,7 @@ In our case, the language code is `sw`.

<br clear="all">

Create a `message-sw.properties` file and use the instructions outlined [here]({{< ref "../reference/translations/#translations" >}}) to learn the structure of a message-{language-code}.properties file.
Create a `message-sw.properties` file and use the instructions outlined [here]({{< ref "building/translations/localizing-translations#translations" >}}) to learn the structure of a message-{language-code}.properties file.

Populate the `messages-sw.properties` file with the appropriate translation strigs and upload it using the below command:

Expand Down Expand Up @@ -344,4 +334,4 @@ Change the CHVs language by following: App Management > Users > [Choose CHV user

### Translating CHT to another language

To translate CHT to a new language (we have English, French, Hindi, Nepali, Spanish, Swahili, and Indonesian already in CHT), follow the steps outlined [here]({{< ref "core/overview/translations" >}}) for reference.
To translate CHT to a new language (we have English, French, Hindi, Nepali, Spanish, Swahili, and Indonesian already in CHT), follow the steps outlined [here]({{< ref "building/translations/managing-translations" >}}) for reference.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: "translations/"
linkTitle: "translations/"
weight: 2
title: Localizing
linkTitle: Localizing
weight: 3
description: >
**Localization**: Localized labels for CHT applications
Localization for CHT applications
keywords: localization languages translations
aliases:
- /building/reference/translations
- /apps/reference/translations
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "How To Manage Translations"
linkTitle: "Translations"
weight: 5
title: Managing
linkTitle: Managing
weight: 2
description: >
Process for managing translations in CHT Core
Adding translations in CHT Core
relatedContent: >
building/reference/translations
building/translations/localizing-translations
aliases:
- /core/overview/translations
---

Apps built with CHT Core are localized so that users can use them in the language of their choice. Languages supported by default are English, French, Nepali, Spanish, and Swahili. The goal of this doc is to help the community manage these and future translations.
Expand Down
16 changes: 16 additions & 0 deletions content/en/building/translations/translations-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Overview
weight: 1
description: >
Building language translations in the CHT
---
Given that CHT apps are used around the world, the Core Framework was designed with localization in mind. The Core Framework itself is available in English, French, Hindi, Nepali, Spanish, Swahili, and Indonesian.
## Brief Overview of Key Concepts

*Localization* this is setting up the desired language in CHT for the end user.

*Translations* this is manually setting up extra translations of instance tabs texts or outgoing SMS text. See an outline of how to do that [here]({{< ref "building/translations/localizing-translations#translations" >}}).

## Required Resources

You should have a functioning [CHT instance with `cht-conf` installed locally]({{< ref "building/local-setup" >}}), completed a [project folder]({{< ref "building/local-setup#3-create-and-upload-a-blank-project" >}}) setup, and an [messages-sw.properties]({{< ref "building/translations/localizing-translations" >}}) file.
2 changes: 1 addition & 1 deletion content/en/building/tutorials/sms-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ To set the validation rules and autoresponses, edit the array corresponding to t

You can also define your own [validation rules]({{< ref "building/reference/app-settings#validations" >}}).

{{% alert title="Note" %}} `translation_key` represents the message that is sent out. This will be defined in a [translations]({{< ref "building/reference/translations" >}}) file. {{% /alert %}}
{{% alert title="Note" %}} `translation_key` represents the message that is sent out. This will be defined in a [translations]({{< ref "building/translations/localizing-translations" >}}) file. {{% /alert %}}

### 3. Define a Person Registration Form

Expand Down
2 changes: 1 addition & 1 deletion content/en/contribute/code/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Want to talk about Documentation generally? Join our [Community Forum](https://f

### Translations

If you are a translator but not a developer, we understand that you may need extra help to follow the [process of translating]({{% ref "building/reference/translations" %}}) software for the first time. If that is the case, please open an issue on the GitHub repo or start a topic on the community forum.
If you are a translator but not a developer, we understand that you may need extra help to follow the [process of translating]({{% ref "building/translations/localizing-translations" %}}) software for the first time. If that is the case, please open an issue on the GitHub repo or start a topic on the community forum.

### Disclosing vulnerabilities

Expand Down
2 changes: 1 addition & 1 deletion content/en/why-the-cht.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Around the world, countries are adopting a model of primary health care that sta

<img src="localization.png" width="23%" align="right" />

Apps can be customized for different deployments and types of workflows. The Core Framework has been used in dozens of countries around the world with [localization settings]({{< ref "building/reference/translations" >}}).
Apps can be customized for different deployments and types of workflows. The Core Framework has been used in dozens of countries around the world with [localization settings]({{< ref "building/translations/localizing-translations" >}}).

Users can currently interact with the app in English, French, Hindi, Nepali, Spanish, Swahili, or Indonesian and new languages can be added in the admin console. The app also supports Bikram Sambat or Gregorian calendars and localized date formatting.

Expand Down

0 comments on commit ce2dd28

Please sign in to comment.