ubuntu_localizations 0.5.1 copy "ubuntu_localizations: ^0.5.1" to clipboard
ubuntu_localizations: ^0.5.1 copied to clipboard

Provides extra localizations for Ubuntu applications.

Ubuntu localizations for Flutter #

pub license: MPL CI codecov

Provides extra localizations for Flutter-based Ubuntu applications.

The GlobalUbuntuLocalizations class provides as list of localization delegates for all languages supported by Ubuntu. Furthermore, it provides a few Material localization delegates that are not provided by flutter_localizations.

Usage #

import 'package:ubuntu_localizations/ubuntu_localizations.dart';
import 'l10n/app_localizations.dart';
copied to clipboard
MaterialApp(
  localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
    ...AppLocalizations.localizationsDelegates,
    ...GlobalUbuntuLocalizations.delegates,
  ],
  supportedLocales: AppLocalizations.supportedLocales,
)
copied to clipboard
Text(UbuntuLocalizations.of(context).languageName)
copied to clipboard

Generate Material localizations #

Download CLDR and run:

dart run date_time_patterns.dart [/path/to/cldr/common/main/<locale>.xml]
dart run date_time_symbols.dart [/path/to/cldr/common/main/<locale>.xml]
copied to clipboard

This prints the date and time patterns and symbols specified in the CLDR file. Copy one of the existing lib/src/material/material_localizations_<locale>.dart files as a starting point, and paste the patterns and symbols into the file. Finally, add the new delegate to lib/src/material/material_localizations.dart.

3
likes
60
points
2.86k
downloads

Publisher

verified publishercanonical.com

Weekly Downloads

2024.09.11 - 2025.03.26

Provides extra localizations for Ubuntu applications.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MPL-2.0 (license)

Dependencies

collection, diacritic, flutter, flutter_localizations, intl

More

Packages that depend on ubuntu_localizations