{"id":139,"date":"2025-05-20T04:51:19","date_gmt":"2025-05-20T04:51:19","guid":{"rendered":"https:\/\/documentation.iqonic.design\/frezka\/?p=139"},"modified":"2025-06-10T07:00:20","modified_gmt":"2025-06-10T07:00:20","slug":"add-a-new-language","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/frezka\/add-a-new-language\/","title":{"rendered":"Add a new language"},"content":{"rendered":"<div class=\"nolwrap\">\n<pre class=\"wp-block-preformatted\">Estimated reading: 1 minutes<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How add a new language into Flutter app?<\/strong><\/h3>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1 &#8211; Open Your Project<\/strong><\/h2>\n\n\n\n<p>Open your project in your preferred development IDE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2 &#8211; Generate Language Dart File<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Navigate to the&nbsp;<strong>lib \u2192 locale<\/strong>&nbsp;folder.<\/li>\n\n\n\n<li>Create a new Dart file for your new language. For example, if you want to add German, create a file with name&nbsp;<strong><code>language_de.dart<\/code><\/strong>.<\/li>\n\n\n\n<li>Inside&nbsp;<strong><code>language_de.dart<\/code><\/strong>, define a class name&nbsp;<strong>LanguageDe<\/strong>&nbsp;and translate all strings into German.<\/li>\n<\/ol>\n\n\n\n<p><strong>TIP<\/strong><\/p>\n\n\n\n<p>You can follow the convention of naming them as language_languageCode.dart, where languageCode represents the ISO 639-1 language code for the language.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>English: language_en.dart Spanish: language_es.dart French: language_fr.dart<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3 &#8211; Update App Localizations<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the&nbsp;<code>app_localizations.dart<\/code>&nbsp;file.<\/li>\n\n\n\n<li>Inside a&nbsp;<code>switch<\/code>&nbsp;statement, add the following code to handle the new language:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">case 'de':<br>  return LanguageDe();<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1268\" height=\"583\" src=\"https:\/\/documentation.iqonic.design\/frezka\/wp-content\/uploads\/sites\/13\/2025\/05\/New_language1.png\" alt=\"\" class=\"wp-image-550\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4 &#8211; Add Flag Image<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the&nbsp;<strong>assets \u2192 flags<\/strong>&nbsp;folder.<\/li>\n\n\n\n<li>Add a flag image for newly added language. For example, for French, name the image file as&nbsp;<code>ic_de.png<\/code>.<\/li>\n\n\n\n<li>Add constant for image file in &#8220;lib \u2192 utils \u2192 images.dart&#8221;<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">const ic_de = 'assets\/flags\/ic_de.png';<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5 &#8211; Update Common Base<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the&nbsp;<code>lib \u2192 utils \u2192 common_base.dart<\/code>&nbsp;file.<\/li>\n\n\n\n<li>Locate the&nbsp;<code>languageList()<\/code>&nbsp;method.<\/li>\n\n\n\n<li>Add a new entry for the added language in the format:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">  LanguageDataModel(<br>     id: 5,<br>     name: 'German',<br>     languageCode: 'de',<br>     fullLanguageCode: 'de-DE',<br>     flag: ic_de,<br> ),<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1405\" height=\"659\" src=\"https:\/\/documentation.iqonic.design\/frezka\/wp-content\/uploads\/sites\/13\/2025\/05\/New_language2.png\" alt=\"\" class=\"wp-image-551\" \/><\/figure>\n\n\n\n<p><strong>INFO<\/strong><\/p>\n\n\n\n<p>Ensure to use the correct language code in both&nbsp;<code>languageCode<\/code>&nbsp;and&nbsp;<code>fullLanguageCode<\/code>. If you don&#8217;t know what&#8217;s language code for your preferred language please do visit this site for getting language code &#8211;&nbsp;<a href=\"https:\/\/www.science.co.il\/language\/Locale-codes.php#definitions\" target=\"_blank\" rel=\"noreferrer noopener\">Click Me!<\/a><br><a href=\"https:\/\/apps.iqonic.design\/documentation\/frezka-doc\/build\/docs\/getting-started\/app\/user-guide\/generate-ios-certificate\" target=\"_blank\" rel=\"noopener\"><\/a><\/p>\n\n\n\n<p><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Estimated reading: 1 minutes How add a new language into Flutter app? Step 1 &#8211; Open Your Project Open your project in your preferred development IDE. Step 2 &#8211; Generate Language Dart File TIP You can follow the convention of naming them as language_languageCode.dart, where languageCode represents the ISO 639-1 language code for the language. [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"featured_image_src":null,"author_info":{"display_name":"laraveladminiq","author_link":"https:\/\/documentation.iqonic.design\/frezka\/author\/laraveladminiq\/"},"children":[],"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":5,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":1053,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/posts\/139\/revisions\/1053"}],"up":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/posts\/119"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}