diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bee3a69d..39f8504d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Moved `botAvatarImage` and `userAvatarImage` to `styleOptions.botAvatarImage` and `styleOptions.userAvatarImage` respectively, in PR [#1486](https://github.com/Microsoft/BotFramework-WebChat/pull/1486) +- Fix string interpolation error in Russian localization and fallback for browsers without Intl support by [@odysseus1973](https://github.com/odysseus1973) in PR [#1509](https://github.com/Microsoft/BotFramework-WebChat/pull/1509) ### Fixed - Fix [#1360](https://github.com/Microsoft/BotFramework-WebChat/issues/1360). Added `roles` to components of Web Chat, by [@corinagum](https://github.com/corinagum) in PR [#1462](https://github.com/Microsoft/BotFramework-WebChat/pull/1462) diff --git a/packages/component/src/Localization/ru-RU.js b/packages/component/src/Localization/ru-RU.js index 22a530c7bd..8cfd438b8d 100644 --- a/packages/component/src/Localization/ru-RU.js +++ b/packages/component/src/Localization/ru-RU.js @@ -9,21 +9,32 @@ function xMinutesAgo(date) { } else if (deltaInMinutes === 1) { return 'Минуту назад'; } else if (deltaInHours < 1 && deltaInMinutes < 5) { - return '${ deltaInMinutes } минуты назад'; + return `${ deltaInMinutes } минуты назад`; } else if (deltaInHours < 1 && deltaInMinutes >= 5) { - return '${ deltaInMinutes } минут назад'; + return `${ deltaInMinutes } минут назад`; } else if (deltaInHours === 1) { return 'Час назад'; } else if (deltaInHours < 5) { - return '${ deltaInHours } часа назад'; + return `${ deltaInHours } часа назад`; } else if (deltaInHours <= 24) { return 'Сегодня'; } else if (deltaInHours <= 48) { return 'Вчера'; } else if (deltaInHours <= 72) { return 'Позавчера'; - } else { + } else if (window.Intl) { return new Intl.DateTimeFormat('ru-RU').format(date); + } else { + return date.toLocaleString( + 'ru-RU', + { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit' + } + ); } }