From 2421072d708cb50da0a342fb06c42d5b428fa5d3 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 13 Aug 2018 22:28:33 +0200 Subject: [PATCH] add option to translate text annotations for display --- source/UI/js/Video/AnnotationFolder.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/UI/js/Video/AnnotationFolder.js b/source/UI/js/Video/AnnotationFolder.js index 8c2e1e72..b8652c5e 100644 --- a/source/UI/js/Video/AnnotationFolder.js +++ b/source/UI/js/Video/AnnotationFolder.js @@ -51,6 +51,7 @@ Ox.AnnotationFolder = function(options, self) { showInfo: false, showWidget: false, sort: 'position', + translate: false, title: '', type: 'text', users: 'all', @@ -279,7 +280,7 @@ Ox.AnnotationFolder = function(options, self) { } : null, globalAttributes: ['data', 'lang'], - highlight: self.options.highlight, + highlight: self.options.translate ? Ox._(self.options.highlight) : self.options.highlight, placeholder: Ox._('Loading...'), separator: ';', sort: self.sort, @@ -302,6 +303,9 @@ Ox.AnnotationFolder = function(options, self) { autocompleteSelectMaxWidth: 256, autocompleteSelectOffset: {left: 0, top: 0}, autocompleteSelectUpdate: true, + format: self.options.translate ? function(value) { + return Ox._(value); + } : null, unformat: function(value) { return Ox.decodeHTMLEntities(Ox.stripTags(value)); }