Skip to content

Add internationalization #2772

Closed
Closed
@marcnause

Description

@marcnause

Requirements

Currently all Strings containing user facing content of the UI are added to a constants file. The only supported language of the Flutter version of the app is English.

It is preferable that

  • the app changes languages depending on the current locale of the device if the corresponding language is supported.
  • more languages than English are supported.
  • there is an easy way for contributors to add/improve translations.

Implementation

I found two ways of implementing this requirements:

  1. Using the the flutter_localizations package as described in https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization, https://medium.com/flutter-community/flutter-internationalization-the-easy-way-using-provider-and-json-c47caa4212b2
  2. Using the weblate_sdk as described in https://berkersen.dev/localize-your-flutter-app-with-weblate, https://www.mindbowser.com/flutter-localization-guide-step-by-step/

Reasoning

Weblate is a good tool to allow contributors to add/improve translations which has been used by other FOSSASIA projects before. To my understanding, using the weblate_sdk would closely couple the project to Weblate, which may not be desirable in case we want to change translation tools later.

Using the flutter_localizations package would also allow to use Weblate by letting Weblate access the project via git/PRs (see: https://docs.weblate.org/en/latest/admin/continuous.html). Weblate supports ARB files which are used by flutter_localizations since version 4.1 (see: https://docs.weblate.org/en/latest/formats/arb.html#arb)

For the sake of flexibility I would prefer flutter_localizations.

Change my mind! 😉

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions