Update rocket_i18n and add gettext_macros (#431)

Internationalization now uses proc-macros that generate the .pot file
automatically.
This commit is contained in:
Baptiste Gelez
2019-02-02 15:23:50 +01:00
committed by GitHub
parent 8696185d1e
commit 7eef4643c8
57 changed files with 6306 additions and 5484 deletions
-11
View File
@@ -78,17 +78,6 @@ impl Notification {
.map_err(Error::from)
}
pub fn get_message(&self) -> &'static str {
match self.kind.as_ref() {
notification_kind::COMMENT => "{0} commented your article.",
notification_kind::FOLLOW => "{0} is now following you.",
notification_kind::LIKE => "{0} liked your article.",
notification_kind::MENTION => "{0} mentioned you.",
notification_kind::RESHARE => "{0} boosted your article.",
_ => unreachable!("Notification::get_message: Unknow type"),
}
}
pub fn get_url(&self, conn: &Connection) -> Option<String> {
match self.kind.as_ref() {
notification_kind::COMMENT => self.get_post(conn).and_then(|p| Some(format!("{}#comment-{}", p.url(conn).ok()?, self.object_id))),