mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
138 lines
3.2 KiB
Dart
138 lines
3.2 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'intl/messages_all.dart';
|
|
|
|
// **************************************************************************
|
|
// Generator: Flutter Intl IDE plugin
|
|
// Made by Localizely
|
|
// **************************************************************************
|
|
|
|
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
|
|
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
|
|
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
|
|
|
|
class S {
|
|
S();
|
|
|
|
static S? _current;
|
|
|
|
static S get current {
|
|
assert(_current != null,
|
|
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
|
|
return _current!;
|
|
}
|
|
|
|
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
|
|
|
|
static Future<S> load(Locale locale) {
|
|
final name = (locale.countryCode?.isEmpty ?? false)
|
|
? locale.languageCode
|
|
: locale.toString();
|
|
final localeName = Intl.canonicalizedLocale(name);
|
|
return initializeMessages(localeName).then((_) {
|
|
Intl.defaultLocale = localeName;
|
|
final instance = S();
|
|
S._current = instance;
|
|
|
|
return instance;
|
|
});
|
|
}
|
|
|
|
static S of(BuildContext context) {
|
|
final instance = S.maybeOf(context);
|
|
assert(instance != null,
|
|
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
|
|
return instance!;
|
|
}
|
|
|
|
static S? maybeOf(BuildContext context) {
|
|
return Localizations.of<S>(context, S);
|
|
}
|
|
|
|
/// `Fastest`
|
|
String get fastestExposurePair {
|
|
return Intl.message(
|
|
'Fastest',
|
|
name: 'fastestExposurePair',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
|
|
/// `Slowest`
|
|
String get slowestExposurePair {
|
|
return Intl.message(
|
|
'Slowest',
|
|
name: 'slowestExposurePair',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
|
|
/// `Settings`
|
|
String get settings {
|
|
return Intl.message(
|
|
'Settings',
|
|
name: 'settings',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
|
|
/// `Caffeine`
|
|
String get caffeine {
|
|
return Intl.message(
|
|
'Caffeine',
|
|
name: 'caffeine',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
|
|
/// `Keeps screen on`
|
|
String get keepsScreenOn {
|
|
return Intl.message(
|
|
'Keeps screen on',
|
|
name: 'keepsScreenOn',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
|
|
/// `Haptics`
|
|
String get haptics {
|
|
return Intl.message(
|
|
'Haptics',
|
|
name: 'haptics',
|
|
desc: '',
|
|
args: [],
|
|
);
|
|
}
|
|
}
|
|
|
|
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
|
const AppLocalizationDelegate();
|
|
|
|
List<Locale> get supportedLocales {
|
|
return const <Locale>[
|
|
Locale.fromSubtags(languageCode: 'en'),
|
|
];
|
|
}
|
|
|
|
@override
|
|
bool isSupported(Locale locale) => _isSupported(locale);
|
|
@override
|
|
Future<S> load(Locale locale) => S.load(locale);
|
|
@override
|
|
bool shouldReload(AppLocalizationDelegate old) => false;
|
|
|
|
bool _isSupported(Locale locale) {
|
|
for (var supportedLocale in supportedLocales) {
|
|
if (supportedLocale.languageCode == locale.languageCode) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|