Skip to content

Commit

Permalink
Release/1.0.3 (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgzonArifi authored Mar 17, 2024
2 parents e1f7c7f + ef8ae6a commit 32ee6e7
Show file tree
Hide file tree
Showing 26 changed files with 406 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Build the macOS app without signing
working-directory: ./Lingua-App/Lingua
run: |
xcodebuild -project Lingua.xcodeproj -scheme LinguaApp clean build CODE_SIGNING_ALLOWED=NO
xcodebuild -project Lingua.xcodeproj -scheme LinguaApp clean build CODE_SIGNING_ALLOWED=NO | xcpretty
4 changes: 0 additions & 4 deletions Example-App/iOS/Example-App/Example-App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ struct ContentView: View {
Text(Lingua.General.success).padding()
}
}

#Preview {
ContentView()
}
24 changes: 20 additions & 4 deletions Lingua-App/Lingua/Lingua.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
774A1A462A8E588500789A04 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 774A1A452A8E588500789A04 /* ContentView.swift */; };
774A1A482A8E588800789A04 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 774A1A472A8E588800789A04 /* Assets.xcassets */; };
774A1A562A8E588800789A04 /* LinguaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 774A1A552A8E588800789A04 /* LinguaTests.swift */; };
777814B02B13D5C700A1B678 /* SectionsInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777814AF2B13D5C700A1B678 /* SectionsInputView.swift */; };
777BC5E12A93617000C74D72 /* ValidatingTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC5E02A93617000C74D72 /* ValidatingTextField.swift */; };
777BC5E42A9361E200C74D72 /* ValidationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC5E32A9361E200C74D72 /* ValidationRule.swift */; };
777BC5E62A9361F000C74D72 /* RequiredRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC5E52A9361F000C74D72 /* RequiredRule.swift */; };
Expand Down Expand Up @@ -39,6 +40,9 @@
77F89A482A98DF3A009EE7B1 /* CustomSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F89A472A98DF3A009EE7B1 /* CustomSearchBar.swift */; };
77FB97662ADC3928004CED84 /* LinguaAppCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77FB97652ADC3928004CED84 /* LinguaAppCommands.swift */; };
77FB97692ADC3A8B004CED84 /* ProjectMenu.strings in Resources */ = {isa = PBXBuildFile; fileRef = 77FB97672ADC3A8B004CED84 /* ProjectMenu.strings */; };
970D1F7A2B10CB5D00F6CD8E /* ProjectListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970D1F792B10CB5D00F6CD8E /* ProjectListView.swift */; };
970D1F7C2B10CBE900F6CD8E /* ConditionalModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970D1F7B2B10CBE900F6CD8E /* ConditionalModifier.swift */; };
970D1F802B10EC3F00F6CD8E /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970D1F7F2B10EC3F00F6CD8E /* Window.swift */; };
9941DA812ABE33140098B49A /* App.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9941DA7F2ABE33140098B49A /* App.strings */; };
/* End PBXBuildFile section */

