From 3eccec705410ffb2886c09598d906662f3d31d4d Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 11 Jul 2016 17:36:53 +0200 Subject: [PATCH] better effort for translation --- customize.dist/main.js | 9 +++++---- www/code/main.js | 24 ++++++++++++------------ www/common/cryptpad-common.js | 4 ++++ www/common/messages.js | 30 ++++++++++++++++++++++++++---- www/common/toolbar.js | 4 ++-- www/pad/main.js | 23 +++++++++++------------ 6 files changed, 60 insertions(+), 34 deletions(-) diff --git a/customize.dist/main.js b/customize.dist/main.js index e51afb26c..11e17c061 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -1,10 +1,11 @@ define([ + '/common/messages.js', '/customize/DecorateToolbar.js', '/common/cryptpad-common.js', '/bower_components/lil-uri/uri.min.js', '/customize/email.js', '/bower_components/jquery/dist/jquery.min.js', -], function (DecorateToolbar, Cryptpad, LilUri, Email) { +], function (Messages, DecorateToolbar, Cryptpad, LilUri, Email) { var $ = window.$; var email = Email.makeScrambler(1); @@ -88,14 +89,14 @@ define([ 'class': 'remove', title: "forget '"+shortTitle + "'" }).text('✖').click(function () { - Cryptpad.confirm(fixHTML("Are you sure you'd like to forget this pad (" + shortTitle + ")?"), function (yes) { + Cryptpad.confirm(Messages.forgetPrompt + ' (' + fixHTML(shortTitle) + ')', function (yes) { if (!yes) { return; } forgetPad(pad.href); $row.fadeOut(750, function () { $row.remove(); if (!$table.find('tr').find('td').length) { $table.remove(); - $tryit.text("Try it out!"); + $tryit.text(Messages.tryIt); } }); }); @@ -120,7 +121,7 @@ define([ } if (hasRecent) { $('table').attr('style', ''); - $tryit.text('Your Recent pads (stored only in browser)'); + $tryit.text(Messages.recentPads); } }); diff --git a/www/code/main.js b/www/code/main.js index 0b9cda087..f4879f736 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -66,6 +66,7 @@ define([ if ($select && $select.val) { $select.val(mode); } }; + editor.setValue(Messages.codeInitialState); // HERE var setTheme = module.setTheme = (function () { var path = './theme/'; @@ -103,7 +104,7 @@ define([ var exportText = module.exportText = function () { var text = editor.getValue(); - Cryptpad.prompt('What would you like to name your file?', + Cryptpad.prompt(Messages.exportPrompt, document.title, function (filename) { if (filename === null) { return; } var blob = new Blob([text], { @@ -169,7 +170,7 @@ define([ var createChangeName = function(id, $container) { var buttonElmt = $container.find('#'+id)[0]; buttonElmt.addEventListener("click", function() { - Cryptpad.prompt("Change your name:", '', function (newName) { + Cryptpad.prompt(Messages.changeNamePrompt, '', function (newName) { if (!(typeof(newName) === 'string' && newName.trim())) { return; } var myUserNameTemp = newName.trim(); if(newName.trim().length > 32) { @@ -200,14 +201,14 @@ define([ /* add an export button */ var $export = $('