]> Untitled Git - lemmy.git/commitdiff
Making a few internationalization fixes.
authorDessalines <tyhou13@gmx.com>
Sat, 10 Aug 2019 00:15:27 +0000 (17:15 -0700)
committerDessalines <tyhou13@gmx.com>
Sat, 10 Aug 2019 00:15:27 +0000 (17:15 -0700)
server/src/api/comment.rs
ui/src/components/navbar.tsx
ui/src/components/post-form.tsx

index 19752d833c3c9c3f373d4266248a75586a8fc6db..3d18c72a744fac0b543e24b114cc51425c064d53 100644 (file)
@@ -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"))?
       }
     };
 
index 5738483db4c6aec043dbaf0f5ba29446748bebfc..7a173bed74c06659c6af0f3a0a48308ebe9f0108 100644 (file)
@@ -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();
       }
index 8aa7a5eaa2de67937a689b97a28e300b3a889cc3..79d37b4266f8addda1a28b9e1d6e7e517c1d6294 100644 (file)
@@ -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>