Skip to content

Commit

Permalink
英語対応
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuz0u committed Dec 25, 2020
1 parent 3cc25dc commit 9c58df0
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 12 deletions.
21 changes: 20 additions & 1 deletion EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ABC3C7962593699B00E0C11B /* Manga.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C7802593699A00E0C11B /* Manga.swift */; };
ABC3C79D259369FE00E0C11B /* Kanna in Frameworks */ = {isa = PBXBuildFile; productRef = ABC3C79C259369FE00E0C11B /* Kanna */; };
ABC3C7A125936A2F00E0C11B /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = ABC3C7A025936A2F00E0C11B /* SDWebImageSwiftUI */; };
ABEE0AFA2595C6F800C997AE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABEE0AFC2595C6F800C997AE /* Localizable.strings */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -42,6 +43,8 @@
ABC3C77C2593699A00E0C11B /* RequestManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestManager.swift; sourceTree = "<group>"; };
ABC3C77D2593699A00E0C11B /* MangaStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MangaStore.swift; sourceTree = "<group>"; };
ABC3C7802593699A00E0C11B /* Manga.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manga.swift; sourceTree = "<group>"; };
ABEE0AFB2595C6F800C997AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
ABEE0AFE2595C73D00C997AE /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -92,6 +95,7 @@
ABC3C76C2593699A00E0C11B /* Settings.swift */,
ABC3C76D2593699A00E0C11B /* Defaults.swift */,
ABC3C76E2593699A00E0C11B /* Info.plist */,
ABEE0AFC2595C6F800C997AE /* Localizable.strings */,
ABC3C7692593699A00E0C11B /* Assets.xcassets */,
);
path = "アプリ";
Expand Down Expand Up @@ -183,11 +187,13 @@
};
buildConfigurationList = ABC3C74F2593696C00E0C11B /* Build configuration list for PBXProject "EhPanda" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
developmentRegion = ja;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
ja,
"zh-Hans",
);
mainGroup = ABC3C74B2593696C00E0C11B;
packageReferences = (
Expand All @@ -209,6 +215,7 @@
buildActionMask = 2147483647;
files = (
ABC3C7852593699B00E0C11B /* Assets.xcassets in Resources */,
ABEE0AFA2595C6F800C997AE /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -237,6 +244,18 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
ABEE0AFC2595C6F800C997AE /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
ABEE0AFB2595C6F800C997AE /* en */,
ABEE0AFE2595C73D00C997AE /* zh-Hans */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
ABC3C7612593696E00E0C11B /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
6 changes: 6 additions & 0 deletions EhPanda/アプリ/Common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public func executeSyncally(_ closure: @escaping (()->())) {
}
}

extension String {
func lString() -> String {
NSLocalizedString(self, comment: "")
}
}

