1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Global macros for the AtlantisOS project.
//!
//! This module contains useful macros that simplify complex function calls
//! and improve code readability throughout the project.
/// Macro for easily translating strings.
///
/// This macro wraps the call to `dgettext`. It automatically uses the
/// text domain currently specified in the language settings. This eliminates the need
/// to manually pass the domain for each individual string.
///
/// # How it works
/// The macro calls `get_current_domain()` and passes this, along with the
/// message, to the `gettextrs` library.
///
/// # Arguments
/// * `$msgid` - The string to be translated (string literal).
///
/// # Return Value
/// The translated string as a `String`. If no translation is found,
/// the original string is returned.
///
/// # Usage:
///
/// ```rust
/// use crate::gettext;
///
/// fn main() {
/// let message = gettext!("Welcome to AtlantisOS");
/// println!("{}", message);
/// }
/// ```