-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathTutorialChapter.swift
More file actions
33 lines (27 loc) · 1.12 KB
/
Copy pathTutorialChapter.swift
File metadata and controls
33 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: GPL-3.0-or-later
import Foundation
enum TutorialChapter: String, CaseIterable, Identifiable, Hashable {
case nounAnnotation
case wordTranslation
case verbConjugation
case nounPlurals
var id: String { rawValue }
var title: String {
switch self {
case .nounAnnotation:
return NSLocalizedString("i18n.app.tutorial.noun_annotation", value: "Noun annotation", comment: "")
case .wordTranslation:
return NSLocalizedString("i18n.app.tutorial.word_translation", value: "Word translation", comment: "")
case .verbConjugation:
return NSLocalizedString("i18n.app.tutorial.verb_conjugation", value: "Verb conjugation", comment: "")
case .nounPlurals:
return NSLocalizedString("i18n.app.tutorial.noun_plurals", value: "Noun plurals", comment: "")
}
}
var isLast: Bool { self == .nounPlurals }
func next() -> TutorialChapter? {
let all = TutorialChapter.allCases
guard let idx = all.firstIndex(of: self), idx + 1 < all.count else { return nil }
return all[idx + 1]
}
}