Expand All @@ -62,6 +66,7 @@
774A1A4C2A8E588800789A04 /* Lingua.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Lingua.entitlements; sourceTree = "<group>"; };
774A1A512A8E588800789A04 /* LinguaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LinguaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
774A1A552A8E588800789A04 /* LinguaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinguaTests.swift; sourceTree = "<group>"; };
777814AF2B13D5C700A1B678 /* SectionsInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionsInputView.swift; sourceTree = "<group>"; };
777BC5E02A93617000C74D72 /* ValidatingTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatingTextField.swift; sourceTree = "<group>"; };
777BC5E32A9361E200C74D72 /* ValidationRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidationRule.swift; sourceTree = "<group>"; };
777BC5E52A9361F000C74D72 /* RequiredRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequiredRule.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -89,6 +94,9 @@
77F89A472A98DF3A009EE7B1 /* CustomSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSearchBar.swift; sourceTree = "<group>"; };
77FB97652ADC3928004CED84 /* LinguaAppCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinguaAppCommands.swift; sourceTree = "<group>"; };
77FB97682ADC3A8B004CED84 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ProjectMenu.strings; sourceTree = "<group>"; };
970D1F792B10CB5D00F6CD8E /* ProjectListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectListView.swift; sourceTree = "<group>"; };
970D1F7B2B10CBE900F6CD8E /* ConditionalModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConditionalModifier.swift; sourceTree = "<group>"; };
970D1F7F2B10EC3F00F6CD8E /* Window.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Window.swift; sourceTree = "<group>"; };
9941DA802ABE33140098B49A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/App.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -199,6 +207,7 @@
777BC62E2A94B2A000C74D72 /* ProgressOverlay.swift */,
779F91F82A978AC8009C77D5 /* InformationHolderView.swift */,
77F89A472A98DF3A009EE7B1 /* CustomSearchBar.swift */,
777814AF2B13D5C700A1B678 /* SectionsInputView.swift */,
);
path = UI;
sourceTree = "<group>";
Expand All @@ -216,6 +225,7 @@
isa = PBXGroup;
children = (
777BC5EB2A93707B00C74D72 /* DirectoryAccessor.swift */,
970D1F7B2B10CBE900F6CD8E /* ConditionalModifier.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -278,6 +288,7 @@
77CF0A3E2A8E61EE00AB5A2D /* ProjectItemView.swift */,
77CF0A452A8E62F300AB5A2D /* ProjectsView.swift */,
77CF0A4A2A8F54B400AB5A2D /* ProjectsViewModel.swift */,
970D1F792B10CB5D00F6CD8E /* ProjectListView.swift */,
);
path = Projects;
sourceTree = "<group>";
Expand All @@ -296,6 +307,7 @@
children = (
774A1A432A8E588500789A04 /* LinguaApp.swift */,
77FB97652ADC3928004CED84 /* LinguaAppCommands.swift */,
970D1F7F2B10EC3F00F6CD8E /* Window.swift */,
);
path = App;
sourceTree = "<group>";
Expand Down Expand Up @@ -413,10 +425,12 @@
778E9F162B03B4E20063B50F /* ProjectFormViewModel.swift in Sources */,
777BC5EC2A93707B00C74D72 /* DirectoryAccessor.swift in Sources */,
779F91FB2A97A7B0009C77D5 /* Date+Extension.swift in Sources */,
970D1F7C2B10CBE900F6CD8E /* ConditionalModifier.swift in Sources */,
77CF0A462A8E62F300AB5A2D /* ProjectsView.swift in Sources */,
77CF0A3F2A8E61EE00AB5A2D /* ProjectItemView.swift in Sources */,
77CF0A4B2A8F54B400AB5A2D /* ProjectsViewModel.swift in Sources */,
779F91F72A977378009C77D5 /* URL+Extension.swift in Sources */,
970D1F7A2B10CB5D00F6CD8E /* ProjectListView.swift in Sources */,
774A1A462A8E588500789A04 /* ContentView.swift in Sources */,
777BC5E62A9361F000C74D72 /* RequiredRule.swift in Sources */,
779F91F92A978AC8009C77D5 /* InformationHolderView.swift in Sources */,
Expand All @@ -430,6 +444,8 @@
777BC5EF2A938B8400C74D72 /* ProjectFormView.swift in Sources */,
774A1A442A8E588500789A04 /* LinguaApp.swift in Sources */,
777BC5E82A93639E00C74D72 /* DirectoryInputField.swift in Sources */,
777814B02B13D5C700A1B678 /* SectionsInputView.swift in Sources */,
970D1F802B10EC3F00F6CD8E /* Window.swift in Sources */,
777BC62F2A94B2A000C74D72 /* ProgressOverlay.swift in Sources */,
777BC5E42A9361E200C74D72 /* ValidationRule.swift in Sources */,
777BC5E12A93617000C74D72 /* ValidatingTextField.swift in Sources */,
Expand Down Expand Up @@ -631,7 +647,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -647,7 +663,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.povio.Lingua;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -667,7 +683,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -683,7 +699,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.povio.Lingua;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
32 changes: 31 additions & 1 deletion Lingua-App/Lingua/Lingua/App/LinguaApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,49 @@ import SwiftUI

