i18n of drafty preview elements
This commit is contained in:
+4
-1
@@ -172,5 +172,8 @@
|
|||||||
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
||||||
"title_manage_tags": "Verwalten",
|
"title_manage_tags": "Verwalten",
|
||||||
"channel_prompt": "Dies ist ein Sender",
|
"channel_prompt": "Dies ist ein Sender",
|
||||||
"channel": "Sender"
|
"channel": "Sender",
|
||||||
|
"drafty_attachment": "Dateianhang",
|
||||||
|
"drafty_form": "Formular:",
|
||||||
|
"drafty_image": "Bild"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
"delete_messages_warning": "Are you sure you want to delete all messages for everyone? It cannot be undone.",
|
"delete_messages_warning": "Are you sure you want to delete all messages for everyone? It cannot be undone.",
|
||||||
"deleted_content": "content deleted",
|
"deleted_content": "content deleted",
|
||||||
"download_action": "download",
|
"download_action": "download",
|
||||||
|
"drafty_attachment": "Attachment",
|
||||||
|
"drafty_form": "Form:",
|
||||||
|
"drafty_image": "Picture",
|
||||||
"email_dative": "email",
|
"email_dative": "email",
|
||||||
"email_prompt": "Email, e.g. jdoe@example.com",
|
"email_prompt": "Email, e.g. jdoe@example.com",
|
||||||
"enable_peers_messaging": "Enable",
|
"enable_peers_messaging": "Enable",
|
||||||
|
|||||||
+4
-1
@@ -172,5 +172,8 @@
|
|||||||
"tags_editor_no_tags": "Añadir etiquetas",
|
"tags_editor_no_tags": "Añadir etiquetas",
|
||||||
"title_manage_tags": "Gestionar",
|
"title_manage_tags": "Gestionar",
|
||||||
"channel_prompt": "Este es un canal",
|
"channel_prompt": "Este es un canal",
|
||||||
"channel": "canal"
|
"channel": "canal",
|
||||||
|
"drafty_attachment": "Archivo",
|
||||||
|
"drafty_form": "Formulario:",
|
||||||
|
"drafty_image": "Imagen"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,18 @@
|
|||||||
"defaultMessage": "download",
|
"defaultMessage": "download",
|
||||||
"description": "Call to action [download]"
|
"description": "Call to action [download]"
|
||||||
},
|
},
|
||||||
|
"drafty_attachment": {
|
||||||
|
"defaultMessage": "Attachment",
|
||||||
|
"description": "Comment for attachment in drafty preview"
|
||||||
|
},
|
||||||
|
"drafty_form": {
|
||||||
|
"defaultMessage": "Form:",
|
||||||
|
"description": "Comment for form in drafty preview"
|
||||||
|
},
|
||||||
|
"drafty_image": {
|
||||||
|
"defaultMessage": "Picture",
|
||||||
|
"description": "Comment for embedded images in drafty preview"
|
||||||
|
},
|
||||||
"email_dative": {
|
"email_dative": {
|
||||||
"defaultMessage": "email",
|
"defaultMessage": "email",
|
||||||
"description": "Dative case of 'email', i.e. 'email' in 'by email'"
|
"description": "Dative case of 'email', i.e. 'email' in 'by email'"
|
||||||
|
|||||||
+4
-1
@@ -175,5 +175,8 @@
|
|||||||
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
||||||
"deleted_content": "내용이 삭제되었습니다",
|
"deleted_content": "내용이 삭제되었습니다",
|
||||||
"channel_prompt": "이 채널입니다",
|
"channel_prompt": "이 채널입니다",
|
||||||
"channel": "채널"
|
"channel": "채널",
|
||||||
|
"drafty_attachment": "부착",
|
||||||
|
"drafty_form": "형태:",
|
||||||
|
"drafty_image": "이미지"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -172,5 +172,8 @@
|
|||||||
"cannot_initiate_file_upload": "Nu se poate face încărcarea.",
|
"cannot_initiate_file_upload": "Nu se poate face încărcarea.",
|
||||||
"tags_not_found": "Niciun tag definit. Adaugă.",
|
"tags_not_found": "Niciun tag definit. Adaugă.",
|
||||||
"tags_editor_no_tags": "Adaugă tag-uri",
|
"tags_editor_no_tags": "Adaugă tag-uri",
|
||||||
"title_manage_tags": "Administrează"
|
"title_manage_tags": "Administrează",
|
||||||
|
"drafty_attachment": "Atasament",
|
||||||
|
"drafty_form": "Formă:",
|
||||||
|
"drafty_image": "Imagine"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -172,5 +172,8 @@
|
|||||||
"no_connection": "Нет связи",
|
"no_connection": "Нет связи",
|
||||||
"code_doesnot_match": "Код не совпадает",
|
"code_doesnot_match": "Код не совпадает",
|
||||||
"channel_prompt": "Создать канал",
|
"channel_prompt": "Создать канал",
|
||||||
"channel": "канал"
|
"channel": "канал",
|
||||||
|
"drafty_attachment": "Аттачмент",
|
||||||
|
"drafty_form": "Форма:",
|
||||||
|
"drafty_image": "Картинка"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -172,5 +172,8 @@
|
|||||||
"no_connection": "无连接",
|
"no_connection": "无连接",
|
||||||
"code_doesnot_match": "代码不匹配",
|
"code_doesnot_match": "代码不匹配",
|
||||||
"channel_prompt": "这是一个频道",
|
"channel_prompt": "这是一个频道",
|
||||||
"channel": "频道"
|
"channel": "频道",
|
||||||
|
"drafty_attachment": "附件",
|
||||||
|
"drafty_form": "形式:",
|
||||||
|
"drafty_image": "图像"
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-6
@@ -173,7 +173,10 @@
|
|||||||
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
||||||
"title_manage_tags": "Verwalten",
|
"title_manage_tags": "Verwalten",
|
||||||
"channel_prompt": "Dies ist ein Sender",
|
"channel_prompt": "Dies ist ein Sender",
|
||||||
"channel": "Sender"
|
"channel": "Sender",
|
||||||
|
"drafty_attachment": "Dateianhang",
|
||||||
|
"drafty_form": "Formular:",
|
||||||
|
"drafty_image": "Bild"
|
||||||
},
|
},
|
||||||
"en": {
|
"en": {
|
||||||
"action_block_contact": "Block Contact",
|
"action_block_contact": "Block Contact",
|
||||||
@@ -220,6 +223,9 @@
|
|||||||
"delete_messages_warning": "Are you sure you want to delete all messages for everyone? It cannot be undone.",
|
"delete_messages_warning": "Are you sure you want to delete all messages for everyone? It cannot be undone.",
|
||||||
"deleted_content": "content deleted",
|
"deleted_content": "content deleted",
|
||||||
"download_action": "download",
|
"download_action": "download",
|
||||||
|
"drafty_attachment": "Attachment",
|
||||||
|
"drafty_form": "Form:",
|
||||||
|
"drafty_image": "Picture",
|
||||||
"email_dative": "email",
|
"email_dative": "email",
|
||||||
"email_prompt": "Email, e.g. jdoe@example.com",
|
"email_prompt": "Email, e.g. jdoe@example.com",
|
||||||
"enable_peers_messaging": "Enable",
|
"enable_peers_messaging": "Enable",
|
||||||
@@ -525,7 +531,10 @@
|
|||||||
"tags_editor_no_tags": "Añadir etiquetas",
|
"tags_editor_no_tags": "Añadir etiquetas",
|
||||||
"title_manage_tags": "Gestionar",
|
"title_manage_tags": "Gestionar",
|
||||||
"channel_prompt": "Este es un canal",
|
"channel_prompt": "Este es un canal",
|
||||||
"channel": "canal"
|
"channel": "canal",
|
||||||
|
"drafty_attachment": "Archivo",
|
||||||
|
"drafty_form": "Formulario:",
|
||||||
|
"drafty_image": "Imagen"
|
||||||
},
|
},
|
||||||
"ko": {
|
"ko": {
|
||||||
"validate_credential_action": "확인",
|
"validate_credential_action": "확인",
|
||||||
@@ -701,7 +710,10 @@
|
|||||||
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
||||||
"deleted_content": "내용이 삭제되었습니다",
|
"deleted_content": "내용이 삭제되었습니다",
|
||||||
"channel_prompt": "이 채널입니다",
|
"channel_prompt": "이 채널입니다",
|
||||||
"channel": "채널"
|
"channel": "채널",
|
||||||
|
"drafty_attachment": "부착",
|
||||||
|
"drafty_form": "형태:",
|
||||||
|
"drafty_image": "이미지"
|
||||||
},
|
},
|
||||||
"ro": {
|
"ro": {
|
||||||
"validate_credential_action": "confirmă",
|
"validate_credential_action": "confirmă",
|
||||||
@@ -877,7 +889,10 @@
|
|||||||
"cannot_initiate_file_upload": "Nu se poate face încărcarea.",
|
"cannot_initiate_file_upload": "Nu se poate face încărcarea.",
|
||||||
"tags_not_found": "Niciun tag definit. Adaugă.",
|
"tags_not_found": "Niciun tag definit. Adaugă.",
|
||||||
"tags_editor_no_tags": "Adaugă tag-uri",
|
"tags_editor_no_tags": "Adaugă tag-uri",
|
||||||
"title_manage_tags": "Administrează"
|
"title_manage_tags": "Administrează",
|
||||||
|
"drafty_attachment": "Atasament",
|
||||||
|
"drafty_form": "Formă:",
|
||||||
|
"drafty_image": "Imagine"
|
||||||
},
|
},
|
||||||
"ru": {
|
"ru": {
|
||||||
"contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯",
|
"contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯",
|
||||||
@@ -1053,7 +1068,10 @@
|
|||||||
"no_connection": "Нет связи",
|
"no_connection": "Нет связи",
|
||||||
"code_doesnot_match": "Код не совпадает",
|
"code_doesnot_match": "Код не совпадает",
|
||||||
"channel_prompt": "Создать канал",
|
"channel_prompt": "Создать канал",
|
||||||
"channel": "канал"
|
"channel": "канал",
|
||||||
|
"drafty_attachment": "Аттачмент",
|
||||||
|
"drafty_form": "Форма:",
|
||||||
|
"drafty_image": "Картинка"
|
||||||
},
|
},
|
||||||
"zh": {
|
"zh": {
|
||||||
"archived_contacts": "已归档联系人 ({count})",
|
"archived_contacts": "已归档联系人 ({count})",
|
||||||
@@ -1229,6 +1247,9 @@
|
|||||||
"no_connection": "无连接",
|
"no_connection": "无连接",
|
||||||
"code_doesnot_match": "代码不匹配",
|
"code_doesnot_match": "代码不匹配",
|
||||||
"channel_prompt": "这是一个频道",
|
"channel_prompt": "这是一个频道",
|
||||||
"channel": "频道"
|
"channel": "频道",
|
||||||
|
"drafty_attachment": "附件",
|
||||||
|
"drafty_form": "形式:",
|
||||||
|
"drafty_image": "图像"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-5
@@ -1,6 +1,6 @@
|
|||||||
// A single topic or user.
|
// A single topic or user.
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import ContactBadges from './contact-badges.jsx';
|
import ContactBadges from './contact-badges.jsx';
|
||||||
import LetterTile from './letter-tile.jsx';
|
import LetterTile from './letter-tile.jsx';
|
||||||
@@ -11,7 +11,25 @@ import { Drafty } from 'tinode-sdk';
|
|||||||
|
|
||||||
import { deliveryMarker } from '../lib/utils.js';
|
import { deliveryMarker } from '../lib/utils.js';
|
||||||
|
|
||||||
export default class Contact extends React.Component {
|
const messages = defineMessages({
|
||||||
|
drafty_image: {
|
||||||
|
id: 'drafty_image',
|
||||||
|
defaultMessage: 'Picture',
|
||||||
|
description: 'Comment for embedded images in drafty preview'
|
||||||
|
},
|
||||||
|
drafty_form: {
|
||||||
|
id: 'drafty_form',
|
||||||
|
defaultMessage: 'Form: ',
|
||||||
|
description: 'Comment for form in drafty preview'
|
||||||
|
},
|
||||||
|
drafty_attachment: {
|
||||||
|
id: 'drafty_attachment',
|
||||||
|
defaultMessage: 'Attachment',
|
||||||
|
description: 'Comment for attachment in drafty preview'
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
class Contact extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@@ -105,6 +123,7 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
let el = Drafty.tagName(style);
|
let el = Drafty.tagName(style);
|
||||||
const attr = { key: key };
|
const attr = { key: key };
|
||||||
if (el) {
|
if (el) {
|
||||||
|
const { formatMessage } = this.props.intl;
|
||||||
switch (style) {
|
switch (style) {
|
||||||
case 'BR':
|
case 'BR':
|
||||||
// Replace new line with a space.
|
// Replace new line with a space.
|
||||||
@@ -122,7 +141,7 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
case 'IM':
|
case 'IM':
|
||||||
// Replace image with '[icon] Image'.
|
// Replace image with '[icon] Image'.
|
||||||
el = React.Fragment;
|
el = React.Fragment;
|
||||||
values = [<i key="im" className="material-icons">photo</i>, 'Picture'];
|
values = [<i key="im" className="material-icons">photo</i>, formatMessage(messages.drafty_image)];
|
||||||
break;
|
break;
|
||||||
case 'BN':
|
case 'BN':
|
||||||
el = 'span';
|
el = 'span';
|
||||||
@@ -130,14 +149,15 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
break;
|
break;
|
||||||
case 'FM':
|
case 'FM':
|
||||||
el = React.Fragment;
|
el = React.Fragment;
|
||||||
values = [<i key="fm" className="material-icons">dashboard</i>, 'Form: '].concat(values || []);
|
values = [<i key="fm" className="material-icons">dashboard</i>,
|
||||||
|
formatMessage(messages.drafty_form)].concat(values || []);
|
||||||
break;
|
break;
|
||||||
case 'RW':
|
case 'RW':
|
||||||
el = React.Fragment;
|
el = React.Fragment;
|
||||||
break;
|
break;
|
||||||
case 'EX':
|
case 'EX':
|
||||||
el = React.Fragment;
|
el = React.Fragment;
|
||||||
values = [<i key="ex" className="material-icons">attachment</i>, 'Attachment'];
|
values = [<i key="ex" className="material-icons">attachment</i>, formatMessage(messages.drafty_attachment)];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (el == '_UNKN') {
|
if (el == '_UNKN') {
|
||||||
@@ -151,3 +171,5 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default injectIntl(Contact);
|
||||||
|
|||||||
+34
-7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user