12.customization-minimizable-web-chat Sample Doesn't not translate to es-ES
See original GitHub issueHello, the botframework-webchat-component module does not translate correctly to es-ES, after investigating the problem, I found that the file is-ES.js located in % project% \ node_modules \ botframework-webchat-component \ lib \ Localization is not fully
translated, original file:
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function xMinutesAgo(date) {
var now = Date.now();
var deltaInMs = now - new Date(date).getTime();
var deltaInMinutes = Math.floor(deltaInMs / 60000);
var deltaInHours = Math.floor(deltaInMs / 3600000);
if (deltaInMinutes < 1) {
return 'Ahora';
} else if (deltaInMinutes === 1) {
return 'Hace un minuto';
} else if (deltaInHours < 1) {
return "Hace ".concat(deltaInMinutes, " minutos");
} else if (deltaInHours === 1) {
return "Hace una hora";
} else if (deltaInHours < 5) {
return "Hace ".concat(deltaInHours, " horas");
} else if (deltaInHours <= 24) {
return "Hoy";
} else if (deltaInHours <= 48) {
return "Ayer";
} else {
return new Intl.DateTimeFormat('es-ES').format(date);
}
}
var _default = {
FAILED_CONNECTION_NOTIFICATION: 'Imposible conectar.',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: 'No enviado. {Retry}.',
SLOW_CONNECTION_NOTIFICATION: 'Está tardando mucho en conectar.',
'X minutes ago': xMinutesAgo,
'Chat': 'Chat',
'Microphone off': 'Apagar micrófono',
'Microphone on': 'Encender micrófono',
'Download file': 'Descargar archivo',
'New messages': 'Nuevos mensajes',
'Listening…': 'Escuchando…',
'retry': 'reintentar',
'Retry': 'Reintentar',
// Please alter this value if 'Retry' at the beginning of a sentence is written differently than at the end of a sentence.
'Send': 'Enviar',
'Sending': 'Enviando',
'Speak': 'Hablar',
'Starting…': 'Comenzando',
'Tax': 'Impuestos',
'Total': 'Total',
'Type your message': 'Escribe tu mensaje...',
'Upload file': 'Subir archivo',
'VAT': 'IVA'
};
exports.default = _default;
Complete translated file:
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function botSaidSomething(avatarInitials, text, timestamp) {
return "El Bot ".concat(avatarInitials, " dijo, ").concat(text, ", ").concat(xMinutesAgo(timestamp));
}
function userSaidSomething(avatarInitials, text, timestamp) {
return "El usuario ".concat(avatarInitials, " dijo, ").concat(text, ", ").concat(xMinutesAgo(timestamp));
}
function xMinutesAgo(dateStr) {
var date = new Date(dateStr);
var dateTime = date.getTime();
if (isNaN(dateTime)) {
return dateStr;
}
var now = Date.now();
var deltaInMs = now - dateTime;
var deltaInMinutes = Math.floor(deltaInMs / 60000);
var deltaInHours = Math.floor(deltaInMs / 3600000);
if (deltaInMinutes < 1) {
return 'Ahora';
} else if (deltaInMinutes === 1) {
return 'Hace un minuto';
} else if (deltaInHours < 1) {
return "Hace ".concat(deltaInMinutes, " minutos");
} else if (deltaInHours === 1) {
return "Hace una hora";
} else if (deltaInHours < 5) {
return "Hace ".concat(deltaInHours, " horas");
} else if (deltaInHours <= 24) {
return "Hoy";
} else if (deltaInHours <= 48) {
return "Ayer";
} else if (window.Intl) {
return new Intl.DateTimeFormat('en-US').format(date);
} else {
return date.toLocaleString('en-US', {
day: '2-digit',
hour: '2-digit',
hour12: false,
minute: '2-digit',
month: '2-digit',
year: 'numeric'
});
}
}
var _default = {
FAILED_CONNECTION_NOTIFICATION: 'No se puede establecer conexion.',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: 'No enviado. {Retry}.',
SLOW_CONNECTION_NOTIFICATION: 'Tomando más de lo usuar para conectarse.',
'Bot said something': botSaidSomething,
'User said something': userSaidSomething,
'X minutes ago': xMinutesAgo,
// '[File of type '%1']': '[File of type '%1']",
// '[Unknown Card '%1']': '[Unknown Card '%1']',
'Adaptive Card parse error': 'Adaptive Card parse error',
'Adaptive Card render error': 'Adaptive Card render error',
'Chat': 'Chat',
'Download file': 'Descargar archivo',
'Microphone off': 'Apagar microfono',
'Microphone on': 'Encender microfono',
'Left': 'Izquierda',
'Listening…': 'Escuchando...',
'New messages': 'Nuevos mensajes',
'Right': 'Derecha',
'retry': 'reintentar',
'Retry': 'Reintentar',
'Send': 'Enviar',
'Sending': 'Enviando',
'Speak': 'Hablar',
'Starting…': 'Comenzando…',
'Tax': 'Impuesto',
'Total': 'Total',
'Type your message': 'Escribe tu mensaje...',
'Upload file': 'Subir archivo',
'VAT': 'IVA'
};
exports.default = _default;
example with original file:
example replacing original file by translated:
I would like the issue to be analyzed so that the full translation of the module is carried out and to avoid having to manually replace the file es-ES.js
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
botframework-webchat 4.3.1-master-bb7e059 | MyGet
My Bot's webpage is rendering Web Chat v3 and uses customization options provided by Web Chat, no customization at all, or very little...
Read more >botframework v4 customize title and minimizable webchat
It works fine, but now I need to publish this chat in the webpage of the company, as a popup or something like...
Read more >botframework-webchat-component | Yarn - Package Manager
This repository contains code for the Bot Framework Web Chat component. The Bot Framework Web Chat component is a highly-customizable web-based client for ......
Read more >Web Chat customization in the Bot Framework SDK - Bot Service
The Web Chat control provides rich customization options: you can change colors, sizes, placement of elements, add custom elements, ...
Read more >botframework-webchat - npm
My website is integrated with Web Chat v3 and uses customization ... If one or more of your features is not available in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hello @corinagum thank you very much, I really do not have much experience in the use of github I’m doing the first experiences, I’m not clear how to do the PR if you could help me with this to learn happy to be able to count on the help and learn to keep getting involved in the use of github . Thank you very much!
Hey @renrous, how’s it going? Do you have any questions? If you think you will not be able to make changes, please let me know. That’s no problem, and I can look into this fix instead.