question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

12.customization-minimizable-web-chat Sample Doesn't not translate to es-ES

See original GitHub issue

Hello, 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: image

example replacing original file by translated:

image

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
renrouscommented, May 8, 2019

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!

0reactions
corinagumcommented, May 14, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found