Skip to content

Smart Device Language

Miguel Tomas Silva edited this page Nov 15, 2023 · 6 revisions

Change Language
Last update: 15-11-2023

The Smart SWARM Data Acquisition Device has the ability to download and install other languages other than the default English language that is installed.


Smart Device Language Pack Installation

To install another language into the smart device is required first the device to be configured and connected to a WIFI network with internet connectivity. To download the language of your choice, on the serial terminal app type the following GBRL command:


                - $lang dw [country code]            - Download a language pack to the smart device (requires internet conn.)

Ensure the country code is a valid ISO 3166 country code code. For example, to install a language pack for Japanese the command to type is $lang dw jp. To install a language pack for Swedish type $lang dw se.


During installation, the smart device will make a request to GitHub to download 2 files. One is located in the translation folder located on the ESP32 C++ Base Firmware Libraries repository. And the second is located in the translation folder of this repository.


Smart Device Language Pack Selection

After the installation of a language pack, the language will be available to select and use. To change the smart device's language type the following $GBRL command on an Serial Terminal app. Again, make sure the country code is a valid ISO 3166 country code code. For example, to select the Japanese language pack the command to type is $lang set jp. To select the Swedish language pack type $lang set se.

                - $lang set [country code]           - Change the smart device language

Language Packs availability

The smart device will display an error when a specific language pack is not available. However, when that's the case, one can create one easily by downloading any other language pack file, one located in the translation folder located on the ESP32 C++ Base Firmware Libraries repository. And the second located in the translation folder of this repository.

After manually downloading the 2 language files available and of choice, one can open the files on a text editor such as Notepad and do a translation of the text contents shown. The files are JSON files, meaning any JSON editor is able to open, edit and parse its content too. Below is an example of how it looks like inside each language file:

{
	"mat_sensor_init": "maturity sensor init on IO",
	"num_temp_probes": "The number of Temperature probes is",
	"parasite_power": "Parasite power is",
	"unable_find_probe": "Unable to find address temperature probe address. Is it connected",
	"probe_addr": "Probe Address",
	"probe_resolution": "Probe Resolution",
	"max_dataset_size": "The max dataset size can be",
	"model_err_near": "Model Error near position num",
	"delta_time": "Delta Time",
	"probing_temp": "Probing temperature",
	"err_read_temp": "Could not read temperature data. Is the sensor probe connected properly",
	"err_del_dataset": "Error deleting dataset file",
	"reinit_dataset": "reinitializing the dataset file",
	"save_mat_settings": "Saving maturity settings",
	"err_create_mat_settings": "Error creating maturity settings file",
	"err_notfound_mat_settings": "maturity Settings file not found",
	"err_invalid_mat_settings": "Invalid maturity Settings file found",
	"pt": "view current probe temperature value",
	"probe_status": "View Temperature Probe status",
	"st": "view current strength value",
	"ma": "view current maturity value",
	"ufid": "view current data record",
	"me_new": "Initialize a new measurements dataset",
	"me_start": "Start measurements",
	"me_end": "End measurements",
	"me_status": "Current measurements status",
	"history": "View a list of measurements history",
	"ns": "View the number of measurements records",
	"view_mt_model": "View current maturity model",
	"set_ma_model": "Define a new maturity model",
	"view_st_model": "View current strength model",
	"set_st_model": "Define a new strength model",
	"mi": "View current measurement interval",
	"set_mi": "Config measurements interval in seconds",
	"no_data_entries": "No data entries found. First, start a new measurement dataset",
	"calc_ufid": "Calculating the Unique Fingerprint ID for the last dataset entry",
	"curr_temp": "Current Temperature",
	"maturity": "Maturity",
	"strength": "Strength",
	"measured": "measured is",
	"curr_st_model": "Current strength model",
	"curr_mt_model": "Current maturity model",
	"curr_measure_interval": "Current measurements interval is",
	"curr_mt_val": "Current maturity value is",
	"curr_st_val": "Current Strenght value is",
	"measure_not_started": "Measurements not started",
	"measure_already_started": "Measurement started already",
	"measure_num_records": "Number of measurements recorded is",
	"measure+new_started": "New Measurement Dataset started",
	"measure_already_started_on": "Measurements already Started on",
	"measure_started_on": "Measurements Started on",
	"measure_already_ended": "Measurements already ended",
	"measure_ended_on": "Measurements Ended on",
	"num_data_measure": "Number of data measurements",
	"config_summary": "Configuration Summary",
	"mt_model": "Maturity Model",
	"st_model": "Strenght Model",
	"mi_interval": "Measurement Interval",
	"model_vars": "Model variables letters that can be used",
	"probe_temp": "Probe Temperature",
	"onboard_temp": "onboard Temperature",
	"onboard_humidity": "onboard humidity",
	"curr_time": "current time",
	"prev_time": "previous time",
	"mt_val": "Maturity value",
	"model_validated": "model expression validated",
	"new_mi_accepted": "New Measurement interval accepted",
	"calc_mi_st_val": "Calculating Maturity and Strenght values",
	"data_history": "Data History",
	"model_formula": "type model formulae",
	"name": "content"
}

one just needs to do the translation on the right side. The text highlighted in dark blue. When all translation is completed. Save the newly translated files with the new country code as a filename plus a .lang extension. For example, to save a Japanese language pack the filename must be jp.lang. To save as a Swedish language pack the filename must be se.lang.


How to manually upload a language pack file

The final task required is to upload the new, non-existent, language file directly into the corresponding repository. The base language file needs to be uploaded to the translation folder located on the ESP32 C++ Base Firmware Libraries repository. And the other needs to be uploaded to the translation folder of this repository.


To manually upload the base language pack file, open the translation folder located on the ESP32 C++ Base Firmware Libraries repository and select on the top right menu the option "Add a file" >> "Upload files".

To manually upload the second language pack file, open the translation folder of this repository and select on the top right menu the option "Add a file" >> "Upload files".

When all 2 files are uploaded to the respective translation folder of each repository, the language pack you uploaded is immediately available to be installed on the smart device you have, following the procedure described earlier.



Clone this wiki locally