Skip to content

Commit

Permalink
🔀️ Merge branch 'ladislas/feature/contentkit-move-back-activity-detai…
Browse files Browse the repository at this point in the history
…ls-view'
  • Loading branch information
ladislas committed Mar 22, 2024
2 parents 0205bd6 + 42488d7 commit 856b35b
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ struct RowView<T: StringProtocol>: View {
}
}

// MARK: - ActivityDetailsView
// MARK: - ActivityDebugView

struct ActivityDetailsView: View {
struct ActivityDebugView: View {
// MARK: Internal

let activity: Activity
Expand Down Expand Up @@ -153,6 +153,6 @@ struct ActivityDetailsView: View {

#Preview {
NavigationStack {
ActivityDetailsView(activity: Activity.mock)
ActivityDebugView(activity: Activity.mock)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,20 @@ struct ActivityListView: View {
.resizable()
.scaledToFit()
.frame(width: 44, height: 44)
Text(activity.name)
Text("\(activity.details.title)")
}
NavigationLink(destination: ActivityDebugView(activity: activity)) {
Image(uiImage: activity.details.iconImage)
.resizable()
.scaledToFit()
.frame(width: 22, height: 22)
.padding(.leading, 11)
Text("\(activity.details.title) (DEBUG)")
.font(.caption)
}
}
}
.navigationTitle("Activities")
.onAppear {
let skills = Skills.list
for (index, skill) in skills.enumerated() {
print("skill \(index + 1)")
print("id: \(skill.id)")
print("name: \(skill.name)")
print("description: \(skill.description)")
}

let hmis = HMI.list
for (index, hmi) in hmis.enumerated() {
print("hmi \(index + 1)")
print("id: \(hmi.id)")
print("name: \(hmi.name)")
print("description: \(hmi.description)")
}

let authors = Authors.list
for (index, author) in authors.enumerated() {
print("author \(index + 1)")
print("id: \(author.id)")
print("name: \(author.name)")
print("description: \(author.description)")
}
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions Modules/ContentKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ let project = Project.module(
dependencies: [
.project(target: "LocalizationKit", path: Path("../../Modules/LocalizationKit")),
.project(target: "LogKit", path: Path("../../Modules/LogKit")),
.project(target: "DesignKit", path: Path("../../Modules/DesignKit")),
.external(name: "Version"),
.external(name: "Yams"),
.external(name: "MarkdownUI"),
.external(name: "Fit"),
]
)
78 changes: 78 additions & 0 deletions Modules/ContentKit/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"version": "1.0",
"sourceLanguage": "en",
"strings": {
"content_kit.activity_details_view.authors_section_title": {
"comment": "ActivityDetailsView 'authors' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Authors"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Auteurs"
}
}
}
},
"content_kit.activity_details_view.description_section_title": {
"comment": "ActivityDetailsView 'description' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Description"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Description"
}
}
}
},
"content_kit.activity_details_view.instructions_section_title": {
"comment": "ActivityDetailsView 'instructions' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Instructions"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Instructions"
}
}
}
},
"content_kit.activity_details_view.skills_section_title": {
"comment": "ActivityDetailsView 'skills' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Skills"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Comp\u00e9tences"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import SwiftUI

// TODO: (@ladislas) move to UtilsKit
public extension Text {
init(markdown: String) {
self.init(.init(markdown))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import ContentKit
import DesignKit
import Fit
import LocalizationKit
Expand Down Expand Up @@ -118,23 +117,23 @@ public struct ActivityDetailsView: View {

extension l10n {
enum ActivityDetailsView {
static let skillsSectionTitle = LocalizedString("game_engine_kit.activity_details_view.skills_section_title",
bundle: GameEngineKitResources.bundle,
static let skillsSectionTitle = LocalizedString("content_kit.activity_details_view.skills_section_title",
bundle: ContentKitResources.bundle,
value: "Skills",
comment: "ActivityDetailsView 'skills' section title")

static let authorsSectionTitle = LocalizedString("game_engine_kit.activity_details_view.authors_section_title",
bundle: GameEngineKitResources.bundle,
static let authorsSectionTitle = LocalizedString("content_kit.activity_details_view.authors_section_title",
bundle: ContentKitResources.bundle,
value: "Authors",
comment: "ActivityDetailsView 'authors' section title")

static let descriptionSectionTitle = LocalizedString("game_engine_kit.activity_details_view.description_section_title",
bundle: GameEngineKitResources.bundle,
static let descriptionSectionTitle = LocalizedString("content_kit.activity_details_view.description_section_title",
bundle: ContentKitResources.bundle,
value: "Description",
comment: "ActivityDetailsView 'description' section title")

static let instructionsSectionTitle = LocalizedString("game_engine_kit.activity_details_view.instructions_section_title",
bundle: GameEngineKitResources.bundle,
static let instructionsSectionTitle = LocalizedString("content_kit.activity_details_view.instructions_section_title",
bundle: ContentKitResources.bundle,
value: "Instructions",
comment: "ActivityDetailsView 'instructions' section title")
}
Expand Down
1 change: 0 additions & 1 deletion Modules/GameEngineKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let project = Project.module(
.project(target: "LocalizationKit", path: Path("../../Modules/LocalizationKit")),
.external(name: "SwiftUIJoystick"),
.external(name: "AudioKit"),
.external(name: "Fit"),
.external(name: "SVGView"),
]
)
72 changes: 0 additions & 72 deletions Modules/GameEngineKit/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -38,78 +38,6 @@
}
}
},
"game_engine_kit.activity_details_view.authors_section_title": {
"comment": "ActivityDetailsView 'authors' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Authors"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Auteurs"
}
}
}
},
"game_engine_kit.activity_details_view.description_section_title": {
"comment": "ActivityDetailsView 'description' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Description"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Description"
}
}
}
},
"game_engine_kit.activity_details_view.instructions_section_title": {
"comment": "ActivityDetailsView 'instructions' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Instructions"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Instructions"
}
}
}
},
"game_engine_kit.activity_details_view.skills_section_title": {
"comment": "ActivityDetailsView 'skills' section title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Skills"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Comp\u00e9tences"
}
}
}
},
"game_engine_kit.choice_emoji_view.emoji_error": {
"comment": "ChoiceEmojiView emoji error ",
"extractionState": "extracted_with_value",
Expand Down

0 comments on commit 856b35b

Please sign in to comment.