Skip to content

Commit

Permalink
Release/1.0.1 (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgzonArifi authored Nov 21, 2023
2 parents 1c1473e + fc2cd63 commit d6194ef
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 134 deletions.
38 changes: 33 additions & 5 deletions Lingua-App/Lingua/Lingua.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
777BC6322A94B53300C74D72 /* LocalizationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC6312A94B53300C74D72 /* LocalizationManager.swift */; };
777BC6342A94E12F00C74D72 /* HUDOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC6332A94E12F00C74D72 /* HUDOverlay.swift */; };
777BC6362A94E6A600C74D72 /* UserDefaults+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777BC6352A94E6A600C74D72 /* UserDefaults+Extension.swift */; };
778E9F162B03B4E20063B50F /* ProjectFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 778E9F152B03B4E20063B50F /* ProjectFormViewModel.swift */; };
779F91F72A977378009C77D5 /* URL+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 779F91F62A977378009C77D5 /* URL+Extension.swift */; };
779F91F92A978AC8009C77D5 /* InformationHolderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 779F91F82A978AC8009C77D5 /* InformationHolderView.swift */; };
779F91FB2A97A7B0009C77D5 /* Date+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 779F91FA2A97A7B0009C77D5 /* Date+Extension.swift */; };
Expand All @@ -36,6 +37,8 @@
77CF0A462A8E62F300AB5A2D /* ProjectsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77CF0A452A8E62F300AB5A2D /* ProjectsView.swift */; };
77CF0A4B2A8F54B400AB5A2D /* ProjectsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77CF0A4A2A8F54B400AB5A2D /* ProjectsViewModel.swift */; };
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 */; };
9941DA812ABE33140098B49A /* App.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9941DA7F2ABE33140098B49A /* App.strings */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -74,6 +77,7 @@
777BC6312A94B53300C74D72 /* LocalizationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationManager.swift; sourceTree = "<group>"; };
777BC6332A94E12F00C74D72 /* HUDOverlay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HUDOverlay.swift; sourceTree = "<group>"; };
777BC6352A94E6A600C74D72 /* UserDefaults+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Extension.swift"; sourceTree = "<group>"; };
778E9F152B03B4E20063B50F /* ProjectFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectFormViewModel.swift; sourceTree = "<group>"; };
779F91F62A977378009C77D5 /* URL+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Extension.swift"; sourceTree = "<group>"; };
779F91F82A978AC8009C77D5 /* InformationHolderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InformationHolderView.swift; sourceTree = "<group>"; };
779F91FA2A97A7B0009C77D5 /* Date+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Extension.swift"; sourceTree = "<group>"; };
Expand All @@ -83,6 +87,8 @@
77CF0A452A8E62F300AB5A2D /* ProjectsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectsView.swift; sourceTree = "<group>"; };
77CF0A4A2A8F54B400AB5A2D /* ProjectsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectsViewModel.swift; sourceTree = "<group>"; };
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>"; };
9941DA802ABE33140098B49A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/App.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -137,11 +143,11 @@
774A1A422A8E588500789A04 /* Lingua */ = {
isa = PBXGroup;
children = (
77FB97622ADBE681004CED84 /* App */,
777BC5F02A938E2B00C74D72 /* Resources */,
777BC5DD2A93615B00C74D72 /* Utils */,
77CF0A402A8E620900AB5A2D /* Model */,
774A1A6F2A8E593500789A04 /* Scenes */,
774A1A432A8E588500789A04 /* LinguaApp.swift */,
);
path = Lingua;
sourceTree = "<group>";
Expand Down Expand Up @@ -218,6 +224,7 @@
isa = PBXGroup;
children = (
777BC5EE2A938B8400C74D72 /* ProjectFormView.swift */,
778E9F152B03B4E20063B50F /* ProjectFormViewModel.swift */,
);
path = ProjectFormView;
sourceTree = "<group>";
Expand Down Expand Up @@ -247,6 +254,7 @@
777BC6202A93E07500C74D72 /* Localization */ = {
isa = PBXGroup;
children = (
77FB97672ADC3A8B004CED84 /* ProjectMenu.strings */,
777BC6212A93E07500C74D72 /* General.strings */,
777BC6232A93E07500C74D72 /* Projects.strings */,
777BC6252A93E07500C74D72 /* ProjectForm.strings */,
Expand Down Expand Up @@ -283,6 +291,15 @@
path = Model;
sourceTree = "<group>";
};
77FB97622ADBE681004CED84 /* App */ = {
isa = PBXGroup;
children = (
774A1A432A8E588500789A04 /* LinguaApp.swift */,
77FB97652ADC3928004CED84 /* LinguaAppCommands.swift */,
);
path = App;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -370,6 +387,7 @@
buildActionMask = 2147483647;
files = (
777BC6282A93E07500C74D72 /* General.strings in Resources */,
77FB97692ADC3A8B004CED84 /* ProjectMenu.strings in Resources */,
777BC62A2A93E07500C74D72 /* ProjectForm.strings in Resources */,
9941DA812ABE33140098B49A /* App.strings in Resources */,
777BC6292A93E07500C74D72 /* Projects.strings in Resources */,
Expand All @@ -392,6 +410,7 @@
buildActionMask = 2147483647;
files = (
77F89A482A98DF3A009EE7B1 /* CustomSearchBar.swift in Sources */,
778E9F162B03B4E20063B50F /* ProjectFormViewModel.swift in Sources */,
777BC5EC2A93707B00C74D72 /* DirectoryAccessor.swift in Sources */,
779F91FB2A97A7B0009C77D5 /* Date+Extension.swift in Sources */,
77CF0A462A8E62F300AB5A2D /* ProjectsView.swift in Sources */,
Expand All @@ -404,6 +423,7 @@
777BC61F2A93A16600C74D72 /* Binding+Project.swift in Sources */,
777BC62B2A93E07500C74D72 /* Lingua.swift in Sources */,
777BC6342A94E12F00C74D72 /* HUDOverlay.swift in Sources */,
77FB97662ADC3928004CED84 /* LinguaAppCommands.swift in Sources */,
77CF0A442A8E624900AB5A2D /* LocalizationPlatform+Extension.swift in Sources */,
777BC6322A94B53300C74D72 /* LocalizationManager.swift in Sources */,
777BC6362A94E6A600C74D72 /* UserDefaults+Extension.swift in Sources */,
Expand Down Expand Up @@ -460,6 +480,14 @@
name = ProjectForm.strings;
sourceTree = "<group>";
};
77FB97672ADC3A8B004CED84 /* ProjectMenu.strings */ = {
isa = PBXVariantGroup;
children = (
77FB97682ADC3A8B004CED84 /* en */,
);
name = ProjectMenu.strings;
sourceTree = "<group>";
};
9941DA7F2ABE33140098B49A /* App.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -603,7 +631,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 9;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -619,7 +647,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.povio.Lingua;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -639,7 +667,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 9;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -655,7 +683,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.povio.Lingua;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
27 changes: 27 additions & 0 deletions Lingua-App/Lingua/Lingua/App/LinguaApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// LinguaApp.swift
// Lingua
//
// Created by Egzon Arifi on 17/08/2023.
//

import SwiftUI

@main
struct LinguaApp: App {
@StateObject var viewModel = ProjectsViewModel()
var commands: LinguaAppCommands {
LinguaAppCommands(viewModel: viewModel)
}

var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(viewModel)
}
.commands {
commands.aboutApp()
commands.projectCommands
}
}
}
92 changes: 92 additions & 0 deletions Lingua-App/Lingua/Lingua/App/LinguaAppCommands.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// LinguaAppCommands.swift
// Lingua
//
// Created by Egzon Arifi on 16/10/2023.
//

import SwiftUI

struct LinguaAppCommands {
@ObservedObject var viewModel: ProjectsViewModel

var projectCommands: some Commands {
CommandMenu(Lingua.ProjectMenu.title) {
newProjectButton()
localizeProjectButton()
duplicateProjectButton()
deleteProjectButton()
}
}
}

// MARK: - AboutApp
extension LinguaAppCommands {
func aboutApp() -> CommandGroup<Button<Text>> {
CommandGroup(replacing: .appInfo) {
Button(Lingua.App.about) {
NSApplication.shared.orderFrontStandardAboutPanel(
options: [
NSApplication.AboutPanelOptionKey.credits: NSAttributedString(
string: Lingua.App.description,
attributes: [
NSAttributedString.Key.font: NSFont.boldSystemFont(
ofSize: NSFont.smallSystemFontSize)
]
),
NSApplication.AboutPanelOptionKey(
rawValue: Lingua.App.copyright
): Lingua.App.copyrightYear
]
)
}
}
}
}

// MARK: - Project Menu
private extension LinguaAppCommands {
func newProjectButton() -> some View {
Button(action: {
withAnimation {
viewModel.createNewProject()
}
}) {
Text(Lingua.ProjectMenu.new)
}
.keyboardShortcut("n", modifiers: [.command, .shift])
}

func localizeProjectButton() -> some View {
Button(action: {
guard let selectedProject = viewModel.selectedProject else { return }
Task { await viewModel.localizeProject(selectedProject) }
}) {
Text(Lingua.ProjectMenu.localize)
}
.keyboardShortcut("l", modifiers: [.command, .shift])
.disabled(!(viewModel.selectedProject?.isValid() ?? false))
}

func duplicateProjectButton() -> some View {
Button(action: {
guard let selectedProject = viewModel.selectedProject else { return }
viewModel.duplicate(selectedProject)
}) {
Text(Lingua.ProjectMenu.duplicate)
}
.keyboardShortcut("d", modifiers: [.command, .shift])
.disabled(viewModel.selectedProject == nil)
}

func deleteProjectButton() -> some View {
Button(action: {
viewModel.projectToDelete = viewModel.selectedProject
viewModel.showDeleteAlert = true
}) {
Text(Lingua.ProjectMenu.delete)
}
.keyboardShortcut(.delete, modifiers: [.command])
.disabled(viewModel.selectedProject == nil)
}
}
37 changes: 0 additions & 37 deletions Lingua-App/Lingua/Lingua/LinguaApp.swift

This file was deleted.

10 changes: 10 additions & 0 deletions Lingua-App/Lingua/Lingua/Model/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,14 @@ extension Project {
return Image(systemName: "a.square.fill")
}
}

func isValid(_ rule: RequiredRule = .init()) -> Bool {
let basicValidation = rule.validate(apiKey) && rule.validate(sheetId) &&
rule.validate(title) && rule.validate(directoryPath)
if type == .ios && swiftCodeEnabled {
return basicValidation && rule.validate(swiftCode.stringsDirectory) &&
rule.validate(swiftCode.outputSwiftCodeFileDirectory)
}
return basicValidation
}
}
13 changes: 13 additions & 0 deletions Lingua-App/Lingua/Lingua/Resources/Localization/Lingua.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ enum Lingua {
static let swiftCodeToggleTitle = tr("ProjectForm", "swift_code_toggle_title")
}

enum ProjectMenu {
/// Delete
static let delete = tr("ProjectMenu", "delete")
/// Duplicate
static let duplicate = tr("ProjectMenu", "duplicate")
/// Localize
static let localize = tr("ProjectMenu", "localize")
/// New
static let new = tr("ProjectMenu", "new")
/// Project
static let title = tr("ProjectMenu", "title")
}

enum Projects {
/// %@ copy
static func copyProject(_ param1: String) -> String {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file was generated with Lingua command line tool. Please do not change it!
// Source: https://github.com/poviolabs/Lingua

"title" = "Project";
"localize" = "Localize";
"new" = "New";
"duplicate" = "Duplicate";
"delete" = "Delete";
3 changes: 3 additions & 0 deletions Lingua-App/Lingua/Lingua/Scenes/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import SwiftUI

struct ContentView: View {
@EnvironmentObject private var viewModel: ProjectsViewModel

var body: some View {
ProjectsView()
.environmentObject(viewModel)
}
}
Loading

0 comments on commit d6194ef

Please sign in to comment.