Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
👩‍💻💙📱

Anna Domashych foxanna

💭
👩‍💻💙📱
View GitHub Profile
View flutter_localization_example_imlementation_info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>fr</string>
<string>ru</string>
</array>
View flutter_localization_example_imlementation_myhomepage.dart
class MyHomePage extends StatefulWidget {
const MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
View flutter_localization_example_imlementation_myapp.dart
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) => MaterialApp(
localizationsDelegates: [
ExampleLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
View flutter_localization_example_imlementation_localizations.dart
const _supportedLocales = ['en', 'fr', 'ru'];
class ExampleLocalizations {
final Translations translations;
const ExampleLocalizations(this.translations);
static final _translations = <String, Translations Function()>{
'en': () => const Translations(),
'fr': () => const Translations_fr(),
View flutter_localization_example_implementation_translations_ru.i69n.yaml
homePageTitle: Пример локализации на Flutter
homePageCenterText(int times):
"Вы нажали кнопку $times ${_plural(times, one:'раз', few:'раза', many:'раз')}"
incrementTooltip: Добавить
View flutter_localization_example_implementation_translations_fr.i69n.yaml
homePageTitle: Exemple de localisation en Flutter
homePageCenterText(int times): "Vous avez appuyé le bouton $times fois"
incrementTooltip: Incrémenter
View flutter_localization_example_implementation_translations.i69n.yaml
homePageTitle: Flutter localization example
homePageCenterText(int times):
"You have pushed the button $times ${_plural(times, one:'time', many:'times')}"
incrementTooltip: Increment
View flutter_localization_example_implementation_pubspec.yaml
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
i69n: ^1.1.0
dev_dependencies:
flutter_test:
View flutter_localization_example_translations_example_6_ru.i69n.dart
class Translations_ru extends Translations {
const Translations_ru();
String get greetings => "Привет мир!";
}
View flutter_localization_example_translations_example_6_fr.i69n.dart
class Translations_fr extends Translations {
const Translations_fr();
String get greetings => "Bonjour le monde!";
}
You can’t perform that action at this time.