Dashboard

2 minutes read
Edit on GitHub

Configuration for the client can be found in auth_config.json.

SOURCE Copy
Copied
        {
  "domain": "auth.plgd.cloud",
  "clientID": "pHdCKhnpgGEtU7KAPcLYCoCAkZ4cYVZg",
  "audience": "https://try.plgd.cloud",
  "scope": "",
  "httpGatewayAddress": "https://api.try.plgd.cloud"
}
    
SOURCE Copy
Copied
        npm install
npm start
    

Application will be hosted on http://localhost:3000 by default. To change the default port, put PORT=xxxx into package.json script for starting the development server

SOURCE Copy
Copied
        cross-env PORT=3000 craco start
    

or set PORT into your environment variables.

SOURCE Copy
Copied
        npm run build
    

In order to add a new language, open the file config.js and extend the supportedLanguages array with additional values. Use the language code 2 for the language you are about to add:

supportedLanguages: ['en', 'sk']

Once you added a new language, open the file language-switcher-i18n.js and add a new entry for the language you added. For example, for the language with code sk the entry would look like this:

SOURCE Copy
Copied
        sk: {
  id: 'language-switcher.slovak',
  defaultMessage: 'Slovak',
},
    

For extracting the messages from the UI components, run the following script:

SOURCE Copy
Copied
        npm run generate-pot
    

This script will generate a template.pot file, which contains all the strings from the application ready to be translated. Upload this file to your translation tool, translate the strings and after that, export the .po files for all the translations and place them into i18n folder.

For generating language files which are used by the application, run the following script:

SOURCE Copy
Copied
        npm run generate-language-files
    

Now your translations are updated and ready to be used.

The default language is set to be en. This configuration can be overridden in config.js by changing the defaultLanguage field. Change this only to a language that is supported by the application (is present in the supportedLanguages list).

After your first visit to the application from a browser, the application will remember the current language state. In order to change the defaultLanguage field and see the change, you should clear the localStorage entry language from the browser.

May 13, 2021

Get started

plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.

Get Started Illustration Get Started Illustration