summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <happydooby@gmail.com>2019-08-09 17:15:27 -0700
committerDessalines <happydooby@gmail.com>2019-08-09 17:15:27 -0700
commitac5d1f5b32004cba6f292089fc7a64c2acdbbdda (patch)
tree0551b2364c6fb4b073c348b32e483e590ea51cc1
parentd6ca5af85a5c489ff39fb9a23fa3b8779e92ecb5 (diff)
Making a few internationalization fixes.
-rw-r--r--server/src/api/comment.rs2
-rw-r--r--ui/src/components/navbar.tsx3
-rw-r--r--ui/src/components/post-form.tsx2
3 files changed, 3 insertions, 4 deletions
diff --git a/server/src/api/comment.rs b/server/src/api/comment.rs
index 19752d83..3d18c72a 100644
--- a/server/src/api/comment.rs
+++ b/server/src/api/comment.rs
@@ -101,7 +101,7 @@ impl Perform<CommentResponse> for Oper<CreateComment> {
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 5738483d..7a173bed 100644
--- a/ui/src/components/navbar.tsx
+++ b/ui/src/components/navbar.tsx
@@ -155,8 +155,7 @@ export class Navbar extends Component<any, NavbarState> {
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 8aa7a5ea..79d37b42 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -131,7 +131,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
<button type="submit" class="btn btn-secondary mr-2">
{this.state.loading ?
<svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg> :
- this.props.post ? capitalizeFirstLetter(i18n.t('save')) : capitalizeFirstLetter(i18n.t('Create'))}</button>
+ this.props.post ? capitalizeFirstLetter(i18n.t('save')) : capitalizeFirstLetter(i18n.t('create'))}</button>
{this.props.post && <button type="button" class="btn btn-secondary" onClick={linkEvent(this, this.handleCancel)}><T i18nKey="cancel">#</T></button>}
</div>
</div>