forked from External/greenlight
Merge pull request #31 from zach-chai/client_i18n
send translated strings to javascript
This commit is contained in:
commit
ef06c4133b
|
@ -21,12 +21,12 @@
|
||||||
loopJoin();
|
loopJoin();
|
||||||
} else {
|
} else {
|
||||||
sessionStatusRefresh($('.meeting-url').val());
|
sessionStatusRefresh($('.meeting-url').val());
|
||||||
showAlert($('.meeting-started-alert').html(), 4000);
|
showAlert(I18n.meeting_started, 4000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (data.action === 'meeting_ended') {
|
} else if (data.action === 'meeting_ended') {
|
||||||
sessionStatusRefresh($('.meeting-url').val());
|
sessionStatusRefresh($('.meeting-url').val());
|
||||||
showAlert($('.meeting-ended-alert').html(), 4000);
|
showAlert(I18n.meeting_ended, 4000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
rowData.published = data.published
|
rowData.published = data.published
|
||||||
table.row("#"+data.record_id).data(rowData).draw();
|
table.row("#"+data.record_id).data(rowData).draw();
|
||||||
|
|
||||||
var publish = (data.published) ? 'publish' : 'unpublish';
|
var published = (data.published) ? 'published' : 'unpublished';
|
||||||
showAlert($('.recording-'+publish+'-alert').html(), 4000);
|
showAlert(I18n['recording_'+published], 4000);
|
||||||
} else if (data.action === 'delete') {
|
} else if (data.action === 'delete') {
|
||||||
row.remove().draw();
|
row.remove().draw();
|
||||||
|
|
||||||
showAlert($('.recording-delete-alert').html(), 4000);
|
showAlert(I18n.recording_deleted, 4000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
html: true,
|
html: true,
|
||||||
trigger: 'focus',
|
trigger: 'focus',
|
||||||
title: function() {
|
title: function() {
|
||||||
return $(".delete-popover-title").html();
|
return I18n.are_you_sure;
|
||||||
},
|
},
|
||||||
content: function() {
|
content: function() {
|
||||||
return $(".delete-popover-body").html();
|
return $(".delete-popover-body").html();
|
||||||
|
|
|
@ -1,2 +1,17 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
def client_translations
|
||||||
|
locale = I18n.locale
|
||||||
|
if locale.length < 4
|
||||||
|
fallback_locale = I18n.fallbacks[locale].second
|
||||||
|
end
|
||||||
|
|
||||||
|
if fallback_locale
|
||||||
|
I18n.locale = fallback_locale
|
||||||
|
translations = I18n.t('.')
|
||||||
|
I18n.locale = locale
|
||||||
|
else
|
||||||
|
translations = I18n.t('.')
|
||||||
|
end
|
||||||
|
translations[:client]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,9 +29,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div hidden class="hidden-elements">
|
<div hidden class="hidden-elements">
|
||||||
<div class="delete-popover-title">
|
|
||||||
<%= t('are_you_sure') %>
|
|
||||||
</div>
|
|
||||||
<div class="delete-popover-body">
|
<div class="delete-popover-body">
|
||||||
<button type="button" class="btn btn-danger recording-delete">
|
<button type="button" class="btn btn-danger recording-delete">
|
||||||
<%= t('yes') %>
|
<%= t('yes') %>
|
||||||
|
@ -48,19 +45,4 @@
|
||||||
<span class="alert-message"></span>
|
<span class="alert-message"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="recording-publish-alert">
|
|
||||||
<%= t('recording_published') %>
|
|
||||||
</div>
|
|
||||||
<div class="recording-unpublish-alert">
|
|
||||||
<%= t('recording_unpublished') %>
|
|
||||||
</div>
|
|
||||||
<div class="recording-delete-alert">
|
|
||||||
<%= t('recording_deleted') %>
|
|
||||||
</div>
|
|
||||||
<div class="meeting-ended-alert">
|
|
||||||
<%= t('meeting_ended') %>
|
|
||||||
</div>
|
|
||||||
<div class="meeting-started-alert">
|
|
||||||
<%= t('meeting_started') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -49,3 +49,7 @@
|
||||||
<!-- End of Footer -->
|
<!-- End of Footer -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.I18n = <%= client_translations.to_json.html_safe %>
|
||||||
|
</script>
|
||||||
|
|
|
@ -22,7 +22,13 @@
|
||||||
en-US:
|
en-US:
|
||||||
actions: Actions
|
actions: Actions
|
||||||
are_you: Are you %{name}?
|
are_you: Are you %{name}?
|
||||||
|
client:
|
||||||
are_you_sure: Are you sure?
|
are_you_sure: Are you sure?
|
||||||
|
meeting_ended: Meeting was ended
|
||||||
|
meeting_started: Meeting was started
|
||||||
|
recording_deleted: Recording was deleted
|
||||||
|
recording_published: Recording was published
|
||||||
|
recording_unpublished: Recording was unpublished
|
||||||
date_recorded: Date Recorded
|
date_recorded: Date Recorded
|
||||||
duration: Duration
|
duration: Duration
|
||||||
end: End
|
end: End
|
||||||
|
@ -35,17 +41,12 @@ en-US:
|
||||||
join_session_user: Join %{name} session
|
join_session_user: Join %{name} session
|
||||||
login: login
|
login: login
|
||||||
logout: logout
|
logout: logout
|
||||||
meeting_ended: Meeting was ended
|
|
||||||
meeting_started: Meeting was started
|
|
||||||
my_room: my room
|
my_room: my room
|
||||||
no: No
|
no: No
|
||||||
oauth_signup: Signup for customized sessions
|
oauth_signup: Signup for customized sessions
|
||||||
past_recordings: Past Recordings
|
past_recordings: Past Recordings
|
||||||
powered_bigbluebutton: Powered by BigBlueButton
|
powered_bigbluebutton: Powered by BigBlueButton
|
||||||
presentation: Presentation
|
presentation: Presentation
|
||||||
recording_deleted: Recording was deleted
|
|
||||||
recording_published: Recording was published
|
|
||||||
recording_unpublished: Recording was unpublished
|
|
||||||
refresh_html: <a href="#" class="generate-link">Click refresh</a> to generate a new meeting URL
|
refresh_html: <a href="#" class="generate-link">Click refresh</a> to generate a new meeting URL
|
||||||
session_url_explanation: The session will be taking place using the following URL
|
session_url_explanation: The session will be taking place using the following URL
|
||||||
start: Start
|
start: Start
|
||||||
|
|
Loading…
Reference in New Issue