Merge pull request #501 from differentreality/translation_live

add js code for live translation feature of transifex
This commit is contained in:
Stella Rouzi 2014-11-14 20:48:27 +02:00
commit a620132f7f
2 changed files with 13 additions and 0 deletions

View file

@ -10,11 +10,20 @@
= javascript_include_tag "application"
= csrf_meta_tags
:javascript
window.liveSettings = {
api_key: "<%= CONFIG['transifex_live_api_key'] %>",
picker: "bottom-right",
detectlang: true,
autocollect: true
};
$(function() {
$('.dropdown input, .dropdown label').click(function(e) {
e.stopPropagation();
});
});
= javascript_include_tag "//cdn.transifex.com/live.js"
= yield(:head)
%body{ data: (content_for?(:splash_nav) ? {spy: 'scroll', offset: 0, target: 'splash-nav'} : {} ) }
= render 'layouts/navigation'

View file

@ -29,3 +29,7 @@ test:
production:
<<: *defaults
# If you add more providers that do not require a key, you still have to create the 2 variables with sample data
transifex_live_api_key: ''