Преглед изворни кода

ref(chat): change input placeholder

master
Leonard Kim пре 6 година
родитељ
комит
4d04141f24
2 измењених фајлова са 10 додато и 5 уклоњено
  1. 1
    1
      lang/main.json
  2. 9
    4
      react/features/chat/components/web/ChatInput.js

+ 1
- 1
lang/main.json Прегледај датотеку

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

+ 9
- 4
react/features/chat/components/web/ChatInput.js Прегледај датотеку

4
 import Emoji from 'react-emoji-render';
4
 import Emoji from 'react-emoji-render';
5
 import type { Dispatch } from 'redux';
5
 import type { Dispatch } from 'redux';
6
 
6
 
7
+import { translate } from '../../../base/i18n';
7
 import { connect } from '../../../base/redux';
8
 import { connect } from '../../../base/redux';
8
 
9
 
9
 import { sendMessage } from '../../actions';
10
 import { sendMessage } from '../../actions';
23
     /**
24
     /**
24
      * Optional callback to get a reference to the chat input element.
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
                 </div>
120
                 </div>
115
                 <div className = 'usrmsg-form'>
121
                 <div className = 'usrmsg-form'>
116
                     <textarea
122
                     <textarea
117
-                        data-i18n = '[placeholder]chat.messagebox'
118
                         id = 'usermsg'
123
                         id = 'usermsg'
119
                         onChange = { this._onMessageChange }
124
                         onChange = { this._onMessageChange }
120
                         onKeyDown = { this._onDetectSubmit }
125
                         onKeyDown = { this._onDetectSubmit }
121
-                        placeholder = { 'Enter Text...' }
126
+                        placeholder = { this.props.t('chat.messagebox') }
122
                         ref = { this._setTextAreaRef }
127
                         ref = { this._setTextAreaRef }
123
                         value = { this.state.message } />
128
                         value = { this.state.message } />
124
                 </div>
129
                 </div>
233
     }
238
     }
234
 }
239
 }
235
 
240
 
236
-export default connect()(ChatInput);
241
+export default translate(connect()(ChatInput));

Loading…
Откажи
Сачувај