translation

This commit is contained in:
wgh19
2024-05-15 19:33:16 +08:00
parent ed36114ffd
commit 6c02bf65ab
7 changed files with 72 additions and 21 deletions

View File

@@ -57,7 +57,7 @@ class _RankingPageState extends State<RankingPage> {
BatchDownloadButton(request: () => Network().getRanking(type)),
const SizedBox(width: 8,),
DropDownButton(
title: Text(types[type]!),
title: Text(types[type]!.tl),
items: types.entries.map((e) => MenuFlyoutItem(
text: Text(e.value.tl),
onPressed: () {

View File

@@ -267,10 +267,10 @@ class _SearchSettingsState extends State<SearchSettings> {
child: Text("Search Settings".tl, style: const TextStyle(fontSize: 18),),
).toAlign(Alignment.centerLeft),
buildItem(title: "Match".tl, child: DropDownButton(
title: Text(appdata.searchOptions.matchType.toString()),
title: Text(appdata.searchOptions.matchType.toString().tl),
items: KeywordMatchType.values.map((e) =>
MenuFlyoutItem(
text: Text(e.toString()),
text: Text(e.toString().tl),
onPressed: () {
if(appdata.searchOptions.matchType != e) {
setState(() => appdata.searchOptions.matchType = e);
@@ -281,10 +281,10 @@ class _SearchSettingsState extends State<SearchSettings> {
).toList(),
)),
buildItem(title: "Favorite number".tl, child: DropDownButton(
title: Text(appdata.searchOptions.favoriteNumber.toString()),
title: Text(appdata.searchOptions.favoriteNumber.toString().tl),
items: FavoriteNumber.values.map((e) =>
MenuFlyoutItem(
text: Text(e.toString()),
text: Text(e.toString().tl),
onPressed: () {
if(appdata.searchOptions.favoriteNumber != e) {
setState(() => appdata.searchOptions.favoriteNumber = e);
@@ -295,10 +295,10 @@ class _SearchSettingsState extends State<SearchSettings> {
).toList(),
)),
buildItem(title: "Sort".tl, child: DropDownButton(
title: Text(appdata.searchOptions.sort.toString()),
title: Text(appdata.searchOptions.sort.toString().tl),
items: SearchSort.values.map((e) =>
MenuFlyoutItem(
text: Text(e.toString()),
text: Text(e.toString().tl),
onPressed: () {
if(appdata.searchOptions.sort != e) {
setState(() => appdata.searchOptions.sort = e);
@@ -315,7 +315,7 @@ class _SearchSettingsState extends State<SearchSettings> {
width: double.infinity,
child: Column(
children: [
const Text("Start Time", style: TextStyle(fontSize: 16),)
Text("Start Time".tl, style: const TextStyle(fontSize: 16),)
.paddingVertical(8)
.toAlign(Alignment.centerLeft)
.paddingLeft(16),
@@ -339,7 +339,7 @@ class _SearchSettingsState extends State<SearchSettings> {
width: double.infinity,
child: Column(
children: [
const Text("End Time", style: TextStyle(fontSize: 16),)
Text("End Time".tl, style: const TextStyle(fontSize: 16),)
.paddingVertical(8)
.toAlign(Alignment.centerLeft)
.paddingLeft(16),
@@ -357,10 +357,10 @@ class _SearchSettingsState extends State<SearchSettings> {
),
)),
buildItem(title: "Age limit".tl, child: DropDownButton(
title: Text(appdata.searchOptions.ageLimit.toString()),
title: Text(appdata.searchOptions.ageLimit.toString().tl),
items: AgeLimit.values.map((e) =>
MenuFlyoutItem(
text: Text(e.toString()),
text: Text(e.toString().tl),
onPressed: () {
if(appdata.searchOptions.ageLimit != e) {
setState(() => appdata.searchOptions.ageLimit = e);

View File

@@ -115,7 +115,7 @@ class _SettingsPageState extends State<SettingsPage> {
child: Column(
children: [
buildItem(
title: "Download Path",
title: "Download Path".tl,
subtitle: appdata.settings["downloadPath"],
action: Button(
child: Text("Manage".tl).fixWidth(64),
@@ -128,7 +128,7 @@ class _SettingsPageState extends State<SettingsPage> {
}),
),
buildItem(
title: "Subpath",
title: "Subpath".tl,
subtitle: appdata.settings["downloadSubPath"],
action: Button(
child: Text("Manage".tl).fixWidth(64),
@@ -136,6 +136,23 @@ class _SettingsPageState extends State<SettingsPage> {
context.to(() => const _SetDownloadSubPathPage());
}),
),
buildItem(
title: "Max parallels".tl,
action: SizedBox(
width: 64,
height: 32,
child: NumberBox<int>(
value: appdata.settings["maxParallels"],
autofocus: false,
onChanged: (value) {
appdata.settings["maxParallels"] = value;
appdata.writeSettings();
},
clearButton: false,
mode: SpinButtonPlacementMode.none,
),
),
),
],
),
);
@@ -289,7 +306,7 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> {
${"Edit the rule for where to save an image.".tl}
${"Note: The rule should include the filename.".tl}
${"Some keywords will be replaced by the following rule:"}
${"Some keywords will be replaced by the following rule:".tl}
\${title} -> ${"Title of the work".tl}
\${author} -> ${"Name of the author".tl}
\${id} -> ${"Artwork ID".tl}
@@ -303,7 +320,7 @@ ${"The final text will be affected by the \"Use translated tag name\" setting.".
...
${"Weights of the tags".tl}:
Filled with tags. The tags should be separated by a space. The tag in front has higher weight.
It is required to use the original name instead of the translated name.
${"Filled with tags. The tags should be separated by a space. The tag in front has higher weight.".tl}
${"It is required to use the original name instead of the translated name.".tl}
""";
}