Skip to main content

fb2_clean/
i18n.rs

1macro_rules! impl_msg_as_str {
2    ($fn:ident, $( $enum_var:ident => $text:expr ),* $(,)?) => {
3        impl $crate::Msg {
4            #[inline(always)]
5            pub(in crate::i18n) fn $fn(self) -> &'static str {
6                match self {
7                    $( Self::$enum_var => $text ),*
8                }
9            }
10        }
11    };
12}
13
14mod pubs;
15
16mod eng;
17mod rus;
18
19/// A language of message.
20#[derive(Copy, Clone, Debug, Default, PartialEq)]
21#[non_exhaustive]
22pub enum Lang {
23    #[default]
24    Eng,
25    Rus,
26}
27
28/// A message with localized methods.
29#[derive(Copy, Clone, Debug)]
30#[non_exhaustive]
31pub enum Msg {
32    Cleaning,
33    CleaningBooks,
34    FileIsAlreadyExists,
35    NotFoundAValidLangCode,
36    NotFoundAnyBookInDirectory,
37    NotFoundAnyFb2InArchive,
38    Overwriting,
39    OverwritingBooks,
40    RemovingInputFile,
41    RemovingTempDirectory,
42    RemovingTempFile,
43    Skipping,
44    SuccessCleanedAndSavedTo,
45    SuccessOverwritedFrom,
46    Error,
47    Warning,
48    Debug,
49    Trace,
50    GuiStart,
51    GuiLanguage,
52    GuiSelectToClean,
53    GuiDirectory,
54    GuiOr,
55    GuiFiles,
56    GuiSelectDirectoryToClean,
57    GuiSelectFilesToClean,
58    GuiSelectedToClean,
59    GuiErrorSelectToClean,
60    GuiSelectSaveDirectory,
61    GuiSelectedSaveDirectory,
62    GuiErrorSelectSaveDirectory,
63    GuiRemoveTags,
64    GuiTagsSet,
65    GuiMultithreading,
66    GuiRecursiveSearch,
67    GuiOverwrite,
68    GuiStopOnError,
69    GuiLog,
70    HelpInput,
71    HelpOutput,
72    HelpRecursive,
73    HelpTags,
74    HelpZip,
75    HelpUnzip,
76    HelpOverwrite,
77    HelpExitOnError,
78    HelpJobs,
79    HelpLang,
80    HelpVersion,
81    HelpHelp,
82}