Skip to content

Commit

Permalink
start chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
pdtxie committed Jul 28, 2024
1 parent d65e7a3 commit 9ac2784
Show file tree
Hide file tree
Showing 80 changed files with 2,352 additions and 182 deletions.
19 changes: 8 additions & 11 deletions CubeTime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
235D6A6929C2C0D3002D90D8 /* HelperShare.swift in Sources */ = {isa = PBXBuildFile; fileRef = 235D6A6829C2C0D3002D90D8 /* HelperShare.swift */; };
235D6A6E29C2C34E002D90D8 /* ManualInputTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 235D6A6D29C2C34E002D90D8 /* ManualInputTextField.swift */; };
235D6A7029C2CE09002D90D8 /* CloudkitStatusManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 235D6A6F29C2CE09002D90D8 /* CloudkitStatusManager.swift */; };
236850DD2C54D5CA00548BEA /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 236850DC2C54D5CA00548BEA /* Localizable.xcstrings */; };
2377418829A9A05A00A4F917 /* HelperUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2377418729A9A05A00A4F917 /* HelperUI.swift */; };
237B35502761995F00CC39BF /* SettingsCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 237B354F2761995F00CC39BF /* SettingsCard.swift */; };
238FB42029B8175C008EC1D4 /* GradientManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 238FB41F29B8175C008EC1D4 /* GradientManager.swift */; };
Expand Down Expand Up @@ -128,7 +129,6 @@
231827E629B5E86B00A40C78 /* FloatingPanel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FloatingPanel.swift; path = CubeTime/Tabs/FloatingPanel.swift; sourceTree = SOURCE_ROOT; };
2319F8B8276872F200644EB3 /* TimeTrend.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeTrend.swift; sourceTree = "<group>"; };
231B2E2D29BDECF9007E5DC2 /* HelperButtons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelperButtons.swift; sourceTree = "<group>"; };
231F37C02B81F7F00016A137 /* TNoodle.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = TNoodle.xcframework; sourceTree = "<group>"; };
231F37C42B81FD290016A137 /* ImportExport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportExport.swift; sourceTree = "<group>"; };
2326435F28C4927600F6322E /* TimerHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimerHeader.swift; sourceTree = "<group>"; };
23329E8F29C31CA60017AE99 /* libz.1.1.3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.1.1.3.tbd; path = usr/lib/libz.1.1.3.tbd; sourceTree = SDKROOT; };
Expand All @@ -142,6 +142,7 @@
235D6A6829C2C0D3002D90D8 /* HelperShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelperShare.swift; sourceTree = "<group>"; };
235D6A6D29C2C34E002D90D8 /* ManualInputTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManualInputTextField.swift; sourceTree = "<group>"; };
235D6A6F29C2CE09002D90D8 /* CloudkitStatusManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudkitStatusManager.swift; sourceTree = "<group>"; };
236850DC2C54D5CA00548BEA /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
2377418729A9A05A00A4F917 /* HelperUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelperUI.swift; sourceTree = "<group>"; };
23783DA429AB55750036FE2B /* getBestAverage.h++ */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = "getBestAverage.h++"; sourceTree = "<group>"; };
237B354F2761995F00CC39BF /* SettingsCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsCard.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -383,13 +384,13 @@
23DE3BCE274DDBE200254D29 = {
isa = PBXGroup;
children = (
236850DC2C54D5CA00548BEA /* Localizable.xcstrings */,
23B45E7129A855F400BDF49E /* Frameworks */,
23DE3BD9274DDBE200254D29 /* CubeTime */,
23DE3BEF274DDBE400254D29 /* CubeTimeTests */,
23DE3BF9274DDBE400254D29 /* CubeTimeUITests */,
23DE3BD8274DDBE200254D29 /* Products */,
23E647C22775B21B00561780 /* Frameworks */,
E5B1FCE92BAD87BF007C1688 /* Recovered References */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -510,14 +511,6 @@
path = Tools;
sourceTree = "<group>";
};
E5B1FCE92BAD87BF007C1688 /* Recovered References */ = {
isa = PBXGroup;
children = (
231F37C02B81F7F00016A137 /* TNoodle.xcframework */,
);
name = "Recovered References";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -589,7 +582,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1310;
LastUpgradeCheck = 1530;
LastUpgradeCheck = 1540;
TargetAttributes = {
23DE3BD6274DDBE200254D29 = {
CreatedOnToolsVersion = 13.1;
Expand All @@ -611,6 +604,7 @@
knownRegions = (
en,
Base,
"zh-Hans",
);
mainGroup = 23DE3BCE274DDBE200254D29;
packageReferences = (
Expand All @@ -637,6 +631,7 @@
files = (
23DE3BE2274DDBE300254D29 /* Preview Assets.xcassets in Resources */,
23DE3BDF274DDBE300254D29 /* Assets.xcassets in Resources */,
236850DD2C54D5CA00548BEA /* Localizable.xcstrings in Resources */,
239560A629C3056E00735035 /* SplashPad.storyboard in Resources */,
23AB648C293867EA0049993B /* 12sec-audio.wav in Resources */,
23AB648D293867EA0049993B /* 8sec-audio.wav in Resources */,
Expand Down Expand Up @@ -772,6 +767,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
Expand Down Expand Up @@ -832,6 +828,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"scale" : "1x"
},
{
"filename" : "clock@2x.png",
"filename" : "Clock@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "clock@3x.png",
"filename" : "Clock@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"scale" : "1x"
},
{
"filename" : "skewb@2x.png",
"filename" : "Skewb@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "skewb@3x.png",
"filename" : "Skewb@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
2 changes: 1 addition & 1 deletion CubeTime/CubeTimeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct CubeTime: App {
.if(dynamicTypeSize != DynamicTypeSize.large) { view in
view
.alert(isPresented: $showUpdates) {
Alert(title: Text("DynamicType Detected"), message: Text("CubeTime only supports standard DyanmicType sizes. Accessibility DynamicType modes are currently not supported, so layouts may not be rendered correctly."), dismissButton: .default(Text("Got it!")))
Alert(title: Text("DynamicType Detected"), message: Text("CubeTime only supports standard DynamicType sizes. Accessibility DynamicType modes are currently not supported, so layouts may not be rendered correctly."), dismissButton: .default(Text("Got it!")))
}
}
.environment(\.managedObjectContext, moc)
Expand Down
36 changes: 18 additions & 18 deletions CubeTime/Helper/Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ let sessionTypeForID: [SessionType: Session.Type] = [
]

let sessionDescriptions: [SessionType: String] = [
.multiphase: "A multiphase session gives you the ability to breakdown your solves into sections, such as memo/exec stages in blindfolded solving or stages in 3x3 solves.\n\nTap anywhere on the timer during a solve to record a phase lap. You can access your breakdown statistics in each time card and view overall statistics in the Stats view.",
.playground: "A playground session allows you to quickly change the scramble type within a session without having to specify a scramble type for the whole session.",
.compsim: "A comp sim (Competition Simulation) session mimics a competition scenario better by recording a non-rolling session. Your solves will be split up into averages of 5 that can be accessed in your times and statistics view.\n\nStart by choosing a target to reach."
.multiphase: String(localized: "A multiphase session gives you the ability to breakdown your solves into sections, such as memo/exec stages in blindfolded solving or stages in 3x3 solves.\n\nTap anywhere on the timer during a solve to record a phase lap. You can access your breakdown statistics in each time card and view overall statistics in the Stats view."),
.playground: String(localized: "A playground session allows you to quickly change the scramble type within a session without having to specify a scramble type for the whole session."),
.compsim: String(localized: "A comp sim (Competition Simulation) session mimics a competition scenario better by recording a non-rolling session. Your solves will be split up into averages of 5 that can be accessed in your times and statistics view.\n\nStart by choosing a target to reach.")
]


Expand All @@ -29,21 +29,21 @@ let iconNamesForType: [SessionType: String] = [


let PUZZLE_TYPES: [PuzzleType] = [
PuzzleType(name: "2x2", cstimerName: "222so"),
PuzzleType(name: "3x3", cstimerName: "333"),
PuzzleType(name: "4x4", cstimerName: "444wca"),
PuzzleType(name: "5x5", cstimerName: "555wca"),
PuzzleType(name: "6x6", cstimerName: "666wca"),
PuzzleType(name: "7x7", cstimerName: "777wca"),
PuzzleType(name: "Square-1", cstimerName: "sqrs"),
PuzzleType(name: "Megaminx", cstimerName: "mgmp"),
PuzzleType(name: "Pyraminx", cstimerName: "pyrso"),
PuzzleType(name: "Clock", cstimerName: "clkwca"),
PuzzleType(name: "Skewb", cstimerName: "skbso"),
PuzzleType(name: "3x3 OH", cstimerName: "333oh"),
PuzzleType(name: "3x3 BLD", cstimerName: "333bld"),
PuzzleType(name: "4x4 BLD", cstimerName: "444bld"),
PuzzleType(name: "5x5 BLD", cstimerName: "555bld"),
PuzzleType(name: String(localized: "2x2"), cstimerName: "222so", imageName: "puzzle-2x2"),
PuzzleType(name: String(localized: "3x3"), cstimerName: "333", imageName: "puzzle-3x3"),
PuzzleType(name: String(localized: "4x4"), cstimerName: "444wca", imageName: "puzzle-4x4"),
PuzzleType(name: String(localized: "5x5"), cstimerName: "555wca", imageName: "puzzle-5x5"),
PuzzleType(name: String(localized: "6x6"), cstimerName: "666wca", imageName: "puzzle-6x6"),
PuzzleType(name: String(localized: "7x7"), cstimerName: "777wca", imageName: "puzzle-7x7"),
PuzzleType(name: String(localized: "Square-1"), cstimerName: "sqrs", imageName: "puzzle-square-1"),
PuzzleType(name: String(localized: "Megaminx"), cstimerName: "mgmp", imageName: "puzzle-megaminx"),
PuzzleType(name: String(localized: "Pyraminx"), cstimerName: "pyrso", imageName: "puzzle-pyraminx"),
PuzzleType(name: String(localized: "Clock"), cstimerName: "clkwca", imageName: "puzzle-clock"),
PuzzleType(name: String(localized: "Skewb"), cstimerName: "skbso", imageName: "puzzle-skewb"),
PuzzleType(name: String(localized: "3x3 OH"), cstimerName: "333oh", imageName: "puzzle-3x3-oh"),
PuzzleType(name: String(localized: "3x3 BLD"), cstimerName: "333bld", imageName: "puzzle-3x3-bld"),
PuzzleType(name: String(localized: "4x4 BLD"), cstimerName: "444bld", imageName: "puzzle-4x4-bld"),
PuzzleType(name: String(localized: "5x5 BLD"), cstimerName: "555bld", imageName: "puzzle-5x5-bld"),
]


Expand Down
4 changes: 2 additions & 2 deletions CubeTime/Helper/HelperUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ struct CTPuzzleBubble: View {
let text: String

init(scrambleType: Int) {
icon = Image(PUZZLE_TYPES[scrambleType].name)
icon = Image(PUZZLE_TYPES[scrambleType].imageName)
text = PUZZLE_TYPES[scrambleType].name
}

init(scrambleType: PuzzleType) {
icon = Image(scrambleType.name)
icon = Image(scrambleType.imageName)
text = scrambleType.name
}

Expand Down
27 changes: 14 additions & 13 deletions CubeTime/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ extension Session {
case .standard:
return PUZZLE_TYPES[Int(scrambleType)].name
case .algtrainer:
return "Algorithm Trainer"
return String(localized: "Algorithm Trainer")
case .multiphase:
return "Multiphase"
return String(localized: "Multiphase")
case .playground:
return "Playground"
return String(localized: "Playground")
case .compsim:
return "Compsim"
return String(localized: "Compsim")
}
}
}
Expand All @@ -79,7 +79,7 @@ extension Session {

switch (SessionType(rawValue: sessionType)!) {
case .standard:
Image(PUZZLE_TYPES[Int(scrambleType)].name)
Image(PUZZLE_TYPES[Int(scrambleType)].imageName)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: size, height: size)
Expand Down Expand Up @@ -120,7 +120,7 @@ extension CompSimSolveGroup {
}

var avg: CalculatedAverage? {
return StopwatchManager.getCalculatedAverage(forSolves: self.solves!.allObjects as! [Solve], name: "Comp Sim Group", isCompsim: true)
return StopwatchManager.getCalculatedAverage(forSolves: self.solves!.allObjects as! [Solve], name: String(localized: "Comp Sim Group"), isCompsim: true)
}
}

Expand Down Expand Up @@ -180,6 +180,7 @@ enum SessionType: Int16 {
struct PuzzleType {
let name: String
let cstimerName: String
let imageName: String
// let puzzle: OrgWorldcubeassociationTnoodleScramblesPuzzleRegistry
}

Expand All @@ -195,13 +196,13 @@ struct AppZoom: RawRepresentable, Identifiable {
]

static private let appZoomNames: [DynamicTypeSize: String] = [
DynamicTypeSize.xSmall: "Extra Small",
DynamicTypeSize.small: "Small",
DynamicTypeSize.medium: "Medium",
DynamicTypeSize.large: "Large (Default)",
DynamicTypeSize.xLarge: "Extra Large",
DynamicTypeSize.xxLarge: "Extra Extra Large",
DynamicTypeSize.xxxLarge: "Extra Extra Extra Large",
DynamicTypeSize.xSmall: String(localized: "Extra Small"),
DynamicTypeSize.small: String(localized: "Small"),
DynamicTypeSize.medium: String(localized: "Medium"),
DynamicTypeSize.large: String(localized: "Large (Default)"),
DynamicTypeSize.xLarge: String(localized: "Extra Large"),
DynamicTypeSize.xxLarge: String(localized: "Extra Extra Large"),
DynamicTypeSize.xxxLarge: String(localized: "Extra Extra Extra Large"),
]

typealias RawValue = Int
Expand Down
2 changes: 1 addition & 1 deletion CubeTime/Sessions/NewSessionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct NewSessionView: View {
VStack (spacing: 16) {
VStack (alignment: .center, spacing: 0) {
if sessionType != SessionType.playground {
PuzzleHeaderImage(imageName: PUZZLE_TYPES[Int(sessionEventType)].name)
PuzzleHeaderImage(imageName: PUZZLE_TYPES[Int(sessionEventType)].imageName)
}

SessionNameField(name: $name)
Expand Down
6 changes: 3 additions & 3 deletions CubeTime/Sessions/SessionCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ struct SessionCardBase: View {

Spacer()

if (!forExportUse) {
Image(PUZZLE_TYPES[scrambleType].name)
if !forExportUse {
Image(PUZZLE_TYPES[scrambleType].imageName)
.resizable()
.frame(width: 45, height: 45)
.aspectRatio(contentMode: .fit)
.foregroundColor(Color("dark"))
.padding([.vertical, .trailing], 10)
.frame(maxHeight: .infinity, alignment: .topTrailing)
} else if (selected) {
} else if selected {
Image(systemName: "checkmark.circle.fill")
.font(.body.weight(.semibold))
.foregroundStyle(Color("accent"), Color("overlay0"))
Expand Down
2 changes: 1 addition & 1 deletion CubeTime/Sessions/SessionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ struct CustomiseSessionView: View {
ScrollView {
VStack(spacing: 16) {
VStack(alignment: .center, spacing: 0) {
PuzzleHeaderImage(imageName: PUZZLE_TYPES[Int(sessionEventType)].name)
PuzzleHeaderImage(imageName: PUZZLE_TYPES[Int(sessionEventType)].imageName)

SessionNameField(name: $name)
}
Expand Down
12 changes: 6 additions & 6 deletions CubeTime/Settings/AppearanceSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,25 @@ struct AppearanceSettingsView: View {
CTDivider()

DescribedSetting(description: "Turn on/off the glow effect on graphs.", {
SettingsToggle("Graph Glow", $graphGlow)
SettingsToggle(String(localized: "Graph Glow"), $graphGlow)
})

DescribedSetting(description: "Turn on/off the line animation for the time trend graph.", {
SettingsToggle("Graph Animation", $graphAnimation)
SettingsToggle(String(localized: "Graph Animation"), $graphAnimation)
})
}
.clipped()

SettingsGroup(Label("System Settings", systemImage: "command")) {
SettingsToggle("Override System Appearance", $overrideSystemAppearance)
SettingsToggle(String(localized: "Override System Appearance"), $overrideSystemAppearance)
if overrideSystemAppearance {
SettingsToggle("Dark Mode", $darkMode)
SettingsToggle(String(localized: "Dark Mode"), $darkMode)
}
}


SettingsGroup(Label("Font Settings", systemImage: "textformat")) {
SettingsStepper(text: "Scramble Size: ", format: "%d", value: $scrambleSize, in: 15...36, step: 1)
SettingsStepper(text: String(localized: "Scramble Size: "), format: "%d", value: $scrambleSize, in: 15...36, step: 1)
VStack(alignment: .leading, spacing: 0) {
Text("Preview")
.modifier(SettingsFootnote())
Expand Down Expand Up @@ -162,7 +162,7 @@ struct AppearanceSettingsView: View {

SettingsDragger(text: "Font Weight", value: $fontWeight, in: 300...800)
SettingsDragger(text: "Font Casualness", value: $fontCasual, in: 0...1)
SettingsToggle("Cursive Font", $fontCursive)
SettingsToggle(String(localized: "Cursive Font"), $fontCursive)
}

CTButton(type: .halfcoloured(Color("red")), size: .large, expandWidth: true, onTapRun: {
Expand Down
Loading

0 comments on commit 9ac2784

Please sign in to comment.