@main
struct LinguaApp: App {
@Environment(\.openWindow) private var openWindow
@StateObject var viewModel = ProjectsViewModel()
var commands: LinguaAppCommands {
LinguaAppCommands(viewModel: viewModel)
}

var body: some Scene {
WindowGroup {
WindowGroup(id: Window.main.rawValue) {
ContentView()
.environmentObject(viewModel)
}
.commands {
commands.aboutApp()
commands.projectCommands
}

MenuBarExtra(String.packageName, image: "lingua_menu_bar_icon") {
VStack(spacing: 0) {
ProjectListView(shouldAddLocalizeButton: true)
.environmentObject(viewModel)

Divider()

HStack(alignment: .center) {
Button(Lingua.App.settings) {
openMainWindow()
}
.frame(height: 26)
.buttonStyle(.plain)
.padding(.horizontal, 16)
.padding(.vertical, 4)

Spacer()
}
}
}
.menuBarExtraStyle(.window)
}

func openMainWindow() {
// Don't open the main app if the window is already opened
guard let windows = NSWindow.windowNumbers(),
windows.count <= 3 else { return }
openWindow(id: Window.main.rawValue)
}
}
12 changes: 12 additions & 0 deletions Lingua-App/Lingua/Lingua/App/Window.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Window.swift
// Lingua
//
// Created by Yll Fejziu on 24/11/2023.
//

import Foundation

enum Window: String {
case main
}
14 changes: 12 additions & 2 deletions Lingua-App/Lingua/Lingua/Model/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ struct Project: Identifiable, Hashable, Equatable, Codable {
var directoryPath: String
var title: String
var swiftCode: SwiftCode
var swiftCodeEnabled: Bool = true
var swiftCodeEnabled: Bool
var createdAt: Date
var lastLocalizedAt: Date?
var filterSectionsEnabled: Bool
var allowedSections: [String]

init(id: UUID,
type: LocalizationPlatform,
Expand All @@ -27,17 +29,23 @@ struct Project: Identifiable, Hashable, Equatable, Codable {
directoryPath: String = "",
title: String = "",
swiftCode: SwiftCode = .init(stringsDirectory: "", outputSwiftCodeFileDirectory: ""),
swiftCodeEnabled: Bool = true,
createdAt: Date = .init(),
lastLocalizedAt: Date? = nil) {
lastLocalizedAt: Date? = nil,
filterSectionsEnabled: Bool = false,
allowedSections: [String] = []) {
self.id = id
self.type = type
self.apiKey = apiKey
self.sheetId = sheetId
self.directoryPath = directoryPath
self.title = title
self.swiftCode = swiftCode
self.swiftCodeEnabled = swiftCodeEnabled
self.createdAt = createdAt
self.lastLocalizedAt = lastLocalizedAt
self.filterSectionsEnabled = filterSectionsEnabled
self.allowedSections = allowedSections
}

/// Custom initializer for decoding [Project] from persisted storage.
Expand All @@ -57,6 +65,8 @@ struct Project: Identifiable, Hashable, Equatable, Codable {
swiftCodeEnabled = try container.decode(Bool.self, forKey: .swiftCodeEnabled)
createdAt = try container.decodeIfPresent(Date.self, forKey: .createdAt) ?? Date()
lastLocalizedAt = try container.decodeIfPresent(Date.self, forKey: .lastLocalizedAt)
filterSectionsEnabled = try container.decodeIfPresent(Bool.self, forKey: .filterSectionsEnabled) ?? false
allowedSections = try container.decodeIfPresent([String].self, forKey: .allowedSections) ?? []
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "lingua_menu_bar_icon.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 32ee6e7

Please sign in to comment.