App-level Language Setting
import 'package:fw_flutter_sdk/fw_flutter_sdk.dart';
FireworkSDK.getInstance().changeAppLanguage("ar"); // such as: en, ar and en-US
Generally, the
changeAppLanguage
API should be called in the following cases:- 1.The App is launched(e.g. in the initState method of your App State.).
- 2.Users change the app language manually.
- 3.Other cases that change app language.
In order to be able to use the in-app language feature, the following configuration needs to be added to the app project.
import com.fireworksdk.bridge.flutter.FWFlutterSDK
class MainActivity: FlutterFragmentActivity() {
// please add the code
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(FWFlutterSDK.updateBaseContextLocale(newBase))
}
}
<application
...
android:supportsRtl="true"
>
...
Last modified 3mo ago