From 93ae1a18c21cb603d7bfe1974074b3411a3090fa Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 9 Aug 2019 17:15:27 -0700 Subject: [PATCH] Making a few internationalization fixes. --- server/src/api/comment.rs | 2 +- ui/src/components/navbar.tsx | 3 +-- ui/src/components/post-form.tsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/api/comment.rs b/server/src/api/comment.rs index 19752d833..3d18c72a7 100644 --- a/server/src/api/comment.rs +++ b/server/src/api/comment.rs @@ -101,7 +101,7 @@ impl Perform for Oper { let _inserted_like = match CommentLike::like(&conn, &like_form) { Ok(like) => like, Err(_e) => { - return Err(APIError::err(&self.op, ""))? + return Err(APIError::err(&self.op, "couldnt_like_comment"))? } }; diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 5738483db..7a173bed7 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -155,8 +155,7 @@ export class Navbar extends Component { parseMessage(msg: any) { let op: UserOperation = msgOp(msg); if (msg.error) { - // TODO - if (msg.error == "Not logged in.") { + if (msg.error == "not_logged_in") { UserService.Instance.logout(); location.reload(); } diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 8aa7a5eaa..79d37b426 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -131,7 +131,7 @@ export class PostForm extends Component { + this.props.post ? capitalizeFirstLetter(i18n.t('save')) : capitalizeFirstLetter(i18n.t('create'))} {this.props.post && }