Skip to content

Flutter app example for loading localization over-the-air

Notifications You must be signed in to change notification settings

sondt2709/flutter_ota_localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter OTA Localization example

Libraries

Backend implementation

  • Endpoint get Json

Frontend implementation

MessageLookup

  • Create class AppMessageLookupProxy extends MessageLookup
  • Override lookupMessage function to get string from json which was fetched from Backend

AppLocalizations

  • Run command intl_translation:generate_from_arb to generate language file (.dart)

AppLocalizationsDelegate

  • shouldReload : compare request time, if having new request => return true to trigger reload
  • load : inject AppMessageLookupProxy to package:intl/src/intl_helpers.dart . messageLookup

Main

  • MaterialApp.locale <- initial locale, set it in future if need to change locale
  • MaterialApp.localizationsDelegates <- pass AppLocalizationsDelegate with dynamic l10n data, set it in future if need to reload translation strings

Ref

About

Flutter app example for loading localization over-the-air

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published