extension UINavigationController: UIGestureRecognizerDelegate {
override open func viewDidLoad() {
super.viewDidLoad()
Expand Down
87 changes: 87 additions & 0 deletions EhPanda/アプリ/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
Localizable.strings
EhPanda

Created by 荒木辰造 on R 2/12/25.

*/

// MARK: LoadingView
"読み込み中..." = "Loading...";

// MARK: HomeView
"検索" = "Search";
"人気" = "Popular";
"お気に入り" = "Favorite";
"ダウンロード済み" = "Downloaded";


// MARK: DetailView
"読む" = "READ";
"気に入り" = "FAVORED";
"人" = "Times";
"言語" = "LANGUAGE";
"件の評価" = " RATINGS";
"ページ" = "PAGE COUNT";
"頁" = "Pages";
"サイズ" = "SIZE";
"プレビュー" = "Preview";

// MARK: Category
"同人誌" = "Doujinshi";
"漫画" = "Manga";
"イラスト" = "Artist CG";
"ゲームCG" = "Game CG";
"西洋" = "Western";
"健全" = "Non-H";
"画像集" = "Image Set";
"コスプレ" = "Cosplay";
"アジア" = "Asian Porn";
"その他" = "Misc";

// MARK: Language
"その他" = "Other";

"アフリカーンス語" = "Afrikaans"; "アルバニア語" = "Albanian"; "アラビア語" = "Arabic";

"ベンガル語" = "Bengali"; "ボスニア語" = "Bosnian"; "ブルガリア語" = "Bulgarian"; "ビルマ語" = "Burmese";

"カタルーニャ語" = "Catalan"; "セブアノ語" = "Cebuano"; "中国語" = "Chinese"; "クロアチア語" = "Croatian"; "チェコ語" = "Czech";

"デンマーク語" = "Danish"; "オランダ語" = "Dutch";

"英語" = "English"; "国際語" = "Esperanto"; "エストニア語" = "Estonian";

"フィンランド語" = "Finnish"; "フランス語" = "French";

"グルジア語" = "Georgian"; "ドイツ語" = "German"; "ギリシア語" = "Greek";

"ヘブライ語" = "Hebrew"; "ヒンディー語" = "Hindi"; "ミャオ語" = "Hmong"; "ハンガリー語" = "Hungarian";

"インドネシア語" = "Indonesian"; "イタリア語" = "Italian";

"日本語" = "Japanese";

"カザフ語" = "Kazakh"; "クメール語" = "Khmer"; "韓国語" = "Korean"; "クルド語" = "Kurdish";

"ラーオ語" = "Lao"; "ラテン語" = "Latin";

"モンゴル語" = "Mongolian";

"ンデベレ語" = "Ndebele"; "ネパール語" = "Nepali"; "ノルウェー語" = "Norwegian";

"オロモ語" = "Oromo";

"パシュトー語" = "Pashto"; "ペルシア語" = "Persian"; "ポーランド語" = "Polish"; "ポルトガル語" = "Portuguese"; "パンジャーブ語" = "Punjabi";

"ルーマニア語" = "Romanian"; "ロシア語" = "Russian";

"サンゴ語" = "Sango"; "セルビア語" = "Serbian"; "ショナ語" = "Shona"; "スロバキア語" = "Slovak"; "スロベニア語" = "Slovenian"; "ソマリ語" = "Somali"; "スペイン語" = "Spanish"; "スワヒリ語" = "Swahili"; "スウェーデン語" = "Swedish";

"タガログ語" = "Tagalog"; "タイ語" = "Thai"; "ティグリニャ語" = "Tigrinya"; "トルコ語" = "Turkish";

"ウクライナ語" = "Ukrainian"; "ウルドゥー語" = "Urdu";

"ベトナム語" = "Vietnamese";

"ズールー語" = "Zulu";
7 changes: 7 additions & 0 deletions EhPanda/アプリ/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Localizable.strings
EhPanda

Created by 荒木辰造 on R 2/12/25.

*/
21 changes: 15 additions & 6 deletions EhPanda/インターフェイス/ホーム/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private struct HeaderView: View {
.foregroundColor(Color.primary.opacity(0.6))
Spacer()
HStack {
Text(manga.translatedCategory)
Text(manga.translatedCategory.lString())
.fontWeight(.bold)
.lineLimit(1)
.font(.headline)
Expand Down Expand Up @@ -171,15 +171,24 @@ private struct DescScrollView: View {

var body: some View {
HStack(alignment: .center) {
DescScrollItem(title: "気に入り", value: detail.likeCount, numeral: "")
DescScrollItem(title: "気に入り".lString(),
value: detail.likeCount,
numeral: "".lString())
Spacer()
DescScrollItem(title: "言語", value: detail.languageAbbr, numeral: detail.translatedLanguage)
DescScrollItem(title: "言語".lString(),
value: detail.languageAbbr,
numeral: detail.translatedLanguage.lString())
Spacer()
DescScrollRatingItem(title: detail.ratingCount + "件の評価", rating: manga.rating)
DescScrollRatingItem(title: detail.ratingCount + "件の評価".lString(),
rating: manga.rating)
Spacer()
DescScrollItem(title: "ページ", value: detail.pageCount, numeral: "")
DescScrollItem(title: "ページ".lString(),
value: detail.pageCount,
numeral: "".lString())
Spacer()
DescScrollItem(title: "サイズ", value: detail.sizeCount, numeral: detail.sizeType)
DescScrollItem(title: "サイズ".lString(),
value: detail.sizeCount,
numeral: detail.sizeType)
}
.padding(.horizontal)
}
Expand Down
8 changes: 4 additions & 4 deletions EhPanda/インターフェイス/ホーム/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct HomeView: View {
}
.padding()
}
.navigationBarTitle(currentPageType.rawValue)
.navigationBarTitle(currentPageType.rawValue.lString())
.navigationBarItems(
leading:
CategoryPicker(currentPageType: $currentPageType)
Expand Down Expand Up @@ -93,7 +93,7 @@ private struct CategoryPicker: View {
content: {
let homepageTypes: [HomepageType] = [.popular, .favorite, .downloaded]
ForEach(homepageTypes, id: \.self) {
Text($0.rawValue)
Text($0.rawValue.lString())
}
})
.pickerStyle(MenuPickerStyle())
Expand All @@ -111,7 +111,7 @@ private struct SearchBar: View {
Image(systemName: "magnifyingglass")
.foregroundColor(.gray)
ZStack {
TextField("検索ワードを入力してください", text: $keyword, onCommit: commitAction)
TextField("検索", text: $keyword, onCommit: commitAction)
.disableAutocorrection(true)
.autocapitalization(.none)
HStack {
Expand Down Expand Up @@ -170,7 +170,7 @@ private struct MangaSummaryRow: View {
RatingView(rating: manga.rating)
}
HStack(alignment: .bottom) {
Text(manga.translatedCategory)
Text(manga.translatedCategory.lString())
.fontWeight(.bold)
.lineLimit(1)
.font(.footnote)
Expand Down
1 change: 0 additions & 1 deletion EhPanda/モデル/Manga.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by 荒木辰造 on R 2/11/22.
//

import Foundation
import SwiftUI

// MARK: 構造体
Expand Down

0 comments on commit 9c58df0

Please sign in to comment.