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                #[allow(deprecated)]
7                match self {
8                    $( Self::$enum_var => $text ),*
9                }
10            }
11        }
12    };
13}
14
15mod pubs;
16
17mod eng;
18mod rus;
19
20/// A language of message.
21#[derive(Copy, Clone, Debug, Default, PartialEq)]
22#[non_exhaustive]
23pub enum Lang {
24    #[default]
25    Eng,
26    Rus,
27}
28
29/// A message with localized methods.
30#[derive(Copy, Clone, Debug)]
31#[non_exhaustive]
32pub enum Msg {
33    HelpInput,
34    HelpOutput,
35    HelpRecursive,
36    HelpTags,
37    HelpZip,
38    HelpUnzip,
39    HelpOverwrite,
40    HelpExitOnError,
41    HelpJobs,
42    HelpLang,
43    HelpVersion,
44    HelpHelp,
45
46    GuiStart,
47    GuiLanguage,
48    GuiSelectToClean,
49    GuiDirectory,
50    GuiOr,
51    GuiFiles,
52    GuiSelectDirectoryToClean,
53    GuiSelectFilesToClean,
54    GuiSelectedToClean,
55    GuiErrorSelectToClean,
56    GuiSelectSaveDirectory,
57    GuiSelectedSaveDirectory,
58    GuiErrorSelectSaveDirectory,
59    GuiRemoveTags,
60    GuiTagsSet,
61    GuiMultithreading,
62    GuiRecursiveSearch,
63    GuiOverwrite,
64    GuiStopOnError,
65    GuiLog,
66
67    Error,
68    Warning,
69    Debug,
70    Trace,
71
72    CleaningBooks,
73    Cleaning,
74    SuccessfullyCleanedTo,
75
76    OverwritingBooks,
77    Overwriting,
78    SuccessfullyOverwritedFrom,
79    RemovingInputFile,
80    RemovingTempDirectory,
81    RemovingTempFile,
82
83    FileAlreadyExists,
84    #[deprecated]
85    FileIsAlreadyExists,
86    NotFoundAValidLangCode,
87    NotFoundAnyBookInDirectory,
88    NotFoundAnyFb2InArchive,
89    Skipping,
90    #[deprecated]
91    SuccessCleanedAndSavedTo,
92    #[deprecated]
93    SuccessOverwritedFrom,
94}