Mercurial > minori
diff 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 |
line wrap: on
line diff
--- a/src/gui/translate/anime.cpp Mon Sep 25 13:50:56 2023 -0400 +++ b/src/gui/translate/anime.cpp Mon Sep 25 20:29:26 2023 -0400 @@ -1,53 +1,54 @@ #include "core/anime.h" #include "gui/translate/anime.h" +#include <QCoreApplication> namespace Translate { std::string ToString(const Anime::ListStatus status) { switch (status) { - case Anime::ListStatus::NOT_IN_LIST: return "Not in list"; - case Anime::ListStatus::CURRENT: return "Currently watching"; - case Anime::ListStatus::PLANNING: return "Plan to watch"; - case Anime::ListStatus::COMPLETED: return "Completed"; - case Anime::ListStatus::DROPPED: return "Dropped"; - case Anime::ListStatus::PAUSED: return "On hold"; + case Anime::ListStatus::NOT_IN_LIST: return QCoreApplication::tr("Not in list").toStdString(); + case Anime::ListStatus::CURRENT: return QCoreApplication::tr("Currently watching").toStdString(); + case Anime::ListStatus::PLANNING: return QCoreApplication::tr("Plan to watch").toStdString(); + case Anime::ListStatus::COMPLETED: return QCoreApplication::tr("Completed").toStdString(); + case Anime::ListStatus::DROPPED: return QCoreApplication::tr("Dropped").toStdString(); + case Anime::ListStatus::PAUSED: return QCoreApplication::tr("On hold").toStdString(); default: return ""; } } std::string ToString(const Anime::SeriesFormat format) { switch (format) { - case Anime::SeriesFormat::UNKNOWN: return "Unknown"; - case Anime::SeriesFormat::TV: return "TV"; - case Anime::SeriesFormat::TV_SHORT: return "TV short"; - case Anime::SeriesFormat::OVA: return "OVA"; - case Anime::SeriesFormat::MOVIE: return "Movie"; - case Anime::SeriesFormat::SPECIAL: return "Special"; - case Anime::SeriesFormat::ONA: return "ONA"; - case Anime::SeriesFormat::MUSIC: return "Music"; + case Anime::SeriesFormat::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); + case Anime::SeriesFormat::TV: return QCoreApplication::tr("TV").toStdString(); + case Anime::SeriesFormat::TV_SHORT: return QCoreApplication::tr("TV short").toStdString(); + case Anime::SeriesFormat::OVA: return QCoreApplication::tr("OVA").toStdString(); + case Anime::SeriesFormat::MOVIE: return QCoreApplication::tr("Movie").toStdString(); + case Anime::SeriesFormat::SPECIAL: return QCoreApplication::tr("Special").toStdString(); + case Anime::SeriesFormat::ONA: return QCoreApplication::tr("ONA").toStdString(); + case Anime::SeriesFormat::MUSIC: return QCoreApplication::tr("Music").toStdString(); default: return ""; } } std::string ToString(const Anime::SeriesSeason season) { switch (season) { - case Anime::SeriesSeason::UNKNOWN: return "Unknown"; - case Anime::SeriesSeason::WINTER: return "Winter"; - case Anime::SeriesSeason::SUMMER: return "Summer"; - case Anime::SeriesSeason::FALL: return "Fall"; - case Anime::SeriesSeason::SPRING: return "Spring"; + case Anime::SeriesSeason::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); + case Anime::SeriesSeason::WINTER: return QCoreApplication::tr("Winter").toStdString(); + case Anime::SeriesSeason::SUMMER: return QCoreApplication::tr("Summer").toStdString(); + case Anime::SeriesSeason::FALL: return QCoreApplication::tr("Fall").toStdString(); + case Anime::SeriesSeason::SPRING: return QCoreApplication::tr("Spring").toStdString(); default: return ""; } } std::string ToString(const Anime::SeriesStatus status) { switch (status) { - case Anime::SeriesStatus::UNKNOWN: return "Unknown"; - case Anime::SeriesStatus::RELEASING: return "Currently airing"; - case Anime::SeriesStatus::FINISHED: return "Finished airing"; - case Anime::SeriesStatus::NOT_YET_RELEASED: return "Not yet aired"; - case Anime::SeriesStatus::CANCELLED: return "Cancelled"; - case Anime::SeriesStatus::HIATUS: return "On hiatus"; + case Anime::SeriesStatus::UNKNOWN: return QCoreApplication::tr("Unknown").toStdString(); + case Anime::SeriesStatus::RELEASING: return QCoreApplication::tr("Currently airing").toStdString(); + case Anime::SeriesStatus::FINISHED: return QCoreApplication::tr("Finished airing").toStdString(); + case Anime::SeriesStatus::NOT_YET_RELEASED: return QCoreApplication::tr("Not yet aired").toStdString(); + case Anime::SeriesStatus::CANCELLED: return QCoreApplication::tr("Cancelled").toStdString(); + case Anime::SeriesStatus::HIATUS: return QCoreApplication::tr("On hiatus").toStdString(); default: return ""; } }