> For the complete documentation index, see [llms.txt](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/features/localization.md).

# Localization

The app is availabel in English and German. For the localization the `flutter_localizations` package is included in `pubspec.yaml`\
More information about this can be found in the official documentation <https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization>

## Change language

The language of the complete app can be changed via the prebuild widget

```dart
LanguageDropdown1()
```

## Add or change texts

To add more text the .arb files in folder `/lib/l10n` must be extended.

Afterwards these texts can be referenced in the code with this expression

```dart
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

...

AppLocalizations.of(context)!.[TEXT ID]
```

The \[TEXT ID] is the one referenced in the .arb files.

## Add more languages

To add more languages add the respective entries in `l10n.dart` and `localization_repository.dart` at the places in the code that are marked with this comment

```dart
//! add languages here
```

For every language a translation file with the name `app_[LOCALE].arb` must be added to the folder `/lib/l10n`
