Skip to content

Translation procedure

Henriette Steenhoff edited this page Sep 11, 2019 · 17 revisions

This page describes the procedure one has to go through in order to add a new field to the translation sheet and successfully update the translation sheet within ClimApp.

As the procedure is not finalized yet, this page will be updated continuously during the following days

Structure of the translation sheet

This section gives an introduction to the Excel sheet and how to understand and update its content.

Panes

planning

The translation sheet has a total of 6 panes, template, strings, toasts, wheels, planning and list_options. The different panes and their content is described below.

Pane Description Needed to update translations?
template An overview of the content of the translation sheet -
planning The master file including all information about the different text used in ClimApp and suggested ids ✔️
text All single-word (and some two-word) strings in ClimApp ✔️
toasts All toast text ClimApp ✔️
wheels All text related to wheels in ClimApp ✔️
list_options Option to choose from (used in planning) -

Planning sheet content

planning

Field Description Comments
text type The text type select by using drop-down
page The name of the HTML page where the information is used select by using drop-down
wheel name An indication of the wheel that the information is used for added to make it easier to identify the place in the code that needs to be updated
text the actual text to be added in the application
current_id the element id of the text (if exist) in the code
suggested_id the suggested field id to be referenced from the translations.json file
static/API/system an indication of the type of the and how it is updated within the code select by using drop-down
concatenated text? an indication of whether the text in the code is concatenated with other text (might make the implementation a little more complex)
logic dependent on text? is the text in the field used directly as part of any logic (if so, it is important to also change the dependent text in the code)

How to add new text

  • Open the translation sheet
  • Go to the pane planning and fill out:
    • text types - (use the drop down menu)
    • page - the page where the information currently exist (use the drop down menu)
    • wheel name (optional) only if the content you are creating is for a new wheel
    • text - the actual text you want to add
    • current_id - the ID (if it exist) used in the code base
    • suggested_id (auto-filled) the suggested ID based on the information you provided
    • static/API/system - and indication of what type of text you are filling out
      • static - text that is not changed
      • API - text field that will be updated by third-party (API)
      • system - a text value only used within the system
    • Concatenated_text? (0/1) - an indication of whether the text will be concatenated with other text (as this might increase the complexity of the implementation)
    • Logic dependent on text? (1/0) - an indication of whether the raw text is used directly in conjunction with any part of the code logic (if so, it is important that, if the text is changed, the dependent code is also changed)
  • Based on whether your new text is for a wheel, general text or a toast, add the text to the associated pane strings, toasts or wheels
  • Add the translations for all languages available in each pane (en, da, nl etc.)
  • If the translations has not already been approved, get the translations approved by xx

Updating the ClimApp JSON translation file

For developers

  • Convert the pane(s) with new information to a .csv-file by clicking File -> Download -> Comma separated values (.csv)
  • Save the file in the xx folder as:
    • text: climapp_translation_sheet_text.csv
    • wheels: climapp_translation_sheet_wheels.csv
    • toasts: climapp_translation_sheet_toasts.csv
    • this is important for the fiels to be able to be read by the python converter
  • Run the convertTranslationstoJSONfromCSV.py file (it will generate a translations.json file.)
  • Before moving the file to the ClimApp project
    • Move the current translations.json file from ClimAppPath/translations to ClimAppPath/translations/arhcive
    • Copy the generated translations.json to path in ClimAppPath/translations
  • Run the application to test that the new translation have been added as expected

Clone this wiki locally