Skip to content

Commit

Permalink
🌐 Internationalization and localization
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Feb 3, 2023
1 parent 03d698b commit d214379
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 115 deletions.
15 changes: 7 additions & 8 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,28 @@
</queries>

<application
android:label="jasmine"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="jasmine"
android:requestLegacyExternalStorage="true">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
2 changes: 1 addition & 1 deletion ci/src/check_asset/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async fn main() -> Result<()> {
un => panic!("unknown target : {}", un),
};
if flutter_version.starts_with("2.") {
release_file_name = format!("compatible-{}", release_file_name);
release_file_name = format!("z-of-{}", release_file_name);
}

let client = reqwest::ClientBuilder::new().user_agent(UA).build()?;
Expand Down
23 changes: 1 addition & 22 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
## !! WARNING !!

1.3.5 以下升级上来除IOS会闪退, 请先清理数据。

保存以前的数据请自行研究, 数据库结构没有任何改变, 只有索引有改变, 导致的数据不兼容。

1. IOS : 文件管理其中会出现旧数据。
2. 安卓 : 请删除以前的APP再装新版本或在设置中清理数据
3. windows : 请删除原来的目录。
4. linux : 自行解决
5. macos : ~/Library/Application Support/jasmine

## !! WARNING !!

v1.3.9

- [x] 🐛修复jasmine不能追加下载章节
- [x] 🐛Jasmine下载总数超过图片总数
- [x] ✨支持搜索jm代码(之前搜索过的话,需要清除缓存)
- [x] 🚀升级flutter引擎

v1.3.8

