Mercurial > minori
annotate src/gui/translate/anime.cc @ 286:53e3c015a973
anime: initial cross-service support
currently the Kitsu and MAL services don't work when chosen in the
GUI. This is because they haven't been implemented yet :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 08 May 2024 16:44:27 -0400 |
parents | 657fda1b9cac |
children | c32467cd06bb |
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) { |
279 | 13 case Anime::ListStatus::Current: return "Currently watching"; |
14 case Anime::ListStatus::Planning: return "Plan to watch"; | |
15 case Anime::ListStatus::Completed: return "Completed"; | |
16 case Anime::ListStatus::Dropped: return "Dropped"; | |
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: |
279 | 19 case Anime::ListStatus::NotInList: return "Not in list"; |
10 | 20 } |
21 } | |
22 | |
15 | 23 std::string ToString(const Anime::SeriesFormat format) { |
10 | 24 switch (format) { |
279 | 25 case Anime::SeriesFormat::Tv: return "TV"; |
26 case Anime::SeriesFormat::TvShort: return "TV short"; | |
27 case Anime::SeriesFormat::Ova: return "OVA"; | |
28 case Anime::SeriesFormat::Movie: return "Movie"; | |
29 case Anime::SeriesFormat::Special: return "Special"; | |
30 case Anime::SeriesFormat::Ona: return "ONA"; | |
31 case Anime::SeriesFormat::Music: return "Music"; | |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
32 default: |
279 | 33 case Anime::SeriesFormat::Unknown: return "Unknown"; |
10 | 34 } |
35 } | |
36 | |
15 | 37 std::string ToString(const Anime::SeriesSeason season) { |
10 | 38 switch (season) { |
279 | 39 case Anime::SeriesSeason::Winter: return "Winter"; |
40 case Anime::SeriesSeason::Summer: return "Summer"; | |
41 case Anime::SeriesSeason::Fall: return "Fall"; | |
42 case Anime::SeriesSeason::Spring: return "Spring"; | |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
43 default: |
279 | 44 case Anime::SeriesSeason::Unknown: return "Unknown"; |
10 | 45 } |
46 } | |
47 | |
15 | 48 std::string ToString(const Anime::SeriesStatus status) { |
10 | 49 switch (status) { |
279 | 50 case Anime::SeriesStatus::Releasing: return "Currently airing"; |
51 case Anime::SeriesStatus::Finished: return "Finished airing"; | |
52 case Anime::SeriesStatus::NotYetReleased: return "Not yet aired"; | |
53 case Anime::SeriesStatus::Cancelled: return "Cancelled"; | |
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: |
279 | 56 case Anime::SeriesStatus::Unknown: return "Unknown"; |
175 | 57 } |
58 } | |
59 | |
279 | 60 std::string ToString(const Anime::Service service) { |
175 | 61 switch (service) { |
279 | 62 case Anime::Service::AniList: return "AniList"; |
286
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
63 case Anime::Service::MyAnimeList: return "MyAnimeList"; |
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
64 case Anime::Service::Kitsu: return "Kitsu"; |
175 | 65 default: |
279 | 66 case Anime::Service::None: return "None"; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
67 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
68 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
69 |
175 | 70 std::string ToString(const Anime::TitleLanguage language) { |
71 switch (language) { | |
279 | 72 case Anime::TitleLanguage::Native: return "Native"; |
73 case Anime::TitleLanguage::English: return "English"; | |
175 | 74 default: |
279 | 75 case Anime::TitleLanguage::Romaji: return "Romaji"; |
175 | 76 } |
77 } | |
78 | |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
79 std::string ToString(const Anime::ScoreFormat format) { |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
80 switch (format) { |
279 | 81 case Anime::ScoreFormat::Point3: return "3-point"; |
82 case Anime::ScoreFormat::Point5: return "5-point"; | |
83 case Anime::ScoreFormat::Point10: return "10-point"; | |
84 case Anime::ScoreFormat::Point10Decimal: return "10-point Decimal"; | |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
85 default: |
279 | 86 case Anime::ScoreFormat::Point100: return "100-point"; |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
87 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
88 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
89 |
175 | 90 Anime::ListStatus ToListStatus(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
91 static const std::unordered_map<std::string, Anime::ListStatus> map = { |
279 | 92 {"Currently watching", Anime::ListStatus::Current }, |
93 {"Plan to watch", Anime::ListStatus::Planning }, | |
94 {"Completed", Anime::ListStatus::Completed}, | |
95 {"Dropped", Anime::ListStatus::Dropped }, | |
96 {"On hold", Anime::ListStatus::Paused } | |
258 | 97 }; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
98 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
99 if (map.find(str) == map.end()) |
279 | 100 return Anime::ListStatus::NotInList; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
101 return map.at(str); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
102 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
103 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
104 Anime::SeriesStatus ToSeriesStatus(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
105 static const std::unordered_map<std::string, Anime::SeriesStatus> map = { |
279 | 106 {"Currently airing", Anime::SeriesStatus::Releasing }, |
107 {"Finished airing", Anime::SeriesStatus::Finished }, | |
108 {"Not yet aired", Anime::SeriesStatus::NotYetReleased}, | |
109 {"Cancelled", Anime::SeriesStatus::Cancelled }, | |
110 {"On hiatus", Anime::SeriesStatus::Hiatus } | |
258 | 111 }; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
112 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
113 if (map.find(str) == map.end()) |
279 | 114 return Anime::SeriesStatus::Unknown; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
115 return map.at(str); |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
116 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
117 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
118 Anime::SeriesSeason ToSeriesSeason(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
119 static const std::unordered_map<std::string, Anime::SeriesSeason> map = { |
279 | 120 {"Winter", Anime::SeriesSeason::Winter}, |
121 {"Summer", Anime::SeriesSeason::Summer}, | |
122 {"Fall", Anime::SeriesSeason::Fall }, | |
123 {"Spring", Anime::SeriesSeason::Spring} | |
258 | 124 }; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
125 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
126 if (map.find(str) == map.end()) |
279 | 127 return Anime::SeriesSeason::Unknown; |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
128 return map.at(str); |
10 | 129 } |
130 | |
175 | 131 Anime::SeriesFormat ToSeriesFormat(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
132 static const std::unordered_map<std::string, Anime::SeriesFormat> map = { |
279 | 133 {"TV", Anime::SeriesFormat::Tv }, |
134 {"TV short", Anime::SeriesFormat::TvShort}, | |
135 {"OVA", Anime::SeriesFormat::Ova }, | |
136 {"Movie", Anime::SeriesFormat::Movie }, | |
137 {"Special", Anime::SeriesFormat::Special }, | |
138 {"ONA", Anime::SeriesFormat::Ona }, | |
139 {"Music", Anime::SeriesFormat::Music } | |
258 | 140 }; |
175 | 141 |
142 if (map.find(str) == map.end()) | |
279 | 143 return Anime::SeriesFormat::Unknown; |
175 | 144 return map.at(str); |
145 } | |
146 | |
279 | 147 Anime::Service ToService(const std::string& str) { |
148 static const std::unordered_map<std::string, Anime::Service> map = { | |
286
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
149 {"AniList", Anime::Service::AniList}, |
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
150 {"MyAnimeList", Anime::Service::MyAnimeList}, |
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
151 {"Kitsu", Anime::Service::Kitsu} |
258 | 152 }; |
90
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 if (map.find(str) == map.end()) |
279 | 155 return Anime::Service::None; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
156 return map.at(str); |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
157 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
158 |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
159 Anime::TitleLanguage ToLanguage(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
160 static const std::unordered_map<std::string, Anime::TitleLanguage> map = { |
279 | 161 {"Romaji", Anime::TitleLanguage::Romaji }, |
162 {"Native", Anime::TitleLanguage::Native }, | |
163 {"English", Anime::TitleLanguage::English} | |
258 | 164 }; |
90
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 if (map.find(str) == map.end()) |
279 | 167 return Anime::TitleLanguage::Romaji; |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
168 return map.at(str); |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
169 } |
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
170 |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
171 Anime::ScoreFormat ToScoreFormat(const std::string& str) { |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
172 static const std::unordered_map<std::string, Anime::ScoreFormat> map = { |
279 | 173 {"3-point", Anime::ScoreFormat::Point3}, |
174 {"5-point", Anime::ScoreFormat::Point5}, | |
175 {"10-point", Anime::ScoreFormat::Point10 }, | |
176 {"10-point Decimal", Anime::ScoreFormat::Point10Decimal}, | |
177 {"100-point", Anime::ScoreFormat::Point100 }, | |
178 /* old values, provided for compatibility */ | |
179 {"POINT_3", Anime::ScoreFormat::Point3 }, | |
180 {"POINT_5", Anime::ScoreFormat::Point5 }, | |
181 {"POINT_10", Anime::ScoreFormat::Point10 }, | |
182 {"POINT_10_DECIMAL", Anime::ScoreFormat::Point10Decimal}, | |
183 {"POINT_100", Anime::ScoreFormat::Point100 } | |
258 | 184 }; |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
185 |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
186 if (map.find(str) == map.end()) |
279 | 187 return Anime::ScoreFormat::Point100; |
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
188 return map.at(str); |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
189 } |
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
190 |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
191 /* 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
|
192 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
193 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
|
194 switch (status) { |
279 | 195 case Anime::ListStatus::Current: return Strings::ToUtf8String(QCoreApplication::tr("Currently watching")); |
196 case Anime::ListStatus::Planning: return Strings::ToUtf8String(QCoreApplication::tr("Plan to watch")); | |
197 case Anime::ListStatus::Completed: return Strings::ToUtf8String(QCoreApplication::tr("Completed")); | |
198 case Anime::ListStatus::Dropped: return Strings::ToUtf8String(QCoreApplication::tr("Dropped")); | |
199 case Anime::ListStatus::Paused: return Strings::ToUtf8String(QCoreApplication::tr("On hold")); | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
200 default: |
279 | 201 case Anime::ListStatus::NotInList: return Strings::ToUtf8String(QCoreApplication::tr("Not in list")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
202 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
203 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
204 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
205 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
|
206 switch (format) { |
279 | 207 case Anime::SeriesFormat::Tv: return Strings::ToUtf8String(QCoreApplication::tr("TV")); |
208 case Anime::SeriesFormat::TvShort: return Strings::ToUtf8String(QCoreApplication::tr("TV short")); | |
209 case Anime::SeriesFormat::Ova: return Strings::ToUtf8String(QCoreApplication::tr("OVA")); | |
210 case Anime::SeriesFormat::Movie: return Strings::ToUtf8String(QCoreApplication::tr("Movie")); | |
211 case Anime::SeriesFormat::Special: return Strings::ToUtf8String(QCoreApplication::tr("Special")); | |
212 case Anime::SeriesFormat::Ona: return Strings::ToUtf8String(QCoreApplication::tr("ONA")); | |
213 case Anime::SeriesFormat::Music: return Strings::ToUtf8String(QCoreApplication::tr("Music")); | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
214 default: |
279 | 215 case Anime::SeriesFormat::Unknown: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
216 } |
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 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
|
220 switch (season) { |
279 | 221 case Anime::SeriesSeason::Winter: return Strings::ToUtf8String(QCoreApplication::tr("Winter")); |
222 case Anime::SeriesSeason::Summer: return Strings::ToUtf8String(QCoreApplication::tr("Summer")); | |
223 case Anime::SeriesSeason::Fall: return Strings::ToUtf8String(QCoreApplication::tr("Fall")); | |
224 case Anime::SeriesSeason::Spring: return Strings::ToUtf8String(QCoreApplication::tr("Spring")); | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
225 default: |
279 | 226 case Anime::SeriesSeason::Unknown: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
227 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
228 } |
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 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
|
231 switch (status) { |
279 | 232 case Anime::SeriesStatus::Releasing: return Strings::ToUtf8String(QCoreApplication::tr("Currently airing")); |
233 case Anime::SeriesStatus::Finished: return Strings::ToUtf8String(QCoreApplication::tr("Finished airing")); | |
234 case Anime::SeriesStatus::NotYetReleased: return Strings::ToUtf8String(QCoreApplication::tr("Not yet aired")); | |
235 case Anime::SeriesStatus::Cancelled: return Strings::ToUtf8String(QCoreApplication::tr("Cancelled")); | |
236 case Anime::SeriesStatus::Hiatus: return Strings::ToUtf8String(QCoreApplication::tr("On hiatus")); | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
237 default: |
279 | 238 case Anime::SeriesStatus::Unknown: return Strings::ToUtf8String(QCoreApplication::tr("Unknown")); |
174
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 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
241 |
279 | 242 std::string ToLocalString(const Anime::Service service) { |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
243 switch (service) { |
279 | 244 case Anime::Service::AniList: return Strings::ToUtf8String(QCoreApplication::tr("AniList")); |
286
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
245 case Anime::Service::MyAnimeList: return Strings::ToUtf8String(QCoreApplication::tr("MyAnimeList")); |
53e3c015a973
anime: initial cross-service support
Paper <paper@paper.us.eu.org>
parents:
279
diff
changeset
|
246 case Anime::Service::Kitsu: return Strings::ToUtf8String(QCoreApplication::tr("Kitsu")); |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
247 default: |
279 | 248 case Anime::Service::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
|
249 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
250 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
251 |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
252 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
|
253 switch (language) { |
279 | 254 case Anime::TitleLanguage::Native: return Strings::ToUtf8String(QCoreApplication::tr("Native")); |
255 case Anime::TitleLanguage::English: return Strings::ToUtf8String(QCoreApplication::tr("English")); | |
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
256 default: |
279 | 257 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
|
258 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
259 } |
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
260 |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
261 std::string ToLocalString(const Anime::ScoreFormat format) { |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
262 switch (format) { |
279 | 263 case Anime::ScoreFormat::Point3: return Strings::ToUtf8String(QCoreApplication::tr("3-point")); |
264 case Anime::ScoreFormat::Point5: return Strings::ToUtf8String(QCoreApplication::tr("5-point")); | |
265 case Anime::ScoreFormat::Point10: return Strings::ToUtf8String(QCoreApplication::tr("10-point")); | |
266 case Anime::ScoreFormat::Point10Decimal: | |
267 return Strings::ToUtf8String(QCoreApplication::tr("10-point Decimal")); | |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
268 default: |
279 | 269 case Anime::ScoreFormat::Point100: return Strings::ToUtf8String(QCoreApplication::tr("100-point")); |
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
270 } |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
271 } |
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
272 |
46 | 273 } // namespace Translate |