Added option to enable/disable translation mode.
This commit is contained in:
parent
a5746d5d7c
commit
a5b7ea7d5f
1 changed files with 8 additions and 4 deletions
|
@ -209,6 +209,7 @@ class App.i18n extends App.Ajax
|
||||||
# load translation collection
|
# load translation collection
|
||||||
for object in data
|
for object in data
|
||||||
|
|
||||||
|
# set runtime lookup table
|
||||||
@map[ object[1] ] = object[2]
|
@map[ object[1] ] = object[2]
|
||||||
|
|
||||||
# load in collection if needed
|
# load in collection if needed
|
||||||
|
@ -224,10 +225,13 @@ class App.i18n extends App.Ajax
|
||||||
translate_content: (string, args...) =>
|
translate_content: (string, args...) =>
|
||||||
translated = @translate(string, args...)
|
translated = @translate(string, args...)
|
||||||
# replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + '<span class="icon-edit"></span>'
|
# replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + '<span class="icon-edit"></span>'
|
||||||
|
if window.Config['Translation']
|
||||||
replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + ''
|
replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + ''
|
||||||
# if !@_translated
|
# if !@_translated
|
||||||
# replace += '<span class="missing">XX</span>'
|
# replace += '<span class="missing">XX</span>'
|
||||||
replace += '</span>'
|
replace += '</span>'
|
||||||
|
else
|
||||||
|
translated
|
||||||
|
|
||||||
translate: (string, args...) =>
|
translate: (string, args...) =>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue