add option to translate text annotations for display
This commit is contained in:
parent
2480e1bd87
commit
2421072d70
1 changed files with 5 additions and 1 deletions
|
@ -51,6 +51,7 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
showInfo: false,
|
showInfo: false,
|
||||||
showWidget: false,
|
showWidget: false,
|
||||||
sort: 'position',
|
sort: 'position',
|
||||||
|
translate: false,
|
||||||
title: '',
|
title: '',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
users: 'all',
|
users: 'all',
|
||||||
|
@ -279,7 +280,7 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
globalAttributes: ['data', 'lang'],
|
globalAttributes: ['data', 'lang'],
|
||||||
highlight: self.options.highlight,
|
highlight: self.options.translate ? Ox._(self.options.highlight) : self.options.highlight,
|
||||||
placeholder: Ox._('Loading...'),
|
placeholder: Ox._('Loading...'),
|
||||||
separator: ';',
|
separator: ';',
|
||||||
sort: self.sort,
|
sort: self.sort,
|
||||||
|
@ -302,6 +303,9 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
autocompleteSelectMaxWidth: 256,
|
autocompleteSelectMaxWidth: 256,
|
||||||
autocompleteSelectOffset: {left: 0, top: 0},
|
autocompleteSelectOffset: {left: 0, top: 0},
|
||||||
autocompleteSelectUpdate: true,
|
autocompleteSelectUpdate: true,
|
||||||
|
format: self.options.translate ? function(value) {
|
||||||
|
return Ox._(value);
|
||||||
|
} : null,
|
||||||
unformat: function(value) {
|
unformat: function(value) {
|
||||||
return Ox.decodeHTMLEntities(Ox.stripTags(value));
|
return Ox.decodeHTMLEntities(Ox.stripTags(value));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue