mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
添加语言切换
This commit is contained in:
parent
e0deb84123
commit
e06c834d0e
21 changed files with 1416 additions and 281 deletions
72
lib/generated/intl/messages_all.dart
Normal file
72
lib/generated/intl/messages_all.dart
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that looks up messages for specific locales by
|
||||
// delegating to the appropriate library.
|
||||
|
||||
// Ignore issues from commonly used lints in this file.
|
||||
// ignore_for_file:implementation_imports, file_names, unnecessary_new
|
||||
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
|
||||
// ignore_for_file:argument_type_not_assignable, invalid_assignment
|
||||
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
|
||||
// ignore_for_file:comment_references
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
import 'package:intl/src/intl_helpers.dart';
|
||||
|
||||
import 'messages_en.dart' as messages_en;
|
||||
import 'messages_zh.dart' as messages_zh;
|
||||
|
||||
typedef Future<dynamic> LibraryLoader();
|
||||
Map<String, LibraryLoader> _deferredLibraries = {
|
||||
'en': () => new SynchronousFuture(null),
|
||||
'zh': () => new SynchronousFuture(null),
|
||||
};
|
||||
|
||||
MessageLookupByLibrary? _findExact(String localeName) {
|
||||
switch (localeName) {
|
||||
case 'en':
|
||||
return messages_en.messages;
|
||||
case 'zh':
|
||||
return messages_zh.messages;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// User programs should call this before using [localeName] for messages.
|
||||
Future<bool> initializeMessages(String localeName) {
|
||||
var availableLocale = Intl.verifiedLocale(
|
||||
localeName,
|
||||
(locale) => _deferredLibraries[locale] != null,
|
||||
onFailure: (_) => null,
|
||||
);
|
||||
if (availableLocale == null) {
|
||||
return new SynchronousFuture(false);
|
||||
}
|
||||
var lib = _deferredLibraries[availableLocale];
|
||||
lib == null ? new SynchronousFuture(false) : lib();
|
||||
initializeInternalMessageLookup(() => new CompositeMessageLookup());
|
||||
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
|
||||
return new SynchronousFuture(true);
|
||||
}
|
||||
|
||||
bool _messagesExistFor(String locale) {
|
||||
try {
|
||||
return _findExact(locale) != null;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
|
||||
var actualLocale = Intl.verifiedLocale(
|
||||
locale,
|
||||
_messagesExistFor,
|
||||
onFailure: (_) => null,
|
||||
);
|
||||
if (actualLocale == null) return null;
|
||||
return _findExact(actualLocale);
|
||||
}
|
||||
150
lib/generated/intl/messages_en.dart
Normal file
150
lib/generated/intl/messages_en.dart
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a en locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
// Ignore issues from commonly used lints in this file.
|
||||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
|
||||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
|
||||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
|
||||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
|
||||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
String get localeName => 'en';
|
||||
|
||||
static String m0(item) => "Are you sure you want to delete ${item}?";
|
||||
|
||||
static String m1(item) => "Deleted ${item}";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
"appSettings": MessageLookupByLibrary.simpleMessage("App Settings"),
|
||||
"appearance": MessageLookupByLibrary.simpleMessage("Appearance"),
|
||||
"autoTurnOnSleepTimer": MessageLookupByLibrary.simpleMessage(
|
||||
"Auto Turn On Sleep Timer",
|
||||
),
|
||||
"automaticallyDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Automatically turn on the sleep timer based on the time of day",
|
||||
),
|
||||
"backup": MessageLookupByLibrary.simpleMessage("Backup"),
|
||||
"backupAndRestore": MessageLookupByLibrary.simpleMessage(
|
||||
"Backup and Restore",
|
||||
),
|
||||
"bookAbout": MessageLookupByLibrary.simpleMessage("About the Book"),
|
||||
"bookAboutDefault": MessageLookupByLibrary.simpleMessage(
|
||||
"Sorry, no description found",
|
||||
),
|
||||
"bookMetadataAbridged": MessageLookupByLibrary.simpleMessage("Abridged"),
|
||||
"bookMetadataLength": MessageLookupByLibrary.simpleMessage("Length"),
|
||||
"bookMetadataPublished": MessageLookupByLibrary.simpleMessage("Published"),
|
||||
"bookMetadataUnabridged": MessageLookupByLibrary.simpleMessage(
|
||||
"Unabridged",
|
||||
),
|
||||
"cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
|
||||
"copyToClipboard": MessageLookupByLibrary.simpleMessage(
|
||||
"Copy to Clipboard",
|
||||
),
|
||||
"copyToClipboardDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Copy the app settings to the clipboard",
|
||||
),
|
||||
"copyToClipboardToast": MessageLookupByLibrary.simpleMessage(
|
||||
"Settings copied to clipboard",
|
||||
),
|
||||
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
|
||||
"deleteDialog": m0,
|
||||
"deleted": m1,
|
||||
"explore": MessageLookupByLibrary.simpleMessage("explore"),
|
||||
"exploreTooltip": MessageLookupByLibrary.simpleMessage(
|
||||
"Search and Explore",
|
||||
),
|
||||
"general": MessageLookupByLibrary.simpleMessage("General"),
|
||||
"home": MessageLookupByLibrary.simpleMessage("Home"),
|
||||
"homeContinueListening": MessageLookupByLibrary.simpleMessage(
|
||||
"Continue Listening",
|
||||
),
|
||||
"homeListenAgain": MessageLookupByLibrary.simpleMessage("Listen Again"),
|
||||
"homePageSettings": MessageLookupByLibrary.simpleMessage(
|
||||
"Home Page Settings",
|
||||
),
|
||||
"homePageSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Customize the home page",
|
||||
),
|
||||
"homeStartListening": MessageLookupByLibrary.simpleMessage(
|
||||
"Start Listening",
|
||||
),
|
||||
"language": MessageLookupByLibrary.simpleMessage("Language"),
|
||||
"languageDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Language switch",
|
||||
),
|
||||
"library": MessageLookupByLibrary.simpleMessage("Library"),
|
||||
"libraryTooltip": MessageLookupByLibrary.simpleMessage(
|
||||
"Browse your library",
|
||||
),
|
||||
"no": MessageLookupByLibrary.simpleMessage("No"),
|
||||
"notificationMediaPlayer": MessageLookupByLibrary.simpleMessage(
|
||||
"Notification Media Player",
|
||||
),
|
||||
"notificationMediaPlayerDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Customize the media player in notifications",
|
||||
),
|
||||
"ok": MessageLookupByLibrary.simpleMessage("OK"),
|
||||
"pause": MessageLookupByLibrary.simpleMessage("Pause"),
|
||||
"play": MessageLookupByLibrary.simpleMessage("Play"),
|
||||
"playerSettings": MessageLookupByLibrary.simpleMessage("Player Settings"),
|
||||
"playerSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Customize the player settings",
|
||||
),
|
||||
"readLess": MessageLookupByLibrary.simpleMessage("Read Less"),
|
||||
"readMore": MessageLookupByLibrary.simpleMessage("Read More"),
|
||||
"reset": MessageLookupByLibrary.simpleMessage("Reset"),
|
||||
"resetAppSettings": MessageLookupByLibrary.simpleMessage(
|
||||
"Reset App Settings",
|
||||
),
|
||||
"resetAppSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Reset the app settings to the default values",
|
||||
),
|
||||
"resetAppSettingsDialog": MessageLookupByLibrary.simpleMessage(
|
||||
"Are you sure you want to reset the app settings?",
|
||||
),
|
||||
"restore": MessageLookupByLibrary.simpleMessage("Restore"),
|
||||
"restoreBackup": MessageLookupByLibrary.simpleMessage("Restore Backup"),
|
||||
"restoreBackupHint": MessageLookupByLibrary.simpleMessage(
|
||||
"Paste the backup here",
|
||||
),
|
||||
"restoreBackupInvalid": MessageLookupByLibrary.simpleMessage(
|
||||
"Invalid backup",
|
||||
),
|
||||
"restoreBackupSuccess": MessageLookupByLibrary.simpleMessage(
|
||||
"Settings restored",
|
||||
),
|
||||
"restoreBackupValidator": MessageLookupByLibrary.simpleMessage(
|
||||
"Please paste the backup here",
|
||||
),
|
||||
"restoreDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Restore the app settings from the backup",
|
||||
),
|
||||
"resume": MessageLookupByLibrary.simpleMessage("Resume"),
|
||||
"shakeDetector": MessageLookupByLibrary.simpleMessage("Shake Detector"),
|
||||
"shakeDetectorDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Customize the shake detector settings",
|
||||
),
|
||||
"themeSettings": MessageLookupByLibrary.simpleMessage("Theme Settings"),
|
||||
"themeSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Customize the app theme",
|
||||
),
|
||||
"unknown": MessageLookupByLibrary.simpleMessage("Unknown"),
|
||||
"yes": MessageLookupByLibrary.simpleMessage("Yes"),
|
||||
"you": MessageLookupByLibrary.simpleMessage("You"),
|
||||
"youTooltip": MessageLookupByLibrary.simpleMessage(
|
||||
"Your Profile and Settings",
|
||||
),
|
||||
};
|
||||
}
|
||||
104
lib/generated/intl/messages_zh.dart
Normal file
104
lib/generated/intl/messages_zh.dart
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a zh locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
// Ignore issues from commonly used lints in this file.
|
||||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
|
||||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
|
||||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
|
||||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
|
||||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
String get localeName => 'zh';
|
||||
|
||||
static String m0(item) => "确定要删除 ${item} 吗?";
|
||||
|
||||
static String m1(item) => "已删除 ${item}";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
"appSettings": MessageLookupByLibrary.simpleMessage("应用设置"),
|
||||
"appearance": MessageLookupByLibrary.simpleMessage("外观"),
|
||||
"autoTurnOnSleepTimer": MessageLookupByLibrary.simpleMessage("自动开启睡眠定时器"),
|
||||
"automaticallyDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"根据一天中的时间自动打开睡眠定时器",
|
||||
),
|
||||
"backup": MessageLookupByLibrary.simpleMessage("备份"),
|
||||
"backupAndRestore": MessageLookupByLibrary.simpleMessage("备份与恢复"),
|
||||
"bookAbout": MessageLookupByLibrary.simpleMessage("关于本书"),
|
||||
"bookAboutDefault": MessageLookupByLibrary.simpleMessage("抱歉,找不到描述"),
|
||||
"cancel": MessageLookupByLibrary.simpleMessage("取消"),
|
||||
"copyToClipboard": MessageLookupByLibrary.simpleMessage("复制到剪贴板"),
|
||||
"copyToClipboardDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"将应用程序设置复制到剪贴板",
|
||||
),
|
||||
"copyToClipboardToast": MessageLookupByLibrary.simpleMessage("设置已复制到剪贴板"),
|
||||
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
|
||||
"deleteDialog": m0,
|
||||
"deleted": m1,
|
||||
"explore": MessageLookupByLibrary.simpleMessage("探索"),
|
||||
"exploreTooltip": MessageLookupByLibrary.simpleMessage("搜索和探索"),
|
||||
"general": MessageLookupByLibrary.simpleMessage("通用"),
|
||||
"home": MessageLookupByLibrary.simpleMessage("首页"),
|
||||
"homeContinueListening": MessageLookupByLibrary.simpleMessage("继续收听"),
|
||||
"homeListenAgain": MessageLookupByLibrary.simpleMessage("再听一遍"),
|
||||
"homePageSettings": MessageLookupByLibrary.simpleMessage("主页设置"),
|
||||
"homePageSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"自定义主页",
|
||||
),
|
||||
"homeStartListening": MessageLookupByLibrary.simpleMessage("开始收听"),
|
||||
"language": MessageLookupByLibrary.simpleMessage("语言"),
|
||||
"languageDescription": MessageLookupByLibrary.simpleMessage("语言切换"),
|
||||
"library": MessageLookupByLibrary.simpleMessage("媒体库"),
|
||||
"libraryTooltip": MessageLookupByLibrary.simpleMessage("浏览您的媒体库"),
|
||||
"no": MessageLookupByLibrary.simpleMessage("否"),
|
||||
"notificationMediaPlayer": MessageLookupByLibrary.simpleMessage("通知媒体播放器"),
|
||||
"notificationMediaPlayerDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"在通知中自定义媒体播放器",
|
||||
),
|
||||
"ok": MessageLookupByLibrary.simpleMessage("确定"),
|
||||
"pause": MessageLookupByLibrary.simpleMessage("暂停"),
|
||||
"play": MessageLookupByLibrary.simpleMessage("播放"),
|
||||
"playerSettings": MessageLookupByLibrary.simpleMessage("播放器设置"),
|
||||
"playerSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"自定义播放器设置",
|
||||
),
|
||||
"readLess": MessageLookupByLibrary.simpleMessage("折叠"),
|
||||
"readMore": MessageLookupByLibrary.simpleMessage("展开"),
|
||||
"reset": MessageLookupByLibrary.simpleMessage("重置"),
|
||||
"resetAppSettings": MessageLookupByLibrary.simpleMessage("重置应用程序设置"),
|
||||
"resetAppSettingsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"将应用程序设置重置为默认值",
|
||||
),
|
||||
"resetAppSettingsDialog": MessageLookupByLibrary.simpleMessage(
|
||||
"您确定要重置应用程序设置吗?",
|
||||
),
|
||||
"restore": MessageLookupByLibrary.simpleMessage("恢复"),
|
||||
"restoreBackup": MessageLookupByLibrary.simpleMessage("恢复备份"),
|
||||
"restoreBackupHint": MessageLookupByLibrary.simpleMessage("将备份粘贴到此处"),
|
||||
"restoreBackupInvalid": MessageLookupByLibrary.simpleMessage("无效备份"),
|
||||
"restoreBackupSuccess": MessageLookupByLibrary.simpleMessage("设置已恢复"),
|
||||
"restoreBackupValidator": MessageLookupByLibrary.simpleMessage("请将备份粘贴到此处"),
|
||||
"restoreDescription": MessageLookupByLibrary.simpleMessage("从备份中还原应用程序设置"),
|
||||
"resume": MessageLookupByLibrary.simpleMessage("继续"),
|
||||
"shakeDetector": MessageLookupByLibrary.simpleMessage("抖动检测器"),
|
||||
"shakeDetectorDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"自定义抖动检测器设置",
|
||||
),
|
||||
"themeSettings": MessageLookupByLibrary.simpleMessage("主题设置"),
|
||||
"themeSettingsDescription": MessageLookupByLibrary.simpleMessage("自定义应用主题"),
|
||||
"unknown": MessageLookupByLibrary.simpleMessage("未知"),
|
||||
"yes": MessageLookupByLibrary.simpleMessage("是"),
|
||||
"you": MessageLookupByLibrary.simpleMessage("我的"),
|
||||
"youTooltip": MessageLookupByLibrary.simpleMessage("您的个人资料和设置"),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue