Cirilla Documentations

  1. Home
  2. Docs
  3. Cirilla Documentations
  4. How to
  5. How to translate or update file language for Cirilla app?

How to translate or update file language for Cirilla app?

Cirilla app is a multipurpose Flutter app for WordPress and WooCommerce that allows you to create different types of apps with rich functions and top code quality. One of the features of Cirilla app is that you can customize the language of your app by creating and editing a JSON file for your desired language.

Manual translate

The default language file of Cirilla app is en.json, which is located in the folder assets/lang of your Cirilla app project. It contains all the text strings that are used in the app, such as labels, buttons, messages, etc. Each string has a key and a value, for example:

{
"home": "Home",
"cart": "Cart",
"profile": "Profile",
"settings": "Settings"
}

The key is the identifier of the string, and the value is the actual text that will be displayed in the app. To translate the app to another language, you need to create a new JSON file with the same keys but different values according to your desired language. For example, if you want to translate the app to Spanish, you can create a file named es.json and change the values like this:

{
"home": "Inicio",
"cart": "Carrito",
"profile": "Perfil",
"settings": "Ajustes"
}

You can use any text editor to create and edit the JSON file, but make sure to save it in UTF-8 encoding and follow the JSON syntax rules. You can also use online tools like JSON Editor Online to validate and format your file.

After you create the new JSON file, you need to copy it to the folder assets/lang of your Cirilla app project. Then, you need to edit the file lib/constants/app.dart and add your new language code to the list of supported languages. For example, if you added Spanish, you need to change this line:

const List<String> languageSupport = ['en', 'ar', 'vi'];

to this:

const List<String> languageSupport = ['en', 'ar', 'vi', 'es'];

Finally, you need to rebuild your app.

Cloud translate

You can also use the cloud translation service provided by Appcheap to automatically translate your app language. To do this, you need to follow these steps:

  1. Go to https://admin.appcheap.io/ and log in with your Envato account.
  2. Go to Tools => Languages.
  3. Click on the button Create/Update/Download Languages.
  4. Select your desired language from the dropdown menu and click on Create/Update Language.
  5. A page will show with two columns: left side is Origin language, right side is Overwrite. If you want to update the translation, you can put the text in the input on the right side. You can also click on the dropdown menu to see more than 100 languages available for translation. Finally, click on Download Language to download the JSON file for your selected language.
  6. Copy the downloaded JSON file to the folder assets/lang of your Cirilla app project.
  7. Edit the file lib/constants/app.dart
const List<String> languageSupport = ['en', 'ar', 'vi'];

to this:

const List<String> languageSupport = ['en', 'ar', 'vi', 'es'];

Finally, you need to rebuild your app.

Video create translate file on cloud

Was this article helpful to you? Yes No

How can we help?