马良AI写作初始化仓库
This commit is contained in:
34
AINoval/lib/l10n/app_en.arb
Normal file
34
AINoval/lib/l10n/app_en.arb
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"appTitle": "AI Novel Assistant",
|
||||
"homeTitle": "My Novels",
|
||||
"createNovel": "Create New Novel",
|
||||
"importNovel": "Import Novel",
|
||||
"editNovel": "Edit",
|
||||
"deleteNovel": "Delete",
|
||||
"deleteConfirmation": "Are you sure you want to delete '{title}'? This action cannot be undone.",
|
||||
"cancel": "Cancel",
|
||||
"confirm": "Confirm",
|
||||
"novelTitle": "Novel Title",
|
||||
"novelTitleHint": "Enter novel title",
|
||||
"seriesName": "Series Name (Optional)",
|
||||
"seriesNameHint": "If part of a series, enter series name",
|
||||
"create": "Create",
|
||||
"lastEdited": "Last edited: {date}",
|
||||
"wordCount": "{count} words",
|
||||
"completionPercentage": "Completion: {percentage}%",
|
||||
"noNovels": "No novels yet. Click the button in the bottom right to create one.",
|
||||
"retry": "Retry",
|
||||
"loadingError": "Loading failed: {message}",
|
||||
"unknownState": "Unknown state",
|
||||
"save": "Save",
|
||||
"saved": "Saved",
|
||||
"editorSettings": "Editor Settings",
|
||||
"startWriting": "Start writing...",
|
||||
"wordCountTitle": "Word Count",
|
||||
"charactersWithSpaces": "Characters (with spaces)",
|
||||
"charactersNoSpaces": "Characters (no spaces)",
|
||||
"paragraphs": "Paragraphs",
|
||||
"readTime": "Estimated reading time",
|
||||
"minutes": "minutes",
|
||||
"close": "Close"
|
||||
}
|
||||
321
AINoval/lib/l10n/app_localizations.dart
Normal file
321
AINoval/lib/l10n/app_localizations.dart
Normal file
@@ -0,0 +1,321 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
|
||||
import 'app_localizations_en.dart';
|
||||
import 'app_localizations_zh.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// Callers can lookup localized strings with an instance of AppLocalizations
|
||||
/// returned by `AppLocalizations.of(context)`.
|
||||
///
|
||||
/// Applications need to include `AppLocalizations.delegate()` in their app's
|
||||
/// `localizationDelegates` list, and the locales they support in the app's
|
||||
/// `supportedLocales` list. For example:
|
||||
///
|
||||
/// ```dart
|
||||
/// import 'l10n/app_localizations.dart';
|
||||
///
|
||||
/// return MaterialApp(
|
||||
/// localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
/// supportedLocales: AppLocalizations.supportedLocales,
|
||||
/// home: MyApplicationHome(),
|
||||
/// );
|
||||
/// ```
|
||||
///
|
||||
/// ## Update pubspec.yaml
|
||||
///
|
||||
/// Please make sure to update your pubspec.yaml to include the following
|
||||
/// packages:
|
||||
///
|
||||
/// ```yaml
|
||||
/// dependencies:
|
||||
/// # Internationalization support.
|
||||
/// flutter_localizations:
|
||||
/// sdk: flutter
|
||||
/// intl: any # Use the pinned version from flutter_localizations
|
||||
///
|
||||
/// # Rest of dependencies
|
||||
/// ```
|
||||
///
|
||||
/// ## iOS Applications
|
||||
///
|
||||
/// iOS applications define key application metadata, including supported
|
||||
/// locales, in an Info.plist file that is built into the application bundle.
|
||||
/// To configure the locales supported by your app, you’ll need to edit this
|
||||
/// file.
|
||||
///
|
||||
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
|
||||
/// Then, in the Project Navigator, open the Info.plist file under the Runner
|
||||
/// project’s Runner folder.
|
||||
///
|
||||
/// Next, select the Information Property List item, select Add Item from the
|
||||
/// Editor menu, then select Localizations from the pop-up menu.
|
||||
///
|
||||
/// Select and expand the newly-created Localizations item then, for each
|
||||
/// locale your application supports, add a new item and select the locale
|
||||
/// you wish to add from the pop-up menu in the Value field. This list should
|
||||
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
|
||||
/// property.
|
||||
abstract class AppLocalizations {
|
||||
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
||||
|
||||
final String localeName;
|
||||
|
||||
static AppLocalizations? of(BuildContext context) {
|
||||
return Localizations.of<AppLocalizations>(context, AppLocalizations);
|
||||
}
|
||||
|
||||
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
|
||||
|
||||
/// A list of this localizations delegate along with the default localizations
|
||||
/// delegates.
|
||||
///
|
||||
/// Returns a list of localizations delegates containing this delegate along with
|
||||
/// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
|
||||
/// and GlobalWidgetsLocalizations.delegate.
|
||||
///
|
||||
/// Additional delegates can be added by appending to this list in
|
||||
/// MaterialApp. This list does not have to be used at all if a custom list
|
||||
/// of delegates is preferred or required.
|
||||
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
|
||||
delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
];
|
||||
|
||||
/// A list of this localizations delegate's supported locales.
|
||||
static const List<Locale> supportedLocales = <Locale>[
|
||||
Locale('en'),
|
||||
Locale('zh')
|
||||
];
|
||||
|
||||
/// No description provided for @appTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'AI Novel Assistant'**
|
||||
String get appTitle;
|
||||
|
||||
/// No description provided for @homeTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'My Novels'**
|
||||
String get homeTitle;
|
||||
|
||||
/// No description provided for @createNovel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create New Novel'**
|
||||
String get createNovel;
|
||||
|
||||
/// No description provided for @importNovel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Import Novel'**
|
||||
String get importNovel;
|
||||
|
||||
/// No description provided for @editNovel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit'**
|
||||
String get editNovel;
|
||||
|
||||
/// No description provided for @deleteNovel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Delete'**
|
||||
String get deleteNovel;
|
||||
|
||||
/// No description provided for @deleteConfirmation.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Are you sure you want to delete \'{title}\'? This action cannot be undone.'**
|
||||
String deleteConfirmation(Object title);
|
||||
|
||||
/// No description provided for @cancel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Cancel'**
|
||||
String get cancel;
|
||||
|
||||
/// No description provided for @confirm.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Confirm'**
|
||||
String get confirm;
|
||||
|
||||
/// No description provided for @novelTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Novel Title'**
|
||||
String get novelTitle;
|
||||
|
||||
/// No description provided for @novelTitleHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter novel title'**
|
||||
String get novelTitleHint;
|
||||
|
||||
/// No description provided for @seriesName.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Series Name (Optional)'**
|
||||
String get seriesName;
|
||||
|
||||
/// No description provided for @seriesNameHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'If part of a series, enter series name'**
|
||||
String get seriesNameHint;
|
||||
|
||||
/// No description provided for @create.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create'**
|
||||
String get create;
|
||||
|
||||
/// No description provided for @lastEdited.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Last edited: {date}'**
|
||||
String lastEdited(Object date);
|
||||
|
||||
/// No description provided for @wordCount.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{count} words'**
|
||||
String wordCount(Object count);
|
||||
|
||||
/// No description provided for @completionPercentage.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Completion: {percentage}%'**
|
||||
String completionPercentage(Object percentage);
|
||||
|
||||
/// No description provided for @noNovels.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No novels yet. Click the button in the bottom right to create one.'**
|
||||
String get noNovels;
|
||||
|
||||
/// No description provided for @retry.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Retry'**
|
||||
String get retry;
|
||||
|
||||
/// No description provided for @loadingError.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Loading failed: {message}'**
|
||||
String loadingError(Object message);
|
||||
|
||||
/// No description provided for @unknownState.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Unknown state'**
|
||||
String get unknownState;
|
||||
|
||||
/// No description provided for @save.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save'**
|
||||
String get save;
|
||||
|
||||
/// No description provided for @saved.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Saved'**
|
||||
String get saved;
|
||||
|
||||
/// No description provided for @editorSettings.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Editor Settings'**
|
||||
String get editorSettings;
|
||||
|
||||
/// No description provided for @startWriting.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Start writing...'**
|
||||
String get startWriting;
|
||||
|
||||
/// No description provided for @wordCountTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Word Count'**
|
||||
String get wordCountTitle;
|
||||
|
||||
/// No description provided for @charactersWithSpaces.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Characters (with spaces)'**
|
||||
String get charactersWithSpaces;
|
||||
|
||||
/// No description provided for @charactersNoSpaces.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Characters (no spaces)'**
|
||||
String get charactersNoSpaces;
|
||||
|
||||
/// No description provided for @paragraphs.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Paragraphs'**
|
||||
String get paragraphs;
|
||||
|
||||
/// No description provided for @readTime.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Estimated reading time'**
|
||||
String get readTime;
|
||||
|
||||
/// No description provided for @minutes.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'minutes'**
|
||||
String get minutes;
|
||||
|
||||
/// No description provided for @close.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Close'**
|
||||
String get close;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||
const _AppLocalizationsDelegate();
|
||||
|
||||
@override
|
||||
Future<AppLocalizations> load(Locale locale) {
|
||||
return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
|
||||
}
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) => <String>['en', 'zh'].contains(locale.languageCode);
|
||||
|
||||
@override
|
||||
bool shouldReload(_AppLocalizationsDelegate old) => false;
|
||||
}
|
||||
|
||||
AppLocalizations lookupAppLocalizations(Locale locale) {
|
||||
|
||||
|
||||
// Lookup logic when only language code is specified.
|
||||
switch (locale.languageCode) {
|
||||
case 'en': return AppLocalizationsEn();
|
||||
case 'zh': return AppLocalizationsZh();
|
||||
}
|
||||
|
||||
throw FlutterError(
|
||||
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
|
||||
'an issue with the localizations generation tool. Please file an issue '
|
||||
'on GitHub with a reproducible sample app and the gen-l10n configuration '
|
||||
'that was used.'
|
||||
);
|
||||
}
|
||||
116
AINoval/lib/l10n/app_localizations_en.dart
Normal file
116
AINoval/lib/l10n/app_localizations_en.dart
Normal file
@@ -0,0 +1,116 @@
|
||||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for English (`en`).
|
||||
class AppLocalizationsEn extends AppLocalizations {
|
||||
AppLocalizationsEn([String locale = 'en']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'AI Novel Assistant';
|
||||
|
||||
@override
|
||||
String get homeTitle => 'My Novels';
|
||||
|
||||
@override
|
||||
String get createNovel => 'Create New Novel';
|
||||
|
||||
@override
|
||||
String get importNovel => 'Import Novel';
|
||||
|
||||
@override
|
||||
String get editNovel => 'Edit';
|
||||
|
||||
@override
|
||||
String get deleteNovel => 'Delete';
|
||||
|
||||
@override
|
||||
String deleteConfirmation(Object title) {
|
||||
return 'Are you sure you want to delete \'$title\'? This action cannot be undone.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get cancel => 'Cancel';
|
||||
|
||||
@override
|
||||
String get confirm => 'Confirm';
|
||||
|
||||
@override
|
||||
String get novelTitle => 'Novel Title';
|
||||
|
||||
@override
|
||||
String get novelTitleHint => 'Enter novel title';
|
||||
|
||||
@override
|
||||
String get seriesName => 'Series Name (Optional)';
|
||||
|
||||
@override
|
||||
String get seriesNameHint => 'If part of a series, enter series name';
|
||||
|
||||
@override
|
||||
String get create => 'Create';
|
||||
|
||||
@override
|
||||
String lastEdited(Object date) {
|
||||
return 'Last edited: $date';
|
||||
}
|
||||
|
||||
@override
|
||||
String wordCount(Object count) {
|
||||
return '$count words';
|
||||
}
|
||||
|
||||
@override
|
||||
String completionPercentage(Object percentage) {
|
||||
return 'Completion: $percentage%';
|
||||
}
|
||||
|
||||
@override
|
||||
String get noNovels => 'No novels yet. Click the button in the bottom right to create one.';
|
||||
|
||||
@override
|
||||
String get retry => 'Retry';
|
||||
|
||||
@override
|
||||
String loadingError(Object message) {
|
||||
return 'Loading failed: $message';
|
||||
}
|
||||
|
||||
@override
|
||||
String get unknownState => 'Unknown state';
|
||||
|
||||
@override
|
||||
String get save => 'Save';
|
||||
|
||||
@override
|
||||
String get saved => 'Saved';
|
||||
|
||||
@override
|
||||
String get editorSettings => 'Editor Settings';
|
||||
|
||||
@override
|
||||
String get startWriting => 'Start writing...';
|
||||
|
||||
@override
|
||||
String get wordCountTitle => 'Word Count';
|
||||
|
||||
@override
|
||||
String get charactersWithSpaces => 'Characters (with spaces)';
|
||||
|
||||
@override
|
||||
String get charactersNoSpaces => 'Characters (no spaces)';
|
||||
|
||||
@override
|
||||
String get paragraphs => 'Paragraphs';
|
||||
|
||||
@override
|
||||
String get readTime => 'Estimated reading time';
|
||||
|
||||
@override
|
||||
String get minutes => 'minutes';
|
||||
|
||||
@override
|
||||
String get close => 'Close';
|
||||
}
|
||||
116
AINoval/lib/l10n/app_localizations_zh.dart
Normal file
116
AINoval/lib/l10n/app_localizations_zh.dart
Normal file
@@ -0,0 +1,116 @@
|
||||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for Chinese (`zh`).
|
||||
class AppLocalizationsZh extends AppLocalizations {
|
||||
AppLocalizationsZh([String locale = 'zh']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'AI小说助手';
|
||||
|
||||
@override
|
||||
String get homeTitle => '我的小说';
|
||||
|
||||
@override
|
||||
String get createNovel => '创建新小说';
|
||||
|
||||
@override
|
||||
String get importNovel => '导入小说';
|
||||
|
||||
@override
|
||||
String get editNovel => '编辑';
|
||||
|
||||
@override
|
||||
String get deleteNovel => '删除';
|
||||
|
||||
@override
|
||||
String deleteConfirmation(Object title) {
|
||||
return '确定要删除《$title》吗?此操作不可撤销。';
|
||||
}
|
||||
|
||||
@override
|
||||
String get cancel => '取消';
|
||||
|
||||
@override
|
||||
String get confirm => '确定';
|
||||
|
||||
@override
|
||||
String get novelTitle => '小说标题';
|
||||
|
||||
@override
|
||||
String get novelTitleHint => '请输入小说标题';
|
||||
|
||||
@override
|
||||
String get seriesName => '系列名称 (可选)';
|
||||
|
||||
@override
|
||||
String get seriesNameHint => '如果是系列作品,请输入系列名称';
|
||||
|
||||
@override
|
||||
String get create => '创建';
|
||||
|
||||
@override
|
||||
String lastEdited(Object date) {
|
||||
return '上次编辑: $date';
|
||||
}
|
||||
|
||||
@override
|
||||
String wordCount(Object count) {
|
||||
return '$count字';
|
||||
}
|
||||
|
||||
@override
|
||||
String completionPercentage(Object percentage) {
|
||||
return '完成度: $percentage%';
|
||||
}
|
||||
|
||||
@override
|
||||
String get noNovels => '暂无小说,点击右下角按钮创建新小说';
|
||||
|
||||
@override
|
||||
String get retry => '重试';
|
||||
|
||||
@override
|
||||
String loadingError(Object message) {
|
||||
return '加载失败: $message';
|
||||
}
|
||||
|
||||
@override
|
||||
String get unknownState => '未知状态';
|
||||
|
||||
@override
|
||||
String get save => '保存';
|
||||
|
||||
@override
|
||||
String get saved => '已保存';
|
||||
|
||||
@override
|
||||
String get editorSettings => '编辑器设置';
|
||||
|
||||
@override
|
||||
String get startWriting => '开始您的创作...';
|
||||
|
||||
@override
|
||||
String get wordCountTitle => '字数统计';
|
||||
|
||||
@override
|
||||
String get charactersWithSpaces => '字符数(含空格)';
|
||||
|
||||
@override
|
||||
String get charactersNoSpaces => '字符数(不含空格)';
|
||||
|
||||
@override
|
||||
String get paragraphs => '段落数';
|
||||
|
||||
@override
|
||||
String get readTime => '预计阅读时间';
|
||||
|
||||
@override
|
||||
String get minutes => '分钟';
|
||||
|
||||
@override
|
||||
String get close => '关闭';
|
||||
}
|
||||
40
AINoval/lib/l10n/app_zh.arb
Normal file
40
AINoval/lib/l10n/app_zh.arb
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"appTitle": "AI小说助手",
|
||||
"homeTitle": "我的小说",
|
||||
"createNovel": "创建新小说",
|
||||
"importNovel": "导入小说",
|
||||
"editNovel": "编辑",
|
||||
"deleteNovel": "删除",
|
||||
"deleteConfirmation": "确定要删除《{title}》吗?此操作不可撤销。",
|
||||
"cancel": "取消",
|
||||
"confirm": "确定",
|
||||
"novelTitle": "小说标题",
|
||||
"novelTitleHint": "请输入小说标题",
|
||||
"seriesName": "系列名称 (可选)",
|
||||
"seriesNameHint": "如果是系列作品,请输入系列名称",
|
||||
"create": "创建",
|
||||
"lastEdited": "上次编辑: {date}",
|
||||
"wordCount": "{count}字",
|
||||
"completionPercentage": "完成度: {percentage}%",
|
||||
"noNovels": "暂无小说,点击右下角按钮创建新小说",
|
||||
"retry": "重试",
|
||||
"loadingError": "加载失败: {message}",
|
||||
"unknownState": "未知状态",
|
||||
"save": "保存",
|
||||
"saved": "已保存",
|
||||
"editorSettings": "编辑器设置",
|
||||
"startWriting": "开始您的创作...",
|
||||
"wordCountTitle": "字数统计",
|
||||
"charactersWithSpaces": "字符数(含空格)",
|
||||
"charactersNoSpaces": "字符数(不含空格)",
|
||||
"paragraphs": "段落数",
|
||||
"readTime": "预计阅读时间",
|
||||
"minutes": "分钟",
|
||||
"close": "关闭",
|
||||
"chatWithAI": "与AI聊天",
|
||||
"sendMessage": "发送消息",
|
||||
"typeMessage": "输入消息...",
|
||||
"newChat": "新对话",
|
||||
"loadingChat": "加载对话中...",
|
||||
"aiAssistant": "AI助手"
|
||||
}
|
||||
13
AINoval/lib/l10n/l10n.dart
Normal file
13
AINoval/lib/l10n/l10n.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ainoval/l10n/app_localizations.dart';
|
||||
|
||||
extension AppLocalizationsX on BuildContext {
|
||||
AppLocalizations get l10n => AppLocalizations.of(this)!;
|
||||
}
|
||||
|
||||
class L10n {
|
||||
static const all = [
|
||||
Locale('zh', 'CN'),
|
||||
Locale('en', 'US'),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user