1. Home
  2. Docs
  3. Cirilla Documentations
  4. General app configurations
  5. Add your language

Add your language

Language support

Cirilla app supports Flutters official supported number of 78 languages.

The following locales are supported:

  • af – Afrikaans
  • am – Amharic
  • ar – Arabic
  • as – Assamese
  • az – Azerbaijani
  • be – Belarusian
  • bg – Bulgarian
  • bn – Bengali Bangla
  • bs – Bosnian
  • ca – Catalan Valencian
  • cs – Czech
  • da – Danish
  • de – German (plus one country variation)
  • el – Modern Greek
  • en – English (plus 8 country variations)
  • es – Spanish Castilian (plus 20 country variations)
  • et – Estonian
  • eu – Basque
  • fa – Persian
  • fi – Finnish
  • fil – Filipino Pilipino
  • fr – French (plus one country variation)
  • gl – Galician
  • gsw – Swiss German Alemannic Alsatian
  • gu – Gujarati
  • he – Hebrew
  • hi – Hindi
  • hr – Croatian
  • hu – Hungarian
  • hy – Armenian
  • id – Indonesian
  • is – Icelandic
  • it – Italian
  • ja – Japanese
  • ka – Georgian
  • kk – Kazakh
  • km – Khmer Central Khmer
  • kn – Kannada
  • ko – Korean
  • ky – Kirghiz Kyrgyz
  • lo – Lao
  • lt – Lithuanian
  • lv – Latvian
  • mk – Macedonian
  • ml – Malayalam
  • mn – Mongolian
  • mr – Marathi
  • ms – Malay
  • my – Burmese
  • nb – Norwegian Bokmål
  • ne – Nepali
  • nl – Dutch Flemish
  • no – Norwegian
  • or – Oriya
  • pa – Panjabi Punjabi
  • pl – Polish
  • ps – Pushto Pashto
  • pt – Portuguese (plus one country variation)
  • ro – Romanian Moldavian Moldovan
  • ru – Russian
  • si – Sinhala Sinhalese
  • sk – Slovak
  • sl – Slovenian
  • sq – Albanian
  • sr – Serbian (plus 2 scripts)
  • sv – Swedish
  • sw – Swahili
  • ta – Tamil
  • te – Telugu
  • th – Thai
  • tl – Tagalog
  • tr – Turkish
  • uk – Ukrainian
  • ur – Urdu
  • uz – Uzbek
  • vi – Vietnamese
  • zh – Chinese (plus 2 country variations and 2 scripts)
  • zu – Zulu

Set default language

To set a default language for your app open app.dart file located in:

cirilla/lib/constants/app.dart

And change the language code to your own language as shown in below screenshots and you are all good to go:

Add language to App

We by default have English and Arabic language files are included in the app, more to be added. To add your language to the app follow below steps to add your own language to the app.

In this step we will show you how to add your own language to our Cirilla flutter app.

Go to your Cirilla folder and navigate to:

/assets/lang

You will find en.json and ar.json now copy en.json file and rename it to your language locale code, for example for Italian it will be: it.json for French it will be: fr.json. Now translate your duplicated and renamed file to your own language.

Next step you need to navigate to app.dart file located in:

/lib/constants/app.dart

Open it and add your locale code as shown in below screenshot

NOTE!
If your website is multi-lingual and you want to make your app Multi-Lingual you will need to have WPML installed on your website so multi-lingual functionality can work.

Add unofficial language to the app

As Flutter officially supports 78 languages by default our app also supports all other languages that are not official if unofficial localization is available and can be added to the app as shown in below example:

In this example we will add Kurdish CKB which is not officially supported by Flutter, you can follow same steps to add support for your own language.

We will need to make changes in below files:

/cirilla/pubspec.yaml
/cirilla/lib/main.dart
/cirilla/lib/constants/app.dart

First open your pubspec.yaml and add your language and add support for locale:

flutter_ckb_localization:
    git:
      url: https://github.com/AppCheap/flutter_ckb_localization.git

Then we navigate to our main.dart file and add import localization and then add support for the localization

import 'package:flutter_ckb_localization/flutter_ckb_localization.dart';

Now we scroll down inside main.dart file until we find:

GlobalCupertinoLocalizations.delegate,

Then we add our localization configs directly under above configuration

CkbMaterialLocalizations.delegate,
CkbWidgetLocalizations.delegate,

Last but not least, we add our language/locale code/name to app.dart so our app can read and recognize it. It should be like this example:

const List<String> languageSupport = ['ku', 'ar', 'en'];
Now, close your project then open it again and run: flutter clean and then run your app.

NOTE!: App uses websites default language, so if your website default language is English then the app will automatically recognize it and use it. If your websites default language is for example Persian, then you need to add your locale code in app.dart for the app to work properly with your language.

If you are not sure what your language code is, you can mask your website and find it out by add below to your domain:

/wp-json/app-builder/v1/settings

It will show up like this:

Was this article helpful to you? Yes No

How can we help?