- [x] 🚀功能:音量或者键盘翻页时不显示翻页动画(设置项)
- [x] 🚀 remove anime when volumes button controller touch
2 changes: 1 addition & 1 deletion lib/configs/download_and_export_to.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Widget downloadAndExportToSetting() {
if (!isPro) {
return SwitchListTile(
title: const Text("下载时同时导出", style: TextStyle(color: Colors.grey)),
subtitle: const Text("发电才能使用", style: TextStyle(color: Colors.grey)),
subtitle: const Text("订阅才能使用", style: TextStyle(color: Colors.grey)),
value: false,
onChanged: (_) {},
);
Expand Down
4 changes: 2 additions & 2 deletions lib/configs/download_thread_count.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Widget downloadThreadCountSetting() {
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: Text(
"下载线程数" + (!isPro ? "(发电)" : ""),
"下载线程数" + (!isPro ? "(订阅)" : ""),
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
Expand All @@ -36,7 +36,7 @@ Widget downloadThreadCountSetting() {

Future chooseDownloadThread(BuildContext context) async {
if (!isPro) {
defaultToast(context, "先发电才能使用多线程嗷");
defaultToast(context, "先订阅才能使用多线程嗷");
return;
}
int? value = await chooseListDialog(context,title: "选择下载线程数", values:_values,);
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/components/comic_pager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _StreamPagerState extends State<_StreamPager> {
return;
}
if (!isPro) {
defaultToast(context, "发电才能跳页哦~");
defaultToast(context, "订阅才能跳页哦~");
return;
}
_textEditController.clear();
Expand Down Expand Up @@ -196,7 +196,7 @@ class _StreamPagerState extends State<_StreamPager> {
child: const Icon(Icons.power_off_outlined),
),
const Text(
'$_noProMax页以上需要发电鸭',
'$_noProMax页以上需要订阅鸭',
textAlign: TextAlign.center,
),
],
Expand Down Expand Up @@ -385,7 +385,7 @@ class _PagerPagerState extends State<_PagerPager> {
InkWell(
onTap: () {
if (!isPro) {
defaultToast(context, "发电才能跳页哦~");
defaultToast(context, "订阅才能跳页哦~");
return;
}
_textEditController.clear();
Expand Down Expand Up @@ -462,7 +462,7 @@ class _PagerPagerState extends State<_PagerPager> {
onPressed: () {
if (_currentPage < _maxPage) {
if (!isPro && _currentPage + 1 > _noProMax) {
defaultToast(context, "$_noProMax页以上需要发电鸭");
defaultToast(context, "$_noProMax页以上需要订阅鸭");
return;
}
setState(() {
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/download_import_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> {
}
},
child: Text(
'选择.jm.zip文件进行导入\n选择jmi文件进行导入' + (!isPro ? "\n(发电后使用)" : ""),
'选择.jm.zip文件进行导入\n选择jmi文件进行导入' + (!isPro ? "\n(订阅后使用)" : ""),
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
Expand Down Expand Up @@ -187,7 +187,7 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> {
}
},
child: Text(
'选择文件夹\n(导入里面所有的zip/jmi)' + (!isPro ? "\n(发电后使用)" : ""),
'选择文件夹\n(导入里面所有的zip/jmi)' + (!isPro ? "\n(订阅后使用)" : ""),
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/downloads_exporting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
MaterialButton(
onPressed: _exportPkis,
child: Text(
"分别导出JMI" + (!isPro ? "\n(发电后使用)" : ""),
"分别导出JMI" + (!isPro ? "\n(订阅后使用)" : ""),
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
Expand All @@ -83,7 +83,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
MaterialButton(
onPressed: _exportZips,
child: Text(
"分别导出JM.ZIP" + (!isPro ? "\n(发电后使用)" : ""),
"分别导出JM.ZIP" + (!isPro ? "\n(订阅后使用)" : ""),
style: TextStyle(
color: !isPro ? Colors.grey : null,
),
Expand All @@ -97,7 +97,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {

_exportPkis() async {
if (!isPro) {
defaultToast(context, "请先发电鸭");
defaultToast(context, "请先订阅鸭");
return;
}
late String? path;
Expand Down Expand Up @@ -144,7 +144,7 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {

_exportZips() async {
if (!isPro) {
defaultToast(context, "请先发电鸭");
defaultToast(context, "请先订阅鸭");
return;
}
late String? path;
Expand Down
31 changes: 11 additions & 20 deletions lib/screens/pro_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import '../basic/commons.dart';
import '../basic/methods.dart';
import '../configs/is_pro.dart';
Expand Down Expand Up @@ -35,7 +34,7 @@ class _ProScreenState extends State<ProScreen> {
var min = size.width < size.height ? size.width : size.height;
return Scaffold(
appBar: AppBar(
title: const Text("发电中心"),
title: const Text("订阅"),
),
body: ListView(
children: [
Expand All @@ -56,32 +55,24 @@ class _ProScreenState extends State<ProScreen> {
const Padding(
padding: EdgeInsets.all(20),
child: Text(
"登录账号才能确认发电状态\n"
"点击\"我曾经发过电\"进同步发电状态\n"
"点击\"我刚才发了电\"兑换作者给您的礼物卡\n"
"去\"关于\"界面找到维护地址用爱发电",
),
),
const Padding(
padding: EdgeInsets.all(20),
child: Text(
"发电小功能 \n"
" 可以对下载批量导入导出 \n"
" 点击页码可以跳页",
"登录账号才能确认订阅状态\n"
"点击\"我曾经订阅过\"进同步订阅状态\n"
"点击\"我刚才订阅了\"兑换游戏礼品\n"
"去\"关于\"界面找到维护地址可了解此界面信息",
),
),
const Divider(),
ListTile(
title: const Text("发电详情"),
title: const Text("订阅详情"),
subtitle: Text(
isPro
? "发电中 (${DateTime.fromMillisecondsSinceEpoch(1000 * isProEx).toString()})"
: "未发电",
? "订阅中 (${DateTime.fromMillisecondsSinceEpoch(1000 * isProEx).toString()})"
: "未订阅",
),
),
const Divider(),
ListTile(
title: const Text("我曾经发过电"),
title: const Text("我曾订阅过"),
onTap: () async {
try {
await methods.reloadPro();
Expand All @@ -96,9 +87,9 @@ class _ProScreenState extends State<ProScreen> {
),
const Divider(),
ListTile(
title: const Text("我刚才发了电"),
title: const Text("我刚才订阅了"),
onTap: () async {
final code = await displayTextInputDialog(context, title: "输入代码");
final code = await displayTextInputDialog(context, title: "输入订阅代码");
if (code != null && code.isNotEmpty) {
try {
await methods.inputCdKey(code);
Expand Down
3 changes: 0 additions & 3 deletions lib/screens/settings_scree.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'dart:io';

import 'package:flutter/material.dart';

import '../basic/web_dav_sync.dart';
import '../configs/android_display_mode.dart';
import '../configs/download_and_export_to.dart';
Expand Down
48 changes: 1 addition & 47 deletions lib/screens/user_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ class _UserScreenState extends State<UserScreen>
const Divider(),
_buildComments(),
const Divider(),
// _buildFdT(),
// const Divider(),
// _buildSettingsT(),
// const Divider(),
// _buildAboutT(),
// const Divider(),
Container(height: 30),
],
),
Expand All @@ -101,7 +95,7 @@ class _UserScreenState extends State<UserScreen>
child = _buildSelfInfoCard();
break;
case LoginStatus.loginField:
child = _buildLoginButton("登录失败/点击重试");
child = _buildLoginButton("登录失败 / 点击重试");
break;
}
return Container(
Expand Down Expand Up @@ -264,44 +258,4 @@ class _UserScreenState extends State<UserScreen>
);
}

Widget _buildFdT() {
return ListTile(
title: const Text("发电"),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) {
return const ProScreen();
},
));
},
);
}

Widget _buildSettingsT() {
return ListTile(
title: const Text("设置"),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) {
return const SettingsScreen();
},
));
},
);
}

Widget _buildAboutT() {
return ListTile(
title: const VersionBadged(
child: Text("关于"),
),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) {
return const AboutScreen();
},
));
},
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: jasmine comic browser

publish_to: 'none'

version: 1.3.9+10
version: 1.3.9+11

environment:
sdk: ">=2.15.1 <3.0.0"
Expand Down

0 comments on commit d214379

Please sign in to comment.