1 | //! Defines `Message` struct and its view traits. |
2 | |
3 | mod builder; |
4 | mod flags; |
5 | mod key; |
6 | mod view; |
7 | |
8 | pub use builder::MessageBuilder; |
9 | pub use flags::MessageFlags; |
10 | pub(crate) use key::MessageKey; |
11 | pub use view::{CatalogMessageMutView, MessageMutView, MessageView, SingularPluralMismatchError}; |
12 | |
13 | /// Represents a single message entry. |
14 | #[derive (Debug, Default)] |
15 | pub struct Message { |
16 | /// Developer comments of the message. |
17 | pub(crate) comments: String, |
18 | /// Source code location of the message. |
19 | pub(crate) source: String, |
20 | /// Flags of the message. |
21 | pub(crate) flags: MessageFlags, |
22 | /// `msgctxt` of the message. |
23 | pub(crate) msgctxt: String, |
24 | /// `msgid` of the message. |
25 | pub(crate) msgid: String, |
26 | /// `msgid_plural` of the plural message. |
27 | pub(crate) msgid_plural: String, |
28 | /// `msgstr` of the singular message. |
29 | pub(crate) msgstr: String, |
30 | /// vector of all plural forms of translation. |
31 | pub(crate) msgstr_plural: Vec<String>, |
32 | /// Whether the message is plural |
33 | pub(crate) is_plural: bool, |
34 | } |
35 | |