Browse Source

fix:修正跟读的双语

adam 4 years ago
parent
commit
dec1b6fd70

+ 1
- 1
lib/components/AudioPlayer/index.js.map
File diff suppressed because it is too large
View File


+ 3
- 1
lib/components/ContentItem/index.js View File

@@ -307,7 +307,9 @@ var CommentItem = function (_Component) {
307 307
             _react2.default.createElement(
308 308
               "span",
309 309
               { className: "comment-item-speak-message" },
310
-              "[\u8DDF\u8BFB\u6D88\u606F]"
310
+              "[",
311
+              _reactIntlUniversal2.default.get("comment.speakComment"),
312
+              "]"
311 313
             ),
312 314
             _react2.default.createElement(
313 315
               "div",

+ 1
- 1
lib/components/ContentItem/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 0
lib/lang/en-US.js View File

@@ -17,6 +17,7 @@ var USdata = {
17 17
   "comment.reply": "Reply",
18 18
   "comment.moreComment": "More comments",
19 19
   "comment.filterSpeak": "Show imitations only",
20
+  "comment.speakComment": "Imitation audio",
20 21
 
21 22
   "reply.totalReply": "Total {total, plural, =1 {one reply} other {# replies}}",
22 23
   "reply.moreReply": "More replies",

+ 1
- 1
lib/lang/en-US.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../src/lang/en-US.js"],"names":["USdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,uBADZ;AAEb,wBAAsB,eAFT;AAGb,sBAAoB,2BAHP;AAIb,sBAAoB,MAJP;AAKb,sBAAoB,iBALP;AAMb,wBAAsB,iCANT;AAOb,sBAAoB,QAPP;;AASb,qBAAmB,SATN;AAUb,0BACE,4DAXW;AAYb,mBAAiB,OAZJ;AAab,yBAAuB,eAbV;AAcb,yBAAuB,sBAdV;;AAgBb,sBAAoB,yDAhBP;AAiBb,qBAAmB,cAjBN;AAkBb,oBAAkB,cAlBL;;AAoBb,sBAAoB,MApBP;AAqBb,0BAAwB,kBArBX;;AAuBb,sBAAoB,SAvBP;AAwBb,mBAAiB,SAxBJ;AAyBb,uBAAqB,QAzBR;AA0Bb,uBAAqB,QA1BR;;AA4Bb,2BAAyB,kBA5BZ;AA6Bb,wBAAsB,cA7BT;AA8Bb,qBAAmB,kBA9BN;AA+Bb,qBAAmB,eA/BN;AAgCb,yBAAuB,kBAhCV;AAiCb,0BAAwB,YAjCX;AAkCb,+BAA6B,SAlChB;AAmCb,yBAAuB;AAnCV,CAAf;;kBAsCeA,M","file":"en-US.js","sourcesContent":["const USdata = {\n  \"editor.alreadyEntered\": \"{count} words entered\",\n  \"editor.placeholder\": \"Say something\",\n  \"editor.maxLength\": \"Maximum {maxLength} words\",\n  \"editor.SubmitBtn\": \"Send\",\n  \"editor.uploadTip\": \"Upload pictures\",\n  \"editor.uploadCount\": \"(You could upload {count} more)\",\n  \"editor.uploadBtn\": \"Upload\",\n\n  \"comment.tourist\": \"Visitor\",\n  \"comment.totalComment\":\n    \"Total {total, plural, =1 {one comment} other {# comments}}\",\n  \"comment.reply\": \"Reply\",\n  \"comment.moreComment\": \"More comments\",\n  \"comment.filterSpeak\": \"Show imitations only\",\n\n  \"reply.totalReply\": \"Total {total, plural, =1 {one reply} other {# replies}}\",\n  \"reply.moreReply\": \"More replies\",\n  \"reply.collapse\": \"Fold replies\",\n\n  \"picture.collapse\": \"Fold\",\n  \"picture.viewOriginal\": \"See the original\",\n\n  \"popConfirm.title\": \"Delete?\",\n  \"popConfirm.ok\": \"Confirm\",\n  \"popConfirm.cancel\": \"Cancel\",\n  \"popConfirm.delete\": \"Delete\",\n\n  \"message.noMoreComment\": \"No more comments\",\n  \"message.noMoreData\": \"No more data\",\n  \"message.notNull\": \"It's still empty\",\n  \"message.success\": \"Comments sent\",\n  \"message.replyNoNull\": \"It's still empty\",\n  \"message.replySuccess\": \"Reply sent\",\n  \"message.cancelLickSuccess\": \"Unliked\",\n  \"message.likeSuccess\": \"Liked\"\n};\n\nexport default USdata;\n"]}
1
+{"version":3,"sources":["../../src/lang/en-US.js"],"names":["USdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,uBADZ;AAEb,wBAAsB,eAFT;AAGb,sBAAoB,2BAHP;AAIb,sBAAoB,MAJP;AAKb,sBAAoB,iBALP;AAMb,wBAAsB,iCANT;AAOb,sBAAoB,QAPP;;AASb,qBAAmB,SATN;AAUb,0BACE,4DAXW;AAYb,mBAAiB,OAZJ;AAab,yBAAuB,eAbV;AAcb,yBAAuB,sBAdV;AAeb,0BAAwB,iBAfX;;AAiBb,sBAAoB,yDAjBP;AAkBb,qBAAmB,cAlBN;AAmBb,oBAAkB,cAnBL;;AAqBb,sBAAoB,MArBP;AAsBb,0BAAwB,kBAtBX;;AAwBb,sBAAoB,SAxBP;AAyBb,mBAAiB,SAzBJ;AA0Bb,uBAAqB,QA1BR;AA2Bb,uBAAqB,QA3BR;;AA6Bb,2BAAyB,kBA7BZ;AA8Bb,wBAAsB,cA9BT;AA+Bb,qBAAmB,kBA/BN;AAgCb,qBAAmB,eAhCN;AAiCb,yBAAuB,kBAjCV;AAkCb,0BAAwB,YAlCX;AAmCb,+BAA6B,SAnChB;AAoCb,yBAAuB;AApCV,CAAf;;kBAuCeA,M","file":"en-US.js","sourcesContent":["const USdata = {\n  \"editor.alreadyEntered\": \"{count} words entered\",\n  \"editor.placeholder\": \"Say something\",\n  \"editor.maxLength\": \"Maximum {maxLength} words\",\n  \"editor.SubmitBtn\": \"Send\",\n  \"editor.uploadTip\": \"Upload pictures\",\n  \"editor.uploadCount\": \"(You could upload {count} more)\",\n  \"editor.uploadBtn\": \"Upload\",\n\n  \"comment.tourist\": \"Visitor\",\n  \"comment.totalComment\":\n    \"Total {total, plural, =1 {one comment} other {# comments}}\",\n  \"comment.reply\": \"Reply\",\n  \"comment.moreComment\": \"More comments\",\n  \"comment.filterSpeak\": \"Show imitations only\",\n  \"comment.speakComment\": \"Imitation audio\",\n\n  \"reply.totalReply\": \"Total {total, plural, =1 {one reply} other {# replies}}\",\n  \"reply.moreReply\": \"More replies\",\n  \"reply.collapse\": \"Fold replies\",\n\n  \"picture.collapse\": \"Fold\",\n  \"picture.viewOriginal\": \"See the original\",\n\n  \"popConfirm.title\": \"Delete?\",\n  \"popConfirm.ok\": \"Confirm\",\n  \"popConfirm.cancel\": \"Cancel\",\n  \"popConfirm.delete\": \"Delete\",\n\n  \"message.noMoreComment\": \"No more comments\",\n  \"message.noMoreData\": \"No more data\",\n  \"message.notNull\": \"It's still empty\",\n  \"message.success\": \"Comments sent\",\n  \"message.replyNoNull\": \"It's still empty\",\n  \"message.replySuccess\": \"Reply sent\",\n  \"message.cancelLickSuccess\": \"Unliked\",\n  \"message.likeSuccess\": \"Liked\"\n};\n\nexport default USdata;\n"]}

+ 1
- 0
lib/lang/zh-CN.js View File

@@ -17,6 +17,7 @@ var CNdata = {
17 17
   "comment.reply": "回复",
18 18
   "comment.moreComment": "更多评论",
19 19
   "comment.filterSpeak": "只显示跟读",
20
+  "comment.speakComment": "跟读语音",
20 21
 
21 22
   "reply.totalReply": "共{total}条回复",
22 23
   "reply.moreReply": "更多回复",

+ 1
- 1
lib/lang/zh-CN.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../src/lang/zh-CN.js"],"names":["CNdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,yBADZ;AAEb,wBAAsB,UAFT;AAGb,sBAAoB,iBAHP;AAIb,sBAAoB,IAJP;AAKb,sBAAoB,MALP;AAMb,wBAAsB,mBANT;AAOb,sBAAoB,IAPP;;AASb,qBAAmB,IATN;AAUb,0BAAwB,aAVX;AAWb,mBAAiB,IAXJ;AAYb,yBAAuB,MAZV;AAab,yBAAuB,OAbV;;AAeb,sBAAoB,aAfP;AAgBb,qBAAmB,MAhBN;AAiBb,oBAAkB,MAjBL;;AAmBb,sBAAoB,IAnBP;AAoBb,0BAAwB,MApBX;;AAsBb,sBAAoB,QAtBP;AAuBb,mBAAiB,IAvBJ;AAwBb,uBAAqB,IAxBR;AAyBb,uBAAqB,IAzBR;;AA2Bb,2BAAyB,SA3BZ;AA4Bb,wBAAsB,UA5BT;AA6Bb,qBAAmB,OA7BN;AA8Bb,qBAAmB,QA9BN;AA+Bb,yBAAuB,OA/BV;AAgCb,0BAAwB,QAhCX;AAiCb,+BAA6B,QAjChB;AAkCb,yBAAuB;AAlCV,CAAf;;kBAqCeA,M","file":"zh-CN.js","sourcesContent":["const CNdata = {\n  \"editor.alreadyEntered\": \"已输入{count}/{maxLength}字\",\n  \"editor.placeholder\": \"说点什么吧...\",\n  \"editor.maxLength\": \"字数上限{maxLength}\",\n  \"editor.SubmitBtn\": \"发送\",\n  \"editor.uploadTip\": \"上传图片\",\n  \"editor.uploadCount\": \"(您还能上传{count}张图片)\",\n  \"editor.uploadBtn\": \"上传\",\n\n  \"comment.tourist\": \"游客\",\n  \"comment.totalComment\": \"共{total}条评论\",\n  \"comment.reply\": \"回复\",\n  \"comment.moreComment\": \"更多评论\",\n  \"comment.filterSpeak\": \"只显示跟读\",\n\n  \"reply.totalReply\": \"共{total}条回复\",\n  \"reply.moreReply\": \"更多回复\",\n  \"reply.collapse\": \"收起回复\",\n\n  \"picture.collapse\": \"收起\",\n  \"picture.viewOriginal\": \"查看原图\",\n\n  \"popConfirm.title\": \"确定要删除吗\",\n  \"popConfirm.ok\": \"确定\",\n  \"popConfirm.cancel\": \"取消\",\n  \"popConfirm.delete\": \"删除\",\n\n  \"message.noMoreComment\": \"没有更多评论了\",\n  \"message.noMoreData\": \"没有更多数据了!\",\n  \"message.notNull\": \"没写内容呢\",\n  \"message.success\": \"评论已发送!\",\n  \"message.replyNoNull\": \"没写内容呢\",\n  \"message.replySuccess\": \"回复已发送!\",\n  \"message.cancelLickSuccess\": \"已取消点赞!\",\n  \"message.likeSuccess\": \"已赞!\"\n};\n\nexport default CNdata;\n"]}
1
+{"version":3,"sources":["../../src/lang/zh-CN.js"],"names":["CNdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,yBADZ;AAEb,wBAAsB,UAFT;AAGb,sBAAoB,iBAHP;AAIb,sBAAoB,IAJP;AAKb,sBAAoB,MALP;AAMb,wBAAsB,mBANT;AAOb,sBAAoB,IAPP;;AASb,qBAAmB,IATN;AAUb,0BAAwB,aAVX;AAWb,mBAAiB,IAXJ;AAYb,yBAAuB,MAZV;AAab,yBAAuB,OAbV;AAcb,0BAAwB,MAdX;;AAgBb,sBAAoB,aAhBP;AAiBb,qBAAmB,MAjBN;AAkBb,oBAAkB,MAlBL;;AAoBb,sBAAoB,IApBP;AAqBb,0BAAwB,MArBX;;AAuBb,sBAAoB,QAvBP;AAwBb,mBAAiB,IAxBJ;AAyBb,uBAAqB,IAzBR;AA0Bb,uBAAqB,IA1BR;;AA4Bb,2BAAyB,SA5BZ;AA6Bb,wBAAsB,UA7BT;AA8Bb,qBAAmB,OA9BN;AA+Bb,qBAAmB,QA/BN;AAgCb,yBAAuB,OAhCV;AAiCb,0BAAwB,QAjCX;AAkCb,+BAA6B,QAlChB;AAmCb,yBAAuB;AAnCV,CAAf;;kBAsCeA,M","file":"zh-CN.js","sourcesContent":["const CNdata = {\n  \"editor.alreadyEntered\": \"已输入{count}/{maxLength}字\",\n  \"editor.placeholder\": \"说点什么吧...\",\n  \"editor.maxLength\": \"字数上限{maxLength}\",\n  \"editor.SubmitBtn\": \"发送\",\n  \"editor.uploadTip\": \"上传图片\",\n  \"editor.uploadCount\": \"(您还能上传{count}张图片)\",\n  \"editor.uploadBtn\": \"上传\",\n\n  \"comment.tourist\": \"游客\",\n  \"comment.totalComment\": \"共{total}条评论\",\n  \"comment.reply\": \"回复\",\n  \"comment.moreComment\": \"更多评论\",\n  \"comment.filterSpeak\": \"只显示跟读\",\n  \"comment.speakComment\": \"跟读语音\",\n\n  \"reply.totalReply\": \"共{total}条回复\",\n  \"reply.moreReply\": \"更多回复\",\n  \"reply.collapse\": \"收起回复\",\n\n  \"picture.collapse\": \"收起\",\n  \"picture.viewOriginal\": \"查看原图\",\n\n  \"popConfirm.title\": \"确定要删除吗\",\n  \"popConfirm.ok\": \"确定\",\n  \"popConfirm.cancel\": \"取消\",\n  \"popConfirm.delete\": \"删除\",\n\n  \"message.noMoreComment\": \"没有更多评论了\",\n  \"message.noMoreData\": \"没有更多数据了!\",\n  \"message.notNull\": \"没写内容呢\",\n  \"message.success\": \"评论已发送!\",\n  \"message.replyNoNull\": \"没写内容呢\",\n  \"message.replySuccess\": \"回复已发送!\",\n  \"message.cancelLickSuccess\": \"已取消点赞!\",\n  \"message.likeSuccess\": \"已赞!\"\n};\n\nexport default CNdata;\n"]}

+ 3
- 3
lib/version.json View File

@@ -1,8 +1,8 @@
1 1
 {
2 2
     "name":       "comment",
3
-    "buildDate":  1588147494452,
3
+    "buildDate":  1588149501351,
4 4
     "version":    "1.0.4",
5
-    "numCommits": 210,
6
-    "hash":       "7da2eb9",
5
+    "numCommits": 211,
6
+    "hash":       "7a67067",
7 7
     "dirty":      true
8 8
 }

+ 68
- 60
src/components/ContentItem/index.js View File

@@ -211,60 +211,63 @@ class CommentItem extends Component {
211 211
 
212 212
           {isSpeak && (
213 213
             <div className="comment-item-speak">
214
-              <span className="comment-item-speak-message">[跟读消息]</span>
214
+              <span className="comment-item-speak-message">
215
+                [{intl.get("comment.speakComment")}]
216
+              </span>
215 217
               <div className="comment-item-speak-audio-wrapper">
216 218
                 <AudioPlayer src={medias && medias[0] && medias[0].url} />
217 219
               </div>
218 220
             </div>
219 221
           )}
220 222
           {// image为空时不渲染comment-item-image
221
-          imageList.length > 0 && imageList[0] !== "" && (
222
-            <div className="comment-item-image">
223
-              {!this.state.showPreviewer &&
224
-                imgs.map((item, index) => {
225
-                  if (item.type === "divider") {
223
+          imageList.length > 0 &&
224
+            imageList[0] !== "" && (
225
+              <div className="comment-item-image">
226
+                {!this.state.showPreviewer &&
227
+                  imgs.map((item, index) => {
228
+                    if (item.type === "divider") {
229
+                      return (
230
+                        <div className="comment-item-image-wrapper" key={index}>
231
+                          <div className="comment-img-divider" />
232
+                          {/* <img src={item} alt={item} className="comment-img" /> */}
233
+                        </div>
234
+                      );
235
+                    }
226 236
                     return (
227
-                      <div className="comment-item-image-wrapper" key={index}>
228
-                        <div className="comment-img-divider" />
237
+                      <div
238
+                        className="comment-item-image-wrapper"
239
+                        key={index}
240
+                        onClick={() => {
241
+                          let i = index;
242
+                          if (needClear) {
243
+                            if (index > 3) {
244
+                              i -= 1;
245
+                            }
246
+                            if (index > 7) {
247
+                              i -= 1;
248
+                            }
249
+                          }
250
+                          this.showPreviewer(i);
251
+                        }}
252
+                      >
253
+                        <div
254
+                          style={{ backgroundImage: `url(${item})` }}
255
+                          className="comment-img-thumbnail"
256
+                        />
229 257
                         {/* <img src={item} alt={item} className="comment-img" /> */}
230 258
                       </div>
231 259
                     );
232
-                  }
233
-                  return (
234
-                    <div
235
-                      className="comment-item-image-wrapper"
236
-                      key={index}
237
-                      onClick={() => {
238
-                        let i = index;
239
-                        if (needClear) {
240
-                          if (index > 3) {
241
-                            i -= 1;
242
-                          }
243
-                          if (index > 7) {
244
-                            i -= 1;
245
-                          }
246
-                        }
247
-                        this.showPreviewer(i);
248
-                      }}
249
-                    >
250
-                      <div
251
-                        style={{ backgroundImage: `url(${item})` }}
252
-                        className="comment-img-thumbnail"
253
-                      />
254
-                      {/* <img src={item} alt={item} className="comment-img" /> */}
255
-                    </div>
256
-                  );
257
-                })}
258
-              {this.state.showPreviewer && (
259
-                <ImagePreviewer
260
-                  list={imageList}
261
-                  index={this.state.previewerIndex}
262
-                  onFold={this.hidePreviewer}
263
-                />
264
-              )}
265
-              <div className="clearfix" />
266
-            </div>
267
-          )}
260
+                  })}
261
+                {this.state.showPreviewer && (
262
+                  <ImagePreviewer
263
+                    list={imageList}
264
+                    index={this.state.previewerIndex}
265
+                    onFold={this.hidePreviewer}
266
+                  />
267
+                )}
268
+                <div className="clearfix" />
269
+              </div>
270
+            )}
268 271
           <div className="comment-item-bottom">
269 272
             {content.reply_count ? (
270 273
               <div>
@@ -275,21 +278,23 @@ class CommentItem extends Component {
275 278
                 </a>
276 279
               </div>
277 280
             ) : null}
278
-            {showEdit && !isSpeak && app.userId === content.user_id && (
279
-              <i
280
-                className="comment-item-edit"
281
-                onClick={() =>
282
-                  this.props.app.handleEdit({
283
-                    action,
284
-                    replyId,
285
-                    commentId,
286
-                    userId: content.user_id,
287
-                    content,
288
-                    replyPage: page
289
-                  })
290
-                }
291
-              />
292
-            )}
281
+            {showEdit &&
282
+              !isSpeak &&
283
+              app.userId === content.user_id && (
284
+                <i
285
+                  className="comment-item-edit"
286
+                  onClick={() =>
287
+                    this.props.app.handleEdit({
288
+                      action,
289
+                      replyId,
290
+                      commentId,
291
+                      userId: content.user_id,
292
+                      content,
293
+                      replyPage: page
294
+                    })
295
+                  }
296
+                />
297
+              )}
293 298
             {app.userId === content.user_id && (
294 299
               <Popconfirm
295 300
                 // title="确定要删除吗?"
@@ -329,7 +334,10 @@ class CommentItem extends Component {
329 334
                 }
330 335
               />
331 336
             </div>
332
-            <span>&nbsp;{content.favor_count}</span>
337
+            <span>
338
+              &nbsp;
339
+              {content.favor_count}
340
+            </span>
333 341
             <div
334 342
               onClick={this.handleToggleInput}
335 343
               className="comment-item-reply"

+ 1
- 0
src/lang/en-US.js View File

@@ -13,6 +13,7 @@ const USdata = {
13 13
   "comment.reply": "Reply",
14 14
   "comment.moreComment": "More comments",
15 15
   "comment.filterSpeak": "Show imitations only",
16
+  "comment.speakComment": "Imitation audio",
16 17
 
17 18
   "reply.totalReply": "Total {total, plural, =1 {one reply} other {# replies}}",
18 19
   "reply.moreReply": "More replies",

+ 1
- 0
src/lang/zh-CN.js View File

@@ -12,6 +12,7 @@ const CNdata = {
12 12
   "comment.reply": "回复",
13 13
   "comment.moreComment": "更多评论",
14 14
   "comment.filterSpeak": "只显示跟读",
15
+  "comment.speakComment": "跟读语音",
15 16
 
16 17
   "reply.totalReply": "共{total}条回复",
17 18
   "reply.moreReply": "更多回复",