Skip to content

Commit

Permalink
更新:本地化
Browse files Browse the repository at this point in the history
  • Loading branch information
W-Mai committed Jun 19, 2023
1 parent 27139c5 commit 0df3f2f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
25 changes: 18 additions & 7 deletions Shared/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
File.strings
xSticker

Created by W-Mai on 2021/10/18.

*/

/**/
"MAIN.COMMON.DELETED" = "Deleted";
Expand All @@ -18,12 +11,30 @@
/**/
"MAIN.ENTRY.COLLECTION.DELETING.YES" = "Sure! Cruelly!";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.AUTHOR" = "Collection Author";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.CLEAR" = "Clear";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.DELETE" = "Kill me😭";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.DESCRIBE" = "Collection Describe";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.NAME" = "Collection Name";

/**/
"MAIN.ENTRY.ONE.DELETE" = "Delete";

/**/
"MAIN.ENTRY.ONE.DETAIL.COVER" = "Set as cover";

/**/
"MAIN.ENTRY.ONE.DETAIL.NAME" = "贴贴's name";

/**/
"MAIN.ENTRY.ONE.FAVORITE" = "Favorite";

Expand Down
25 changes: 18 additions & 7 deletions Shared/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
File.strings
xSticker

Created by W-Mai on 2021/10/18.

*/

/**/
"MAIN.COMMON.DELETED" = "已删除";
Expand All @@ -18,12 +11,30 @@
/**/
"MAIN.ENTRY.COLLECTION.DELETING.YES" = "对,很凶残!";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.AUTHOR" = "贴贴集作者";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.CLEAR" = "清空";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.DELETE" = "删掉我呗😭";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.DESCRIBE" = "贴贴集描述";

/**/
"MAIN.ENTRY.COLLECTION.DETAIL.NAME" = "贴贴集名称";

/**/
"MAIN.ENTRY.ONE.DELETE" = "删除";

/**/
"MAIN.ENTRY.ONE.DETAIL.COVER" = "设置为封面";

/**/
"MAIN.ENTRY.ONE.DETAIL.NAME" = "贴贴名字!";

/**/
"MAIN.ENTRY.ONE.FAVORITE" = "我喜欢";

Expand Down
16 changes: 8 additions & 8 deletions xSticker/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ struct StickerCollectionView: View {
Label(L("MAIN.ENTRY.ONE.FAVORITE"), systemImage: "square.grid.2x2")
} else {
NavigationEditor(
title: "贴贴集名字", systemImage: "square.grid.2x2",
title: L("MAIN.ENTRY.COLLECTION.DETAIL.NAME"), systemImage: "square.grid.2x2",
text: Binding(get: { collection.name ?? "" }, set: { v in collection.name = v }))
}
NavigationEditor(
title: "贴贴集作者", systemImage: "person.circle",
title: L("MAIN.ENTRY.COLLECTION.DETAIL.AUTHOR"), systemImage: "person.circle",
text: Binding(get: { collection.author ?? "" }, set: { v in collection.author = v }))
NavigationEditor(
title: "贴贴集描述", systemImage: "doc.plaintext",
title: L("MAIN.ENTRY.COLLECTION.DETAIL.DESCRIBE"), systemImage: "doc.plaintext",
text: Binding(get: { collection.collectionDescription ?? "" }, set: { v in collection.collectionDescription = v }),
longTextMode: true)
}
Expand All @@ -404,7 +404,7 @@ struct StickerCollectionView: View {
}
isCollectionInfoViewPresented = false
}, label: {
Label("清空" + "" + L("MAIN.ENTRY.ONE.FAVORITE") + "", systemImage: "trash.circle")
Label(L("MAIN.ENTRY.COLLECTION.DETAIL.CLEAR") + "" + L("MAIN.ENTRY.ONE.FAVORITE") + "", systemImage: "trash.circle")
.foregroundColor(.red)
})
} else if collection != persistence.defaultCollection {
Expand Down Expand Up @@ -608,7 +608,7 @@ struct StickerDetailView: View {
){
List{
NavigationEditor(
title: "贴贴名字", systemImage: "square.grid.2x2",
title: L("MAIN.ENTRY.ONE.DETAIL.NAME"), systemImage: "square.grid.2x2",
text: Binding(get: { sticker.name ?? "" }, set: { v in sticker.name = v }))
}
}
Expand All @@ -626,7 +626,7 @@ struct StickerDetailView: View {
collection?.profile = sticker.image
presentationMode.wrappedValue.dismiss()
} label: {
Label("设置\(sticker.name ?? "已删除")」为封面", systemImage: "heart.text.square")
Label("\(sticker.name ?? L("MAIN.COMMON.DELETED"))" + L("MAIN.ENTRY.ONE.DETAIL.COVER"), systemImage: "heart.text.square")
}
}

Expand All @@ -637,11 +637,11 @@ struct StickerDetailView: View {
persistence.removeSticker(of: sticker)
presentationMode.wrappedValue.dismiss()
}, label: {
Label("删掉我呗", systemImage: "trash.circle")
Label("MAIN.ENTRY.COLLECTION.DETAIL.DELETE", systemImage: "trash.circle")
.foregroundColor(.red)
})
}
}.navigationBarTitle(sticker.name ?? "已删除")
}.navigationBarTitle(sticker.name ?? L("MAIN.COMMON.DELETED"))
.onDisappear {
persistence.save()
}
Expand Down

0 comments on commit 0df3f2f

Please sign in to comment.