annotate src/gui/translate/anime.cc @ 174:f88eda79c60a

anime/db: add some more json functionality, still doesn't compile :/
author Paper <mrpapersonic@gmail.com>
date Wed, 29 Nov 2023 13:53:56 -0500
parents c4bb49c2f6eb
children 9b10175be389
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
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
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
3 #include "gui/translate/anime.h"
51
75c804f713b2 window: add about window,
Paper <mrpapersonic@gmail.com>
parents: 46
diff changeset
4 #include <QCoreApplication>
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
5
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
6 namespace Translate {
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
7
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
8 std::string ToString(const Anime::ListStatus status) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
9 switch (status) {
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
10 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
11 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
12 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
13 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
14 case Anime::ListStatus::PAUSED: return "On hold";
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
15 default:
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
16 case Anime::ListStatus::NOT_IN_LIST: return "Not in list";
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
17 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
18 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
19
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
20 std::string ToString(const Anime::SeriesFormat format) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
21 switch (format) {
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
22 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
23 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
24 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
25 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
26 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
27 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
28 case Anime::SeriesFormat::MUSIC: return "Music";
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
29 default:
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
30 case Anime::SeriesFormat::UNKNOWN: return "Unknown";
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
31 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
32 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
33
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
34 std::string ToString(const Anime::SeriesSeason season) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
35 switch (season) {
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
36 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
37 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
38 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
39 case Anime::SeriesSeason::SPRING: return "Spring";
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
40 default:
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
41 case Anime::SeriesSeason::UNKNOWN: return "Unknown";
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
42 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
43 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
44
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
45 std::string ToString(const Anime::SeriesStatus status) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
46 switch (status) {
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
47 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
48 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
49 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
50 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
51 case Anime::SeriesStatus::HIATUS: return "On hiatus";
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
52 default:
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
53 case Anime::SeriesStatus::UNKNOWN: "Unknown";
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
54 }
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
55 }
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
56
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
57 Anime::SeriesStatus ToListStatus(const std::string& str) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
58 const std::unordered_map<std::string, Anime::SeriesStatus> map = {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
59 {"Currently watching", Anime::SeriesSeason::CURRENT},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
60 {"Plan to watch", Anime::SeriesSeason::PLANNING},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
61 {"Completed", Anime::SeriesSeason::COMPLETED},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
62 {"Dropped", Anime::SeriesSeason::DROPPED},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
63 {"On hold", Anime::SeriesSeason::PAUSED}
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
64 };
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
65
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
66 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
67 return Anime::SeriesStatus::NOT_IN_LIST;
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
68 return map.at(str);
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
69 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
70
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
71 Anime::SeriesStatus ToSeriesStatus(const std::string& str) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
72 const std::unordered_map<std::string, Anime::SeriesStatus> map = {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
73 {"Currently airing", Anime::SeriesSeason::RELEASING},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
74 {"Finished airing", Anime::SeriesSeason::FINISHED},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
75 {"Not yet aired", Anime::SeriesSeason::NOT_YET_RELEASED},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
76 {"Cancelled", Anime::SeriesSeason::CANCELLED},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
77 {"On hiatus", Anime::SeriesSeason::HIATUS}
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
78 };
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
79
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
80 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
81 return Anime::SeriesStatus::UNKNOWN;
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
82 return map.at(str);
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
83 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
84
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
85 Anime::SeriesSeason ToSeriesSeason(const std::string& str) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
86 const std::unordered_map<std::string, Anime::SeriesSeason> map = {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
87 {"Winter", Anime::SeriesSeason::WINTER},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
88 {"Summer", Anime::SeriesSeason::SUMMER},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
89 {"Fall", Anime::SeriesSeason::FALL},
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
90 {"Spring", Anime::SeriesSeason::SPRING}
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
91 };
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
92
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
93 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
94 return Anime::SeriesSeason::UNKNOWN;
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
95 return map.at(str);
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
96 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
97
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
98 Anime::Services ToService(const std::string& str) {
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
99 const std::unordered_map<std::string, Anime::Services> map = {
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
100 {"AniList", Anime::Services::ANILIST}
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
101 };
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
102
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
103 if (map.find(str) == map.end())
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
104 return Anime::Services::NONE;
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
105 return map.at(str);
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
106 }
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
107
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
108 Anime::TitleLanguage ToLanguage(const std::string& str) {
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
109 const std::unordered_map<std::string, Anime::TitleLanguage> map = {
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
110 {"Romaji", Anime::TitleLanguage::ROMAJI},
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
111 {"Native", Anime::TitleLanguage::NATIVE},
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
112 {"English", Anime::TitleLanguage::ENGLISH}
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
113 };
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
114
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
115 if (map.find(str) == map.end())
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
116 return Anime::TitleLanguage::ROMAJI;
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
117 return map.at(str);
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
118 }
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
119
174
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
120 /* Localized versions of ToString() functions */
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
121
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
122 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
123 switch (status) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
124 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
125 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
126 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
127 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
128 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
129 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
130 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
131 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
132 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
133
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
134 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
135 switch (format) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
136 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
137 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
138 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
139 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
140 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
141 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
142 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
143 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
144 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
145 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
146 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
147
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
148 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
149 switch (season) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
150 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
151 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
152 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
153 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
154 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
155 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
156 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
157 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
158
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
159 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
160 switch (status) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
161 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
162 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
163 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
164 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
165 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
166 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
167 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
168 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
169 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
170
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
171 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
172 switch (service) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
173 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
174 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
175 case Anime::Services::NONE: return Strings::ToUtf8String(QCoreApplication::tr("None"));
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
176 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
177 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
178
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
179 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
180 switch (language) {
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
181 case Anime::TitleLanguage::NATIVE: return Strings::ToUtf8String(QCoreApplication::tr("Native"));
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
182 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
183 default:
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
184 case Anime::TitleLanguage::ROMAJI: return Strings::ToUtf8String(QCoreApplication::tr("Romaji"));
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
185 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
186 }
f88eda79c60a anime/db: add some more json functionality, still doesn't compile :/
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
187
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
188 } // namespace Translate