o1298098 / Flutter-Movie

😎 🎬 A Flutter movie app build with Fish-Redux and The Movie DB api.
Apache License 2.0
720 stars 220 forks source link

change language? #22

Open fab17an opened 4 years ago

fab17an commented 4 years ago

good, a query, I see that you have to put multi-languages, in that case how can you do to change it or assign another language so that it comes out by default, other than in English?

o1298098 commented 4 years ago

vscode-flutter-i18n-json I use this as a localization, you can view this document,

 static String language = ui.window.locale.languageCode;
 static String region = ui.window.locale.countryCode;

 static Future<VideoListModel> getFavoriteMovies(int accountid,
      {int page = 1, String sortBy = 'created_at.asc'}) async {
    VideoListModel model;
    String param =
        '/account/$accountid/favorite/movies? 
       api_key=$_apikey&language=$language&session_id=$session
       &sort_by=$sortBy&page=$page';
    var r = await _http.request(param);
    if (r != null) model = VideoListModel(r);
    return model;
  }

TBMD API requests data based on your system language