DEV Community

Cover image for How to create a Offline Internationalization App:Technology
nasa.wang
nasa.wang

Posted on • Updated on

How to create a Offline Internationalization App:Technology

The vast majority of internationalized apps are implemented by returning different languages through api requests. The so-called "content" does not refer to the UI interface of the APP, but the content information carried by the APP.

I have provided a different idea here. The core idea is to embed the part of the cloud API multilingual query that was originally in the cloud into the App by using Sqlite. There are three reasons:

  • First, for specific content and data with information boundaries, embedding the data from the cloud to the local will get a faster response speed.

  • Second, the users of the multilingual APP are people from various countries and regions. The network situation is complicated. The data can be embedded from the cloud to the local without being affected by the network and can be used offline.

  • Third, I don’t have a cloud server πŸ˜‚.

Technology

image-20211010184633-hb47llp

The APP is developed using Flutter, which can complete both iOS and Android versions of the APP at the same time. At the Flutter framework level, I chose the GetX framework. This framework is very easy to get started and is a highly integrated framework. Basically commonly used functions such as routing, state machines, dependencies, themes, internationalization, etc. have been built in. It can be said to be very friendly to novices.

For the operation of Sqlite data, I chose Floor in the Flutter library. I really like his definition of Entity, which is very friendly for data extraction and binding in subsequent development. Of course, the library currently does not support a full set of Sqlite features, for example, you cannot use "count(*)" to count data, but you can use the view features in Sqlite to circumvent it.

In terms of content management, Strapi is selected here, using the Sqlite database and enabling multi-language support. In this way we will get a Sqlitedb database. By customizing the configuration file of Strapi, it can be perfectly integrated with the Flutter project.

Recommend some very convenient tools, DBeaver is used to view the actual data structure of the Sqlite database generated by the management Strapi project. There is also a website "remove bg" I really like this website, it can perfectly help you remove the background in the picture material when developing the APP, so that your APP can be a lot more colorful!


Image description

Play Store

Apple Store

Top comments (0)