Skip to content

Commit 3b24457

Browse files
committed
Add community image upload localization and update CreateExerciseView
1 parent 5146f78 commit 3b24457

5 files changed

Lines changed: 542 additions & 329 deletions

File tree

Modules/Core/Localization/L10n.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ enum L10n {
516516
static let communityCreateExerciseApply = tr("community.create.apply")
517517
static let communityCreateExercisePending = tr("community.create.pending")
518518
static let communityCreateLoginRequired = tr("community.create.login_required")
519+
static let communityCreateImageSection = tr("community.create.image_section")
520+
static let communityCreateSelectImage = tr("community.create.select_image")
521+
static let communityCreateImageSelected = tr("community.create.image_selected")
522+
static func communityCreateUploadError(_ error: String) -> String {
523+
fmt("community.create.upload_error", error)
524+
}
519525
static let communityExploreDescription = tr("community.explore.description")
520526
static let communityExploreNoExercisesDesc = tr("community.explore.no_exercises_desc")
521527
static let communityExploreRatingMock = tr("community.explore.rating_mock")

Modules/Features/Community/Views/CreateExerciseView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ struct CreateExerciseView: View {
7272
.frame(minHeight: 100)
7373
}
7474

75-
Section("Imagen del ejercicio") {
75+
Section(L10n.communityCreateImageSection) {
7676
PhotosPicker(
7777
selection: $selectedPhoto,
7878
matching: .images
7979
) {
80-
Label("Seleccionar imagen", systemImage: "photo")
80+
Label(L10n.communityCreateSelectImage, systemImage: "photo")
8181
}
8282

8383
if selectedImageData != nil {
84-
Text("Imagen seleccionada")
84+
Text(L10n.communityCreateImageSelected)
8585
.foregroundStyle(.green)
8686
}
8787
}
@@ -175,7 +175,7 @@ struct CreateExerciseView: View {
175175
} catch {
176176
await MainActor.run {
177177
isSubmitting = false
178-
errorMessage = "No se pudo subir la imagen: \(error.localizedDescription)"
178+
errorMessage = L10n.communityCreateUploadError(error.localizedDescription)
179179
}
180180
}
181181
}

0 commit comments

Comments
 (0)