Mercurial > minori
annotate src/gui/translate/anime.cc @ 258:862d0d8619f6
*: HUUUGE changes
animia has been renamed to animone, so instead of thinking of a
health condition, you think of a beautiful flower :)
I've also edited some of the code for animone, but I have no idea
if it even works or not because I don't have a mac or windows
machine lying around. whoops!
... anyway, all of the changes divergent from Anisthesia are now
licensed under BSD. it's possible that I could even rewrite most
of the code to where I don't even have to keep the MIT license,
but that's thinking too far into the future
I've been slacking off on implementing the anime seasons page,
mostly out of laziness. I think I'd have to create another db file
specifically for the seasons
anyway, this code is being pushed *primarily* because the hard drive
it's on is failing! yay :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 01 Apr 2024 02:43:44 -0400 |
parents | 71832ffe425a |
children | 657fda1b9cac |
rev | line source |
---|---|
10 | 1 #include "core/anime.h" |
65
26721c28bf22
*: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
2 #include "core/strings.h" |
15 | 3 #include "gui/translate/anime.h" |
202 | 4 |
51 | 5 #include <QCoreApplication> |
10 | 6 |
202 | 7 #include <unordered_map> |
8 | |
10 | 9 namespace Translate { |
10 | |
15 | 11 std::string ToString(const Anime::ListStatus status) { |
10 | 12 switch (status) { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
13 case Anime::ListStatus::CURRENT: return "Currently watching"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
14 case Anime::ListStatus::PLANNING: return "Plan to watch"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
15 case Anime::ListStatus::COMPLETED: return "Completed"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
16 case Anime::ListStatus::DROPPED: return "Dropped"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
17 case Anime::ListStatus::PAUSED: return "On hold"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
18 default: |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
19 case Anime::ListStatus::NOT_IN_LIST: return "Not in list"; |
10 | 20 } |
21 } | |
22 | |
15 | 23 std::string ToString(const Anime::SeriesFormat format) { |
10 | 24 switch (format) { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
25 case Anime::SeriesFormat::TV: return "TV"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
26 case Anime::SeriesFormat::TV_SHORT: return "TV short"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
27 case Anime::SeriesFormat::OVA: return "OVA"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
28 case Anime::SeriesFormat::MOVIE: return "Movie"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
29 case Anime::SeriesFormat::SPECIAL: return "Special"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
30 case Anime::SeriesFormat::ONA: return "ONA"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
31 case Anime::SeriesFormat::MUSIC: return "Music"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
32 default: |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
33 case Anime::SeriesFormat::UNKNOWN: return "Unknown"; |
10 | 34 } |
35 } | |
36 | |
15 | 37 std::string ToString(const Anime::SeriesSeason season) { |
10 | 38 switch (season) { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
39 case Anime::SeriesSeason::WINTER: return "Winter"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
40 case Anime::SeriesSeason::SUMMER: return "Summer"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
41 case Anime::SeriesSeason::FALL: return "Fall"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
42 case Anime::SeriesSeason::SPRING: return "Spring"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
43 default: |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
44 case Anime::SeriesSeason::UNKNOWN: return "Unknown"; |
10 | 45 } |
46 } | |
47 | |
15 | 48 std::string ToString(const Anime::SeriesStatus status) { |
10 | 49 switch (status) { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
50 case Anime::SeriesStatus::RELEASING: return "Currently airing"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
51 case Anime::SeriesStatus::FINISHED: return "Finished airing"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
52 case Anime::SeriesStatus::NOT_YET_RELEASED: return "Not yet aired"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
53 case Anime::SeriesStatus::CANCELLED: return "Cancelled"; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
54 case Anime::SeriesStatus::HIATUS: return "On hiatus"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
55 default: |
175 | 56 case Anime::SeriesStatus::UNKNOWN: return "Unknown"; |
57 } | |
58 } | |
59 | |
60 std::string ToString(const Anime::Services service) { | |
61 switch (service) { | |
62 case Anime::Services::ANILIST: return "AniList"; | |
63 default: | |
258 | 64 case Anime::Services::NONE: return "None"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
65 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
66 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
67 |
175 | 68 std::string ToString(const Anime::TitleLanguage language) { |
69 switch (language) { | |
258 | 70 case Anime::TitleLanguage::NATIVE: return "Native"; |
175 | 71 case Anime::TitleLanguage::ENGLISH: return "English"; |
72 default: | |
258 | 73 case Anime::TitleLanguage::ROMAJI: return "Romaji"; |
175 | 74 } |
75 } | |
76 | |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
77 std::string ToString(const Anime::ScoreFormat format) { |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
78 switch (format) { |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
79 case Anime::ScoreFormat::POINT_3: return "POINT_3"; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
80 case Anime::ScoreFormat::POINT_5: return "POINT_5"; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
81 case Anime::ScoreFormat::POINT_10: return "POINT_10"; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
82 case Anime::ScoreFormat::POINT_10_DECIMAL: return "POINT_10_DECIMAL"; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
83 default: |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
84 case Anime::ScoreFormat::POINT_100: return "POINT_100"; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
85 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
86 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
87 |
175 | 88 Anime::ListStatus ToListStatus(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
89 static const std::unordered_map<std::string, Anime::ListStatus> map = { |
258 | 90 {"Currently watching", Anime::ListStatus::CURRENT }, |
91 {"Plan to watch", Anime::ListStatus::PLANNING }, | |
92 {"Completed", Anime::ListStatus::COMPLETED}, | |
93 {"Dropped", Anime::ListStatus::DROPPED }, | |
94 {"On hold", Anime::ListStatus::PAUSED } | |
95 }; | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
96 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
97 if (map.find(str) == map.end()) |
175 | 98 return Anime::ListStatus::NOT_IN_LIST; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
99 return map.at(str); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
100 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
101 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
102 Anime::SeriesStatus ToSeriesStatus(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
103 static const std::unordered_map<std::string, Anime::SeriesStatus> map = { |
258 | 104 {"Currently airing", Anime::SeriesStatus::RELEASING }, |
105 {"Finished airing", Anime::SeriesStatus::FINISHED }, | |
106 {"Not yet aired", Anime::SeriesStatus::NOT_YET_RELEASED}, | |
107 {"Cancelled", Anime::SeriesStatus::CANCELLED }, | |
108 {"On hiatus", Anime::SeriesStatus::HIATUS } | |
109 }; | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
110 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
111 if (map.find(str) == map.end()) |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
112 return Anime::SeriesStatus::UNKNOWN; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
113 return map.at(str); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
114 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
115 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
116 Anime::SeriesSeason ToSeriesSeason(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
117 static const std::unordered_map<std::string, Anime::SeriesSeason> map = { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
118 {"Winter", Anime::SeriesSeason::WINTER}, |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
119 {"Summer", Anime::SeriesSeason::SUMMER}, |
258 | 120 {"Fall", Anime::SeriesSeason::FALL }, |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
121 {"Spring", Anime::SeriesSeason::SPRING} |
258 | 122 }; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
123 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
124 if (map.find(str) == map.end()) |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
125 return Anime::SeriesSeason::UNKNOWN; |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
126 return map.at(str); |
10 | 127 } |
128 | |
175 | 129 Anime::SeriesFormat ToSeriesFormat(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
130 static const std::unordered_map<std::string, Anime::SeriesFormat> map = { |
258 | 131 {"TV", Anime::SeriesFormat::TV }, |
132 {"TV short", Anime::SeriesFormat::TV_SHORT}, | |
133 {"OVA", Anime::SeriesFormat::OVA }, | |
134 {"Movie", Anime::SeriesFormat::MOVIE }, | |
135 {"Special", Anime::SeriesFormat::SPECIAL }, | |
136 {"ONA", Anime::SeriesFormat::ONA }, | |
137 {"Music", Anime::SeriesFormat::MUSIC } | |
138 }; | |
175 | 139 |
140 if (map.find(str) == map.end()) | |
141 return Anime::SeriesFormat::UNKNOWN; | |
142 return map.at(str); | |
143 } | |
144 | |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
145 Anime::Services ToService(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
146 static const std::unordered_map<std::string, Anime::Services> map = { |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
147 {"AniList", Anime::Services::ANILIST} |
258 | 148 }; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
149 |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
150 if (map.find(str) == map.end()) |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
151 return Anime::Services::NONE; |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
152 return map.at(str); |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
153 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
154 |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
155 Anime::TitleLanguage ToLanguage(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
156 static const std::unordered_map<std::string, Anime::TitleLanguage> map = { |
258 | 157 {"Romaji", Anime::TitleLanguage::ROMAJI }, |
158 {"Native", Anime::TitleLanguage::NATIVE }, | |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
159 {"English", Anime::TitleLanguage::ENGLISH} |
258 | 160 }; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
161 |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
162 if (map.find(str) == map.end()) |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
163 return Anime::TitleLanguage::ROMAJI; |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
164 return map.at(str); |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
165 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
166 |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
167 Anime::ScoreFormat ToScoreFormat(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
168 static const std::unordered_map<std::string, Anime::ScoreFormat> map = { |
258 | 169 {"POINT_3", Anime::ScoreFormat::POINT_3 }, |
170 {"POINT_5", Anime::ScoreFormat::POINT_5 }, | |
171 {"POINT_10", Anime::ScoreFormat::POINT_10 }, | |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
172 {"POINT_10_DECIMAL", Anime::ScoreFormat::POINT_10_DECIMAL}, |
258 | 173 {"POINT_100", Anime::ScoreFormat::POINT_100 } |
174 }; | |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
175 |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
176 if (map.find(str) == map.end()) |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
177 return Anime::ScoreFormat::POINT_100; |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
178 return map.at(str); |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
179 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
180 |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
181 /* Localized versions of ToString() functions. Meant for display to the user. */ |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
182 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
183 std::string ToLocalString(const Anime::ListStatus status) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
184 switch (status) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
185 case Anime::ListStatus::CURRENT: return Strings::ToUtf8String(QCoreApplication::tr("Currently watching")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
186 case Anime::ListStatus::PLANNING: return Strings::ToUtf8String(QCoreApplication::tr("Plan to watch")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
187 case Anime::ListStatus::COMPLETED: return Strings::ToUtf8String(QCoreApplication::tr("Completed")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
188 case Anime::ListStatus::DROPPED: return Strings::ToUtf8String(QCoreApplication::tr("Dropped")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
189 case Anime::ListStatus::PAUSED: return Strings::ToUtf8String(QCoreApplication::tr("On hold")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
190 default: |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
191 case Anime::ListStatus::NOT_IN_LIST: return Strings::ToUtf8String(QCoreApplication::tr("Not in list")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
192 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
193 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
194 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
195 std::string ToLocalString(const Anime::SeriesFormat format) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
196 switch (format) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
197 case Anime::SeriesFormat::TV: return Strings::ToUtf8String(QCoreApplication::tr("TV")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
198 case Anime::SeriesFormat::TV_SHORT: return Strings::ToUtf8String(QCoreApplication::tr("TV short")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
199 case Anime::SeriesFormat::OVA: return Strings::ToUtf8String(QCoreApplication::tr("OVA")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
200 case Anime::SeriesFormat::MOVIE: return Strings::ToUtf8String(QCoreApplication::tr("Movie")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
201 case Anime::SeriesFormat::SPECIAL: return Strings::ToUtf8String(QCoreApplication::tr("Special")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
202 case Anime::SeriesFormat::ONA: return Strings::ToUtf8String(QCoreApplication::tr("ONA")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
203 case Anime::SeriesFormat::MUSIC: return Strings::ToUtf8String(QCoreApplication::tr("Music")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
204 default: |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
205 case Anime::SeriesFormat::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
206 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
207 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
208 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
209 std::string ToLocalString(const Anime::SeriesSeason season) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
210 switch (season) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
211 case Anime::SeriesSeason::WINTER: return Strings::ToUtf8String(QCoreApplication::tr("Winter")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
212 case Anime::SeriesSeason::SUMMER: return Strings::ToUtf8String(QCoreApplication::tr("Summer")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
213 case Anime::SeriesSeason::FALL: return Strings::ToUtf8String(QCoreApplication::tr("Fall")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
214 case Anime::SeriesSeason::SPRING: return Strings::ToUtf8String(QCoreApplication::tr("Spring")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
215 default: |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
216 case Anime::SeriesSeason::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
217 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
218 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
219 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
220 std::string ToLocalString(const Anime::SeriesStatus status) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
221 switch (status) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
222 case Anime::SeriesStatus::RELEASING: return Strings::ToUtf8String(QCoreApplication::tr("Currently airing")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
223 case Anime::SeriesStatus::FINISHED: return Strings::ToUtf8String(QCoreApplication::tr("Finished airing")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
224 case Anime::SeriesStatus::NOT_YET_RELEASED: return Strings::ToUtf8String(QCoreApplication::tr("Not yet aired")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
225 case Anime::SeriesStatus::CANCELLED: return Strings::ToUtf8String(QCoreApplication::tr("Cancelled")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
226 case Anime::SeriesStatus::HIATUS: return Strings::ToUtf8String(QCoreApplication::tr("On hiatus")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
227 default: |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
228 case Anime::SeriesStatus::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
229 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
230 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
231 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
232 std::string ToLocalString(const Anime::Services service) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
233 switch (service) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
234 case Anime::Services::ANILIST: return Strings::ToUtf8String(QCoreApplication::tr("AniList")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
235 default: |
258 | 236 case Anime::Services::NONE: return Strings::ToUtf8String(QCoreApplication::tr("None")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
237 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
238 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
239 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
240 std::string ToLocalString(const Anime::TitleLanguage language) { |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
241 switch (language) { |
258 | 242 case Anime::TitleLanguage::NATIVE: return Strings::ToUtf8String(QCoreApplication::tr("Native")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
243 case Anime::TitleLanguage::ENGLISH: return Strings::ToUtf8String(QCoreApplication::tr("English")); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
244 default: |
258 | 245 case Anime::TitleLanguage::ROMAJI: return Strings::ToUtf8String(QCoreApplication::tr("Romaji")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
246 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
247 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
248 |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
249 std::string ToLocalString(const Anime::ScoreFormat format) { |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
250 switch (format) { |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
251 case Anime::ScoreFormat::POINT_3: return Strings::ToUtf8String(QCoreApplication::tr("3-point")); |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
252 case Anime::ScoreFormat::POINT_5: return Strings::ToUtf8String(QCoreApplication::tr("5-point")); |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
253 case Anime::ScoreFormat::POINT_10: return Strings::ToUtf8String(QCoreApplication::tr("10-point")); |
258 | 254 case Anime::ScoreFormat::POINT_10_DECIMAL: |
255 return Strings::ToUtf8String(QCoreApplication::tr("10-point (Decimal)")); | |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
256 default: |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
257 case Anime::ScoreFormat::POINT_100: return Strings::ToUtf8String(QCoreApplication::tr("100-point")); |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
258 } |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
259 } |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
260 |
46 | 261 } // namespace Translate |