Improve implementation of i18n for Install Flow following comments on #611

* Move install flow i18n logic to install_view.js (from options.js)
* Switch to using placeholders (instead of jQuery) for i18n messages with html.
* Switch to using moustache template instead of jQuery for i18n substitution.

// FREEBIE
This commit is contained in:
Sam Lanning 2016-01-17 10:54:34 +00:00 committed by lilia
parent 0825d3e22f
commit ac25b62fdc
6 changed files with 99 additions and 87 deletions

View file

@ -6,8 +6,30 @@
window.Whisper = window.Whisper || {};
Whisper.InstallView = Whisper.View.extend({
templateName: 'install_flow_template',
render_attributes: function() {
var installSignalHref = 'https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms';
var twitterHref = 'https://twitter.com/whispersystems';
return {
installWelcome: i18n('installWelcome'),
installTagline: i18n('installTagline'),
installGetStartedButton: i18n('installGetStartedButton'),
installSignalLink: this.i18n_with_link('installSignalLink', installSignalHref),
installIHaveSignalButton: i18n('installIHaveSignalButton'),
installFollowUs: this.i18n_with_link('installFollowUs', twitterHref),
installAndroidInstructions: i18n('installAndroidInstructions'),
installLinkingWithNumber: i18n('installLinkingWithNumber'),
installComputerName: i18n('installComputerName'),
installFinalButton: i18n('installFinalButton'),
installTooManyDevices: i18n('installTooManyDevices'),
ok: i18n('ok'),
};
},
initialize: function(options) {
this.counter = 0;
this.render();
this.$('#device-name').val(options.deviceName);
this.$('#step1').show();
},