#[macro_export]
macro_rules! trm {
    ($id:literal $(, $typ:ident = $param:expr)*) => {
        hurrycurry_protocol::Message::Translation {
            id: $id.to_owned(),
            params: vec![$($crate::trm_param!($typ, $param)),*]
        }
    };
}

#[macro_export]
macro_rules! trm_param {
    (s, $x:expr) => {
        hurrycurry_protocol::Message::Text($x)
    };
    (i, $x:expr) => {
        hurrycurry_protocol::Message::Item($x)
    };
    (t, $x:expr) => {
        hurrycurry_protocol::Message::Tile($x)
    };
    (m, $x:expr) => {
        $x
    };
}

#[macro_export]
macro_rules! tre {
    ($id:literal $(, $typ:ident = $param:expr)*) => {
        $crate::TrError::Tr {
            id: $id,
            params: vec![$($crate::tre_param!($typ, $param)),*]
        }
    };
}

#[macro_export]
macro_rules! tre_param {
    (s, $x:expr) => {
        hurrycurry_protocol::Message::Text($x)
    };
    (i, $x:expr) => {
        hurrycurry_protocol::Message::Item($x)
    };
    (t, $x:expr) => {
        hurrycurry_protocol::Message::Tile($x)
    };
    (m, $x:expr) => {
        $x
    };
}
