Mercurial > minori
annotate src/gui/translate/anime.cc @ 282:19eb6c4dca78
autotools: ax_have_qt sucks, use pkgconf instead
this is particularly useful because m4_ax_have_qt really
sucked when cross compiling because of qmake
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Wed, 08 May 2024 15:54:10 -0400 |
| parents | 657fda1b9cac |
| children | 53e3c015a973 |
| 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"; |
| 175 | 63 default: |
| 279 | 64 case Anime::Service::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) { | |
| 279 | 70 case Anime::TitleLanguage::Native: return "Native"; |
| 71 case Anime::TitleLanguage::English: return "English"; | |
| 175 | 72 default: |
| 279 | 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) { |
| 279 | 79 case Anime::ScoreFormat::Point3: return "3-point"; |
| 80 case Anime::ScoreFormat::Point5: return "5-point"; | |
| 81 case Anime::ScoreFormat::Point10: return "10-point"; | |
| 82 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
|
83 default: |
| 279 | 84 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
|
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 = { |
| 279 | 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 } | |
| 258 | 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()) |
| 279 | 98 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
|
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 = { |
| 279 | 104 {"Currently airing", Anime::SeriesStatus::Releasing }, |
| 105 {"Finished airing", Anime::SeriesStatus::Finished }, | |
| 106 {"Not yet aired", Anime::SeriesStatus::NotYetReleased}, | |
| 107 {"Cancelled", Anime::SeriesStatus::Cancelled }, | |
| 108 {"On hiatus", Anime::SeriesStatus::Hiatus } | |
| 258 | 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()) |
| 279 | 112 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
|
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 = { |
| 279 | 118 {"Winter", Anime::SeriesSeason::Winter}, |
| 119 {"Summer", Anime::SeriesSeason::Summer}, | |
| 120 {"Fall", Anime::SeriesSeason::Fall }, | |
| 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()) |
| 279 | 125 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
|
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 = { |
| 279 | 131 {"TV", Anime::SeriesFormat::Tv }, |
| 132 {"TV short", Anime::SeriesFormat::TvShort}, | |
| 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 } | |
| 258 | 138 }; |
| 175 | 139 |
| 140 if (map.find(str) == map.end()) | |
| 279 | 141 return Anime::SeriesFormat::Unknown; |
| 175 | 142 return map.at(str); |
| 143 } | |
| 144 | |
| 279 | 145 Anime::Service ToService(const std::string& str) { |
| 146 static const std::unordered_map<std::string, Anime::Service> map = { | |
| 147 {"AniList", Anime::Service::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()) |
| 279 | 151 return Anime::Service::None; |
|
90
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 = { |
| 279 | 157 {"Romaji", Anime::TitleLanguage::Romaji }, |
| 158 {"Native", Anime::TitleLanguage::Native }, | |
| 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()) |
| 279 | 163 return Anime::TitleLanguage::Romaji; |
|
90
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 = { |
| 279 | 169 {"3-point", Anime::ScoreFormat::Point3}, |
| 170 {"5-point", Anime::ScoreFormat::Point5}, | |
| 171 {"10-point", Anime::ScoreFormat::Point10 }, | |
| 172 {"10-point Decimal", Anime::ScoreFormat::Point10Decimal}, | |
| 173 {"100-point", Anime::ScoreFormat::Point100 }, | |
| 174 /* old values, provided for compatibility */ | |
| 175 {"POINT_3", Anime::ScoreFormat::Point3 }, | |
| 176 {"POINT_5", Anime::ScoreFormat::Point5 }, | |
| 177 {"POINT_10", Anime::ScoreFormat::Point10 }, | |
| 178 {"POINT_10_DECIMAL", Anime::ScoreFormat::Point10Decimal}, | |
| 179 {"POINT_100", Anime::ScoreFormat::Point100 } | |
| 258 | 180 }; |
|
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
181 |
|
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
182 if (map.find(str) == map.end()) |
| 279 | 183 return Anime::ScoreFormat::Point100; |
|
185
62e336597bb7
anime list: add support for different score formats
Paper <mrpapersonic@gmail.com>
parents:
175
diff
changeset
|
184 return map.at(str); |
|
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 |
|
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
187 /* 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
|
188 |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
189 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
|
190 switch (status) { |
| 279 | 191 case Anime::ListStatus::Current: return Strings::ToUtf8String(QCoreApplication::tr("Currently watching")); |
| 192 case Anime::ListStatus::Planning: return Strings::ToUtf8String(QCoreApplication::tr("Plan to watch")); | |
| 193 case Anime::ListStatus::Completed: return Strings::ToUtf8String(QCoreApplication::tr("Completed")); | |
| 194 case Anime::ListStatus::Dropped: return Strings::ToUtf8String(QCoreApplication::tr("Dropped")); | |
| 195 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
|
196 default: |
| 279 | 197 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
|
198 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
199 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
200 |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
201 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
|
202 switch (format) { |
| 279 | 203 case Anime::SeriesFormat::Tv: return Strings::ToUtf8String(QCoreApplication::tr("TV")); |
| 204 case Anime::SeriesFormat::TvShort: return Strings::ToUtf8String(QCoreApplication::tr("TV short")); | |
| 205 case Anime::SeriesFormat::Ova: return Strings::ToUtf8String(QCoreApplication::tr("OVA")); | |
| 206 case Anime::SeriesFormat::Movie: return Strings::ToUtf8String(QCoreApplication::tr("Movie")); | |
| 207 case Anime::SeriesFormat::Special: return Strings::ToUtf8String(QCoreApplication::tr("Special")); | |
| 208 case Anime::SeriesFormat::Ona: return Strings::ToUtf8String(QCoreApplication::tr("ONA")); | |
| 209 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
|
210 default: |
| 279 | 211 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
|
212 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
213 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
214 |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
215 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
|
216 switch (season) { |
| 279 | 217 case Anime::SeriesSeason::Winter: return Strings::ToUtf8String(QCoreApplication::tr("Winter")); |
| 218 case Anime::SeriesSeason::Summer: return Strings::ToUtf8String(QCoreApplication::tr("Summer")); | |
| 219 case Anime::SeriesSeason::Fall: return Strings::ToUtf8String(QCoreApplication::tr("Fall")); | |
| 220 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
|
221 default: |
| 279 | 222 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
|
223 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
224 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
225 |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
226 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
|
227 switch (status) { |
| 279 | 228 case Anime::SeriesStatus::Releasing: return Strings::ToUtf8String(QCoreApplication::tr("Currently airing")); |
| 229 case Anime::SeriesStatus::Finished: return Strings::ToUtf8String(QCoreApplication::tr("Finished airing")); | |
| 230 case Anime::SeriesStatus::NotYetReleased: return Strings::ToUtf8String(QCoreApplication::tr("Not yet aired")); | |
| 231 case Anime::SeriesStatus::Cancelled: return Strings::ToUtf8String(QCoreApplication::tr("Cancelled")); | |
| 232 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
|
233 default: |
| 279 | 234 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
|
235 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
236 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
237 |
| 279 | 238 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
|
239 switch (service) { |
| 279 | 240 case Anime::Service::AniList: return Strings::ToUtf8String(QCoreApplication::tr("AniList")); |
|
174
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
241 default: |
| 279 | 242 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
|
243 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
244 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
245 |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
246 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
|
247 switch (language) { |
| 279 | 248 case Anime::TitleLanguage::Native: return Strings::ToUtf8String(QCoreApplication::tr("Native")); |
| 249 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
|
250 default: |
| 279 | 251 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
|
252 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
253 } |
|
f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents:
90
diff
changeset
|
254 |
|
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
255 std::string ToLocalString(const Anime::ScoreFormat format) { |
|
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
256 switch (format) { |
| 279 | 257 case Anime::ScoreFormat::Point3: return Strings::ToUtf8String(QCoreApplication::tr("3-point")); |
| 258 case Anime::ScoreFormat::Point5: return Strings::ToUtf8String(QCoreApplication::tr("5-point")); | |
| 259 case Anime::ScoreFormat::Point10: return Strings::ToUtf8String(QCoreApplication::tr("10-point")); | |
| 260 case Anime::ScoreFormat::Point10Decimal: | |
| 261 return Strings::ToUtf8String(QCoreApplication::tr("10-point Decimal")); | |
|
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
262 default: |
| 279 | 263 case Anime::ScoreFormat::Point100: return Strings::ToUtf8String(QCoreApplication::tr("100-point")); |
|
187
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
264 } |
|
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
265 } |
|
9613d72b097e
*: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents:
185
diff
changeset
|
266 |
| 46 | 267 } // namespace Translate |
