<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammad Saeed on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Saeed on Medium]]></description>
        <link>https://medium.com/@Carbon187?source=rss-914ecb16b020------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*B0uZVwdesc9mlpDk.jpeg</url>
            <title>Stories by Mohammad Saeed on Medium</title>
            <link>https://medium.com/@Carbon187?source=rss-914ecb16b020------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:12:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Carbon187/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Internationalization Flutter app (Arabic RTL)]]></title>
            <link>https://proandroiddev.com/internationalization-flutter-app-arabic-rtl-fe99bfae696e?source=rss-914ecb16b020------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe99bfae696e</guid>
            <category><![CDATA[arabic-rtl]]></category>
            <category><![CDATA[internationalizing]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[right-to-left]]></category>
            <dc:creator><![CDATA[Mohammad Saeed]]></dc:creator>
            <pubDate>Sat, 02 Jun 2018 12:33:26 GMT</pubDate>
            <atom:updated>2018-08-08T16:25:24.134Z</atom:updated>
            <content:encoded><![CDATA[<p>Usually when developing apps for Middle East and North Africa, it requires to open in Arabic regardless of the device language. With option to change the language from the app to English or keep the Arabic version.</p><h3>What will we build?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*E4uuQsJQEvZI3K-LQgaCtQ.gif" /><figcaption>Change language from Arabic to English-Flutter</figcaption></figure><h3><strong>This article will cover</strong></h3><p>1- Load Flutter app in Arabic language RTL by default</p><p>2- Option to change to English LTR and return back to Arabic</p><h3>Before we start you should be familiar with</h3><p><a href="https://flutter.io/tutorials/internationalization/">Internationalizing Flutter Apps</a>: Flutter have a great documentation about it and Tensor has a great explanation of how can I learn more abou localize and internationalize applications at <a href="https://youtu.be/IhsHGJEOSYM">https://youtu.be/IhsHGJEOSYM</a></p><p><a href="https://pub.dartlang.org/packages/scoped_model">Scoped Model </a>: Which we can learn more about at <a href="https://youtu.be/RS36gBEp8OI">https://youtu.be/RS36gBEp8OI</a></p><h3>The main idea</h3><ul><li>Using MaterialApp’s locale property: <em>The initial locale for this app’s [Localizations] widget.If the `locale` is null the system’s locale value is used.</em></li><li>Convert the root widget of the application to Stateful widget. That will cause rebuild based on the locale and direction we specify.</li><li>Using Scope Model to save the used local, change it when requied and update all childs to use the new locale.</li></ul><h3>Implementation</h3><p><strong>Packages</strong></p><p>By default Flutter only provides US English localization. To add support for other languages, an application must specify additional MaterialApp properties, and include a separate package called flutter_localizations.</p><p>Also intl package to support message translation, and scoped_model that allow easily pass a data Model from a parent Widget down to it’s descendants</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df92a5e1ec4e933277675fe04fdcf267/href">https://medium.com/media/df92a5e1ec4e933277675fe04fdcf267/href</a></iframe><p><strong>Localization Delegates</strong></p><p><em>The elements of the </em>localizationsDelegates<em> list are factories that produce collections of localized values.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38932f067ac4e0907fb88d374b65873c/href">https://medium.com/media/38932f067ac4e0907fb88d374b65873c/href</a></iframe><p><strong>ScopeModelWrapper</strong></p><p>Wrap our app with scope model to save/change the current locale, and to separate the interface from the logic.</p><p>Calling “changeDirection” from any where in the app will change the locale.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a2cc4ca354ab1f436f44d926559ae30/href">https://medium.com/media/4a2cc4ca354ab1f436f44d926559ae30/href</a></iframe><p><strong>MyApp</strong></p><ul><li>This is the material app as Stateless widget, and it rebuild and update direction whenever the model change value (cause we used notifyListeners).</li></ul><blockquote><strong><em>locale</em></strong><em> property: is the locale used when the app first run. The initial locale for this app’s Localizations widget. If the locale is null the system’s locale value is used.</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a84947d81eb5fb7e601393c40faca63/href">https://medium.com/media/2a84947d81eb5fb7e601393c40faca63/href</a></iframe><p><strong>Login</strong></p><p>Finally, simple TextFormField widget to test the localization and direction. The language button change the local and direction by calling “model.changeDirection();”.</p><p>The Scope model then notifiy all it’s listeners.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4b6f07c9eea230a7035a37ded40e86e/href">https://medium.com/media/d4b6f07c9eea230a7035a37ded40e86e/href</a></iframe><p>Finally, you can grab the full source code</p><p><a href="https://github.com/moesaeed/Flutter-Arabic-RTL-Internationalization/tree/master">moesaeed/Flutter-Arabic-RTL-Internationalization</a></p><p>Base project that you can get and start directlly</p><p><a href="https://github.com/moesaeed/Base-Internationalizing/tree/master">moesaeed/Base-Internationalizing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe99bfae696e" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/internationalization-flutter-app-arabic-rtl-fe99bfae696e">Internationalization Flutter app (Arabic RTL)</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>