213a13f62f
Changelog: French, Spanish and Korean translations
126 lines
4.0 KiB
Dart
126 lines
4.0 KiB
Dart
import 'package:fl_clash/enum/enum.dart';
|
|
import 'package:fl_clash/ui/color.dart';
|
|
import 'package:material_ui/material_ui.dart';
|
|
|
|
import 'app_localizations.dart';
|
|
|
|
extension PageLabelL10n on PageLabel {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
PageLabel.dashboard => appLocalizations.dashboard,
|
|
PageLabel.proxies => appLocalizations.proxies,
|
|
PageLabel.profiles => appLocalizations.profiles,
|
|
PageLabel.tools => appLocalizations.tools,
|
|
PageLabel.logs => appLocalizations.logs,
|
|
PageLabel.requests => appLocalizations.recentRequests,
|
|
PageLabel.resources => appLocalizations.resources,
|
|
PageLabel.connections => appLocalizations.liveConnections,
|
|
PageLabel.dns => appLocalizations.dnsQueries,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension DnsQueryInitiatorL10n on DnsQueryInitiator {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
DnsQueryInitiator.app => appLocalizations.app,
|
|
DnsQueryInitiator.rule => appLocalizations.rule,
|
|
DnsQueryInitiator.direct => appLocalizations.direct,
|
|
DnsQueryInitiator.proxy => appLocalizations.proxies,
|
|
DnsQueryInitiator.other => appLocalizations.other,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension ModeL10n on Mode {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
Mode.rule => appLocalizations.rule,
|
|
Mode.global => appLocalizations.global,
|
|
Mode.direct => appLocalizations.direct,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension ProxiesTypeL10n on ProxiesType {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
ProxiesType.tab => appLocalizations.tab,
|
|
ProxiesType.list => appLocalizations.list,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension ProxyCardTypeL10n on ProxyCardType {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
ProxyCardType.loose => appLocalizations.loose,
|
|
ProxyCardType.standard => appLocalizations.standard,
|
|
ProxyCardType.compact => appLocalizations.compact,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension HotActionL10n on HotAction {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
HotAction.start => appLocalizations.actionStart,
|
|
HotAction.view => appLocalizations.actionView,
|
|
HotAction.mode => appLocalizations.actionMode,
|
|
HotAction.proxy => appLocalizations.actionProxy,
|
|
HotAction.tun => appLocalizations.actionTun,
|
|
HotAction.ruleMode => appLocalizations.actionRuleMode,
|
|
HotAction.globalMode => appLocalizations.actionGlobalMode,
|
|
HotAction.directMode => appLocalizations.actionDirectMode,
|
|
HotAction.delayTest => appLocalizations.actionDelayTest,
|
|
HotAction.updateProfiles => appLocalizations.actionUpdateProfiles,
|
|
HotAction.copyEnv => appLocalizations.copyEnvVar,
|
|
HotAction.exit => appLocalizations.exit,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension RestoreStrategyL10n on RestoreStrategy {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
RestoreStrategy.compatible => appLocalizations.restoreStrategyCompatible,
|
|
RestoreStrategy.override => appLocalizations.restoreStrategyOverride,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension ColorStyleL10n on ColorStyle {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (this) {
|
|
ColorStyle.vivid => appLocalizations.vividStyle,
|
|
ColorStyle.tinted => appLocalizations.tintedStyle,
|
|
ColorStyle.soft => appLocalizations.softStyle,
|
|
ColorStyle.monochrome => appLocalizations.monochromeScheme,
|
|
};
|
|
}
|
|
}
|
|
|
|
extension LocaleL10n on Locale {
|
|
String get label {
|
|
final appLocalizations = currentAppLocalizations;
|
|
return switch (toString()) {
|
|
'en' => appLocalizations.en,
|
|
'es' => appLocalizations.es,
|
|
'fr' => appLocalizations.fr,
|
|
'ja' => appLocalizations.ja,
|
|
'ko' => appLocalizations.ko,
|
|
'ru' => appLocalizations.ru,
|
|
'zh_CN' => appLocalizations.zhCN,
|
|
final code => code,
|
|
};
|
|
}
|
|
}
|