Bladeren bron

ref(chat): change input placeholder

master
Leonard Kim 6 jaren geleden
bovenliggende
commit
4d04141f24
2 gewijzigde bestanden met toevoegingen van 10 en 5 verwijderingen
  1. 1
    1
      lang/main.json
  2. 9
    4
      react/features/chat/components/web/ChatInput.js

+ 1
- 1
lang/main.json Bestand weergeven

@@ -50,7 +50,7 @@
50 50
     },
51 51
     "chat": {
52 52
         "error": "Error: your message \"__originalText__\" was not sent. Reason: __error__",
53
-        "messagebox": "Enter text...",
53
+        "messagebox": "Type a message",
54 54
         "nickname": {
55 55
             "popover": "Choose a nickname",
56 56
             "title": "Enter a nickname to use chat"

+ 9
- 4
react/features/chat/components/web/ChatInput.js Bestand weergeven

@@ -4,6 +4,7 @@ import React, { Component } from 'react';
4 4
 import Emoji from 'react-emoji-render';
5 5
 import type { Dispatch } from 'redux';
6 6
 
7
+import { translate } from '../../../base/i18n';
7 8
 import { connect } from '../../../base/redux';
8 9
 
9 10
 import { sendMessage } from '../../actions';
@@ -23,7 +24,12 @@ type Props = {
23 24
     /**
24 25
      * Optional callback to get a reference to the chat input element.
25 26
      */
26
-    getChatInputRef?: Function
27
+    getChatInputRef?: Function,
28
+
29
+    /**
30
+     * Invoked to obtain translated strings.
31
+     */
32
+    t: Function
27 33
 };
28 34
 
29 35
 /**
@@ -114,11 +120,10 @@ class ChatInput extends Component<Props, State> {
114 120
                 </div>
115 121
                 <div className = 'usrmsg-form'>
116 122
                     <textarea
117
-                        data-i18n = '[placeholder]chat.messagebox'
118 123
                         id = 'usermsg'
119 124
                         onChange = { this._onMessageChange }
120 125
                         onKeyDown = { this._onDetectSubmit }
121
-                        placeholder = { 'Enter Text...' }
126
+                        placeholder = { this.props.t('chat.messagebox') }
122 127
                         ref = { this._setTextAreaRef }
123 128
                         value = { this.state.message } />
124 129
                 </div>
@@ -233,4 +238,4 @@ class ChatInput extends Component<Props, State> {
233 238
     }
234 239
 }
235 240
 
236
-export default connect()(ChatInput);
241
+export default translate(connect()(ChatInput));

Laden…
Annuleren
Opslaan