Mercurial > minori
comparison src/gui/translate/anime.cpp @ 51:75c804f713b2
window: add about window,
*: use tr() when applicable (useful for i18n)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 25 Sep 2023 20:29:26 -0400 |
parents | d0adc4aedfc8 |
children | 26721c28bf22 |
comparison
equal
deleted
inserted
replaced
50:10868c3fb2be | 51:75c804f713b2 |
---|---|
1 #include "core/anime.h" | 1 #include "core/anime.h" |
2 #include "gui/translate/anime.h" | 2 #include "gui/translate/anime.h" |
3 #include <QCoreApplication> | |
3 | 4 |
4 namespace Translate { | 5 namespace Translate { |
5 | 6 |
6 std::string ToString(const Anime::ListStatus status) { | 7 std::string ToString(const Anime::ListStatus status) { |
7 switch (status) { | 8 switch (status) { |
8 case Anime::ListStatus::NOT_IN_LIST: return "Not in list"; | 9 case Anime::ListStatus::NOT_IN_LIST: return QCoreApplication::tr("Not in list").toStdString(); |
9 case Anime::ListStatus::CURRENT: return "Currently watching"; | 10 case Anime::ListStatus::CURRENT: return QCoreApplication::tr("Currently watching").toStdString(); |
10 case Anime::ListStatus::PLANNING: return "Plan to watch"; | 11 case Anime::ListStatus::PLANNING: return QCoreApplication::tr("Plan to watch").toStdString(); |
11 case Anime::ListStatus::COMPLETED: return "Completed"; | 12 case Anime::ListStatus::COMPLETED: return QCoreApplication::tr("Completed").toStdString(); |
12 case Anime::ListStatus::DROPPED: return "Dropped"; | 13 case Anime::ListStatus::DROPPED: return QCoreApplication::tr("Dropped").toStdString(); |
13 case Anime::ListStatus::PAUSED: return "On hold"; | 14 case Anime::ListStatus::PAUSED: return QCoreApplication::tr("On hold").toStdString(); |
14 default: return ""; | 15 default: return ""; |
15 } | 16 } |
16 } | 17 } |
17 | 18 |
18 std::string ToString(const Anime::SeriesFormat format) { | 19 std::string ToString(const Anime::SeriesFormat format) { |
19 switch (format) { | 20 switch (format) { |
20 case Anime::SeriesFormat::UNKNOWN: return "Unknown"; | 21 case Anime::SeriesFormat::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); |
21 case Anime::SeriesFormat::TV: return "TV"; | 22 case Anime::SeriesFormat::TV: return QCoreApplication::tr("TV").toStdString(); |
22 case Anime::SeriesFormat::TV_SHORT: return "TV short"; | 23 case Anime::SeriesFormat::TV_SHORT: return QCoreApplication::tr("TV short").toStdString(); |
23 case Anime::SeriesFormat::OVA: return "OVA"; | 24 case Anime::SeriesFormat::OVA: return QCoreApplication::tr("OVA").toStdString(); |
24 case Anime::SeriesFormat::MOVIE: return "Movie"; | 25 case Anime::SeriesFormat::MOVIE: return QCoreApplication::tr("Movie").toStdString(); |
25 case Anime::SeriesFormat::SPECIAL: return "Special"; | 26 case Anime::SeriesFormat::SPECIAL: return QCoreApplication::tr("Special").toStdString(); |
26 case Anime::SeriesFormat::ONA: return "ONA"; | 27 case Anime::SeriesFormat::ONA: return QCoreApplication::tr("ONA").toStdString(); |
27 case Anime::SeriesFormat::MUSIC: return "Music"; | 28 case Anime::SeriesFormat::MUSIC: return QCoreApplication::tr("Music").toStdString(); |
28 default: return ""; | 29 default: return ""; |
29 } | 30 } |
30 } | 31 } |
31 | 32 |
32 std::string ToString(const Anime::SeriesSeason season) { | 33 std::string ToString(const Anime::SeriesSeason season) { |
33 switch (season) { | 34 switch (season) { |
34 case Anime::SeriesSeason::UNKNOWN: return "Unknown"; | 35 case Anime::SeriesSeason::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); |
35 case Anime::SeriesSeason::WINTER: return "Winter"; | 36 case Anime::SeriesSeason::WINTER: return QCoreApplication::tr("Winter").toStdString(); |
36 case Anime::SeriesSeason::SUMMER: return "Summer"; | 37 case Anime::SeriesSeason::SUMMER: return QCoreApplication::tr("Summer").toStdString(); |
37 case Anime::SeriesSeason::FALL: return "Fall"; | 38 case Anime::SeriesSeason::FALL: return QCoreApplication::tr("Fall").toStdString(); |
38 case Anime::SeriesSeason::SPRING: return "Spring"; | 39 case Anime::SeriesSeason::SPRING: return QCoreApplication::tr("Spring").toStdString(); |
39 default: return ""; | 40 default: return ""; |
40 } | 41 } |
41 } | 42 } |
42 | 43 |
43 std::string ToString(const Anime::SeriesStatus status) { | 44 std::string ToString(const Anime::SeriesStatus status) { |
44 switch (status) { | 45 switch (status) { |
45 case Anime::SeriesStatus::UNKNOWN: return "Unknown"; | 46 case Anime::SeriesStatus::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); |
46 case Anime::SeriesStatus::RELEASING: return "Currently airing"; | 47 case Anime::SeriesStatus::RELEASING: return QCoreApplication::tr("Currently airing").toStdString(); |
47 case Anime::SeriesStatus::FINISHED: return "Finished airing"; | 48 case Anime::SeriesStatus::FINISHED: return QCoreApplication::tr("Finished airing").toStdString(); |
48 case Anime::SeriesStatus::NOT_YET_RELEASED: return "Not yet aired"; | 49 case Anime::SeriesStatus::NOT_YET_RELEASED: return QCoreApplication::tr("Not yet aired").toStdString(); |
49 case Anime::SeriesStatus::CANCELLED: return "Cancelled"; | 50 case Anime::SeriesStatus::CANCELLED: return QCoreApplication::tr("Cancelled").toStdString(); |
50 case Anime::SeriesStatus::HIATUS: return "On hiatus"; | 51 case Anime::SeriesStatus::HIATUS: return QCoreApplication::tr("On hiatus").toStdString(); |
51 default: return ""; | 52 default: return ""; |
52 } | 53 } |
53 } | 54 } |
54 | 55 |
55 } // namespace Translate | 56 } // namespace Translate |