From 7e8579b8aaf551c2b9fa5eb2044017284c6270cc Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Tue, 16 Apr 2019 17:03:01 +0200 Subject: [PATCH] UX: Add translations for lightbox --- app/assets/javascripts/discourse/lib/lightbox.js.es6 | 12 +++++++++++- config/locales/client.en.yml | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/lightbox.js.es6 b/app/assets/javascripts/discourse/lib/lightbox.js.es6 index ee09275263b..b1be31d695f 100644 --- a/app/assets/javascripts/discourse/lib/lightbox.js.es6 +++ b/app/assets/javascripts/discourse/lib/lightbox.js.es6 @@ -20,7 +20,16 @@ export default function($elem) { mainClass: "mfp-zoom-in", gallery: { - enabled: true + enabled: true, + tPrev: I18n.t("lightbox.previous"), + tNext: I18n.t("lightbox.next"), + tCounter: I18n.t("lightbox.counter") + }, + + tClose: I18n.t("lightbox.close"), + tLoading: I18n.t("lightbox.loading"), + ajax: { + tError: I18n.t("lightbox.content_load_error") }, callbacks: { @@ -57,6 +66,7 @@ export default function($elem) { }, image: { + tError: I18n.t("lightbox.image_load_error"), titleSrc(item) { const href = item.el.data("download-href") || item.src; let src = [ diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index fdf332d66d6..1bd828e6f60 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2802,6 +2802,13 @@ en: lightbox: download: "download" + previous: "Previous (Left arrow key)" + next: "Next (Right arrow key)" + counter: "%curr% of %total%" + close: "Close (Esc)" + loading: "Loading…" + content_load_error: 'The content could not be loaded.' + image_load_error: 'The image could not be loaded.' keyboard_shortcuts_help: title: "Keyboard Shortcuts"