Merge pull request #501 from differentreality/translation_live
add js code for live translation feature of transifex
This commit is contained in:
commit
a620132f7f
2 changed files with 13 additions and 0 deletions
|
|
@ -10,11 +10,20 @@
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
:javascript
|
:javascript
|
||||||
|
window.liveSettings = {
|
||||||
|
api_key: "<%= CONFIG['transifex_live_api_key'] %>",
|
||||||
|
picker: "bottom-right",
|
||||||
|
detectlang: true,
|
||||||
|
autocollect: true
|
||||||
|
};
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('.dropdown input, .dropdown label').click(function(e) {
|
$('.dropdown input, .dropdown label').click(function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
= javascript_include_tag "//cdn.transifex.com/live.js"
|
||||||
= yield(:head)
|
= yield(:head)
|
||||||
%body{ data: (content_for?(:splash_nav) ? {spy: 'scroll', offset: 0, target: 'splash-nav'} : {} ) }
|
%body{ data: (content_for?(:splash_nav) ? {spy: 'scroll', offset: 0, target: 'splash-nav'} : {} ) }
|
||||||
= render 'layouts/navigation'
|
= render 'layouts/navigation'
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,7 @@ test:
|
||||||
|
|
||||||
production:
|
production:
|
||||||
<<: *defaults
|
<<: *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: ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue