Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StringsCatalog #18

Merged
merged 9 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions PasswordBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
3F13F9C82C1DED720068908E /* EditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F13F9C72C1DED720068908E /* EditView.swift */; };
3F13F9CB2C1DEE020068908E /* PasswordFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F13F9CA2C1DEE020068908E /* PasswordFormView.swift */; };
3F1DFECF2C4B552E00BAA193 /* SafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F1DFECE2C4B552E00BAA193 /* SafariView.swift */; };
3F1DFEDD2C4CA01300BAA193 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3F1DFEDC2C4CA01300BAA193 /* Localizable.xcstrings */; };
3F1DFEE12C4CB06700BAA193 /* CommonButtonStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F1DFEE02C4CB06700BAA193 /* CommonButtonStrings.swift */; };
3F1DFEE32C4CB5F300BAA193 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3F1DFEE22C4CB5F300BAA193 /* InfoPlist.xcstrings */; };
3F3DE2F82C1DE2500089CB5A /* InfomationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3DE2F72C1DE2500089CB5A /* InfomationView.swift */; };
3F3DE2FA2C1DE2710089CB5A /* AddView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3DE2F92C1DE2710089CB5A /* AddView.swift */; };
3F6AA4B82C2FDF22008EC918 /* PasswordField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F6AA4B72C2FDF22008EC918 /* PasswordField.swift */; };
Expand Down Expand Up @@ -68,6 +71,9 @@
3F13F9C72C1DED720068908E /* EditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditView.swift; sourceTree = "<group>"; };
3F13F9CA2C1DEE020068908E /* PasswordFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordFormView.swift; sourceTree = "<group>"; };
3F1DFECE2C4B552E00BAA193 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = "<group>"; };
3F1DFEDC2C4CA01300BAA193 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
3F1DFEE02C4CB06700BAA193 /* CommonButtonStrings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonButtonStrings.swift; sourceTree = "<group>"; };
3F1DFEE22C4CB5F300BAA193 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
3F3DE2F72C1DE2500089CB5A /* InfomationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfomationView.swift; sourceTree = "<group>"; };
3F3DE2F92C1DE2710089CB5A /* AddView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddView.swift; sourceTree = "<group>"; };
3F6AA4B72C2FDF22008EC918 /* PasswordField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordField.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -291,6 +297,9 @@
3F99FC502C390D65001ED4B2 /* IconStyles.swift */,
3F026F432C3A789500ED696C /* URLs.swift */,
3FEE0F152C3C2EDE0057EE2F /* AppTips.swift */,
3F1DFEE02C4CB06700BAA193 /* CommonButtonStrings.swift */,
3F1DFEDC2C4CA01300BAA193 /* Localizable.xcstrings */,
3F1DFEE22C4CB5F300BAA193 /* InfoPlist.xcstrings */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -380,12 +389,14 @@
};
buildConfigurationList = 3F8C85922C189D4A0032277E /* Build configuration list for PBXProject "PasswordBox" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = ja;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
ja,
"zh-Hans",
fr,
);
mainGroup = 3F8C858E2C189D4A0032277E;
packageReferences = (
Expand All @@ -410,6 +421,8 @@
files = (
3F8C85A22C189D4B0032277E /* Preview Assets.xcassets in Resources */,
3F8C859F2C189D4B0032277E /* Assets.xcassets in Resources */,
3F1DFEE32C4CB5F300BAA193 /* InfoPlist.xcstrings in Resources */,
3F1DFEDD2C4CA01300BAA193 /* Localizable.xcstrings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -448,6 +461,7 @@
3F026F292C39A2E400ED696C /* EditViewModel.swift in Sources */,
3F6AA4BE2C3130FC008EC918 /* CreatePassword.swift in Sources */,
3F6AA4B82C2FDF22008EC918 /* PasswordField.swift in Sources */,
3F1DFEE12C4CB06700BAA193 /* CommonButtonStrings.swift in Sources */,
3F99FC4F2C390873001ED4B2 /* Images.swift in Sources */,
3F99FC592C39258B001ED4B2 /* Entry.swift in Sources */,
3F13F9C82C1DED720068908E /* EditView.swift in Sources */,
Expand Down Expand Up @@ -625,7 +639,7 @@
DEVELOPMENT_TEAM = B58T472MM3;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSFaceIDUsageDescription = "FaceID を使用してアプリへのアクセスを保護し、安全な認証を提供します";
INFOPLIST_KEY_NSFaceIDUsageDescription = "Use FaceID to secure access to apps and provide secure authentication";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down Expand Up @@ -661,7 +675,7 @@
DEVELOPMENT_TEAM = B58T472MM3;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSFaceIDUsageDescription = "FaceID を使用してアプリへのアクセスを保護し、安全な認証を提供します";
INFOPLIST_KEY_NSFaceIDUsageDescription = "Use FaceID to secure access to apps and provide secure authentication";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down
8 changes: 4 additions & 4 deletions PasswordBox/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ struct ContentView: View {
.cornerRadius(4)
.padding(.horizontal, 16)

Text("ログイン認証が必要です")
Text("Login authentication is required")
.font(.title)
Text("アプリを使用するには端末の認証が必要です。\n 続けるには**再認証**をしてください")
Text("You must authenticate your device in order to use the application. \n Please **re-authenticate** to continue")
.multilineTextAlignment(.center)

Button(action: {
authenticate()
}, label: {
Text("再認証する")
Text("Re-authenticate")
.padding()
.foregroundColor(.white)
.background(.blue)
Expand All @@ -48,7 +48,7 @@ struct ContentView: View {
var error: NSError?

if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) {
let description = "認証が必要です"
let description = String(localized: "Authentication required")

context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: description) { success, authenticationError in
DispatchQueue.main.async {
Expand Down
4 changes: 2 additions & 2 deletions PasswordBox/Resources/AppTips.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import TipKit
struct AppTips {
struct ChangeIcon: Tip {
var title: Text {
Text("アイコンとタイトルを変更")
Text("Change icon and title")
}
var message: Text? {
Text("アイコンとタイトルはこちらから編集することができます。")
Text("Icons and titles can be edited here.")
}
}

Expand Down
6 changes: 6 additions & 0 deletions PasswordBox/Resources/CommonButtonStrings.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation

struct CommonButtonStrings {
static let done: String = .init(localized: "Done")
static let cancel: String = .init(localized: "Cancel")
}
42 changes: 42 additions & 0 deletions PasswordBox/Resources/InfoPlist.xcstrings
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"sourceLanguage" : "en",
"strings" : {
"CFBundleName" : {
"comment" : "Bundle name",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "PasswordBox"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "PasswordBox"
}
}
}
},
"NSFaceIDUsageDescription" : {
"comment" : "Privacy - Face ID Usage Description",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Use FaceID to secure access to apps and provide secure authentication"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "FaceIDを使用してアプリへのアクセスを保護し、安全な認証を提供します。"
}
}
}
}
},
"version" : "1.0"
}
Loading