From f086492e5011aae8bcabdc104cf88c1207e80de2 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 14 Sep 2016 18:08:52 +0200 Subject: [PATCH 1/2] Improve the localization system Improve and enable the French translation --- customize.dist/BottomBar.html | 6 + customize.dist/DecorateToolbar.js | 4 +- customize.dist/index.html | 37 +++--- customize.dist/languageSelector.js | 49 ++++++++ customize.dist/messages.js | 90 ++++----------- customize.dist/privacy.html | 48 ++++---- customize.dist/terms.html | 16 +-- customize.dist/translations/messages.fr.js | 76 +++++++++---- customize.dist/translations/messages.js | 124 +++++++++++++++++++++ www/common/cryptpad-common.js | 6 + 10 files changed, 309 insertions(+), 147 deletions(-) create mode 100644 customize.dist/languageSelector.js create mode 100644 customize.dist/translations/messages.js diff --git a/customize.dist/BottomBar.html b/customize.dist/BottomBar.html index 03fdaf8b4..e5aeb9d3f 100644 --- a/customize.dist/BottomBar.html +++ b/customize.dist/BottomBar.html @@ -9,6 +9,12 @@ in + + +

-

This project uses the CKEditor Visual Editor, CodeMirror, and the ChainPad realtime engine.

+

-

How It Works

-

CryptPad uses a variant of the Operational transformation algorithm which is able to find distributed consensus using a Nakamoto Blockchain, a construct popularized by Bitcoin. This way the algorithm can avoid the need for a central server to resolve Operational Transform Edit Conflicts and without the need for resolving conflicts, the server can be kept unaware of the content which is being edited on the pad.

+

+

-

About

+

-

You can read more about our privacy policy and terms of service.

-

If you have any questions or comments, you can tweet us, open an issue on github, come say hi on irc (irc.freenode.net), or send us an email.

+

+

-
Try it out!
+
- - - - + + + + @@ -79,9 +78,9 @@
diff --git a/customize.dist/languageSelector.js b/customize.dist/languageSelector.js new file mode 100644 index 000000000..22426c0b4 --- /dev/null +++ b/customize.dist/languageSelector.js @@ -0,0 +1,49 @@ +define(['/bower_components/jquery/dist/jquery.min.js'], function() { + var $ = window.jQuery; + var out = {}; + + var LS_LANG = "CRYPTPAD_LANG"; + + var getStoredLanguage = function () { + return localStorage.getItem(LS_LANG); + }; + + var storeLanguage = function (l) { + localStorage.setItem(LS_LANG, l); + }; + + var getBrowserLanguage = function () { + return navigator.language || navigator.userLanguage;; + }; + + var getLanguage = out.getLanguage = function () { + return getStoredLanguage() || getBrowserLanguage(); + }; + + var main = out.main = function () { + var selector = $('#language-selector'); + if (!selector.length) { return; } + + // Select the current language in the list + var language = getLanguage(); + var option = $(selector).find('option[value="' + language + '"]'); + if ($(option).length) { + $(selector).val(language); + } + else { + $(selector).val('en'); + } + + // Listen for language change + $(selector).on('change', function () { + var newLanguage = $(selector).val(); + storeLanguage(newLanguage); + if (newLanguage !== language) { + window.location.reload(); + } + }); + + }; + + return out; +}); diff --git a/customize.dist/messages.js b/customize.dist/messages.js index df5abbe44..309ad35d0 100644 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -1,77 +1,31 @@ -define(function () { - var out = {}; +define(['/customize/languageSelector.js', + '/customize/translations/messages.js', + '/customize/translations/messages.fr.js', + '/bower_components/jquery/dist/jquery.min.js'], function(LS, Default, French) { + var $ = window.jQuery; - out.errorBox_errorType_disconnected = 'Connection Lost'; - out.errorBox_errorExplanation_disconnected = [ - 'Lost connection to server, you may reconnect by reloading the page or review your work ', - 'by clicking outside of this box.' - ].join(''); + var map = { + 'fr': French + }; - out.editingAlone = 'Editing alone'; - out.editingWithOneOtherPerson = 'Editing with one other person'; - out.editingWith = 'Editing with'; - out.otherPeople = 'other people'; - out.disconnected = 'Disconnected'; - out.synchronizing = 'Synchronizing'; - out.reconnecting = 'Reconnecting...'; - out.lag = 'Lag'; + var defaultLanguage = 'en'; - out.importButton = 'IMPORT'; - out.importButtonTitle = 'Import a document from a local file'; + var language = LS.getLanguage(); - out.exportButton = 'EXPORT'; - out.exportButtonTitle = 'Export this document to a local file'; - out.exportPrompt = 'What would you like to name your file?'; + if (!language || language === defaultLanguage || language === 'default' || !map[language]) { return Default; } - out.back = '⇐ Back'; - out.backToCryptpad = '⇐ Back to Cryptpad'; + var messages; - out.changeNameButton = 'Change name'; - out.changeNamePrompt = 'Change your name: '; + // Add the missing translated keys to the returned object + messages = $.extend(true, {}, Default, map[language]); - out.renameButton = 'RENAME'; - out.renameButtonTitle = 'Change the title under which this document is listed on your home page'; - out.renamePrompt = 'How would you like to title this pad?'; - out.renameConflict = 'Another pad already has that title'; + messages._getKey = function (key, argArray) { + if (!messages[key]) { return '?'; } + var text = messages[key]; + return text.replace(/\{(\d+)\}/g, function (str, p1) { + return argArray[p1] || null; + }); + }; - out.forgetButton = 'FORGET'; - out.forgetButtonTitle = 'remove this document from your home page listings'; - out.forgetPrompt = 'Clicking OK will remove the URL for this pad from localStorage, are you sure?'; - - out.disconnectAlert = 'Network connection lost!'; - - out.tryIt = 'Try it out!'; - out.recentPads = 'Your recent pads (stored only in your browser)'; - - out.okButton = 'OK (enter)'; - out.cancelButton = 'Cancel (esc)'; - - out.initialState = [ - '

', - 'This is CryptPad, the zero knowledge realtime collaborative editor.', - '
', - 'What you type here is encrypted so only people who have the link can access it.', - '
', - 'Even the server cannot see what you type.', - '

', - '

', - '', - 'What you see here, what you hear here, when you leave here, let it stay here', - '', - '

', - ].join(''); - - out.codeInitialState = [ - '/*\n', - ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', - ' What you type here is encrypted so only people who have the link can access it.\n', - ' Even the server cannot see what you type.\n', - ' What you see here, what you hear here, when you leave here, let it stay here.\n', - '*/' - ].join(''); - - out.loginText = '

Your username and password are used to generate a unique key which is never known by our server.

\n' + - '

Be careful not to forget your credentials, as they are impossible to recover

'; - - return out; + return messages; }); diff --git a/customize.dist/privacy.html b/customize.dist/privacy.html index 54e491e2b..5542c33d3 100644 --- a/customize.dist/privacy.html +++ b/customize.dist/privacy.html @@ -1,7 +1,7 @@ - Cryptpad: Zero Knowledge, Collaborative Real Time Editing + Cryptpad: Zero Knowledge, Collaborative Real Time Editing @@ -28,6 +28,7 @@ })(); } + @@ -40,42 +41,33 @@
-

Cryptpad Privacy Policy

+

-

What we know about you

-

As an application that is hosted on the web, Cryptpad has access to metadata exposed by the HTTP protocol. - This includes your IP address, and various other HTTP headers that can be used to identify your particular browser. - You can see what information your browser is sharing by visiting WhatIsMyBrowser.com. -

-

We use Piwik, an open source analytics platform, to learn more about our users. - Piwik tells us about how you found Cryptpad, via direct entry, through a search engine, or via a referral from another web service like Reddit or Twitter. - We also learn when you visit, what links you click while on our informational pages, and how long you stay on a particular page. -

+

+

+

- These analytics tools are only used on informational pages. We do not collect any information about your usage of our zero-knowledge applications. +

-

How we use what we learn

-

We use this information to make better decisions about promoting Cryptpad, by evaluating which of our past efforts were successful. - Information about your location lets us know whether we should consider providing better support for languages other than English. -

-

Information about your browser (whether it's a desktop or mobile operating system) helps us make decisions when prioritizing feature improvements. - Our development team is small, and we try to make choices that will improve as many users' experience as possible.

+

+

+

-

What we tell others about you

-

We do not furnish to third parties the information that we gather or that you provide to us unless we are legally required to do so.

+

+

-

Links to other sites

-

This site contains links to other sites, including those produced by other organizations. We are not responsible for the privacy practices or the contents of any outside sites. As a general rule, links to outside sites are launched in a new browser window, to make clear that you are leaving Cryptpad.fr.

+

+

-

Advertisement

-

We do not display any online advertising, though we may link to the bodies which are financing our research.

+

+

-

Choices you have

-

Our code is open source, so you always have the option of hosting your own instance of Cryptpad.

-

If you want to use our hosted instance, but don't want to expose your IP address, you can protect your IP using the Tor browser bundle, or a VPN.

-

If you just want to block our analytics platform, you can use adblocking tools like Privacy Badger.

+

+

+

+


diff --git a/customize.dist/terms.html b/customize.dist/terms.html index ac9ef001c..a00247448 100644 --- a/customize.dist/terms.html +++ b/customize.dist/terms.html @@ -1,7 +1,7 @@ - Cryptpad: Zero Knowledge, Collaborative Real Time Editing + Cryptpad: Zero Knowledge, Collaborative Real Time Editing @@ -28,6 +28,7 @@ })(); } + @@ -40,15 +41,14 @@
-

Cryptpad Terms of Service

+

-

Please don't be malicious, abusive, or do anything illegal.

-

We hope you find this service useful, but availability or performance cannot be guaranteed. Please export your data regularly.

-

Cryptpad documents can be read or modified by anyone who can guess or otherwise obtain the document's fragment identifier. - We recommend that you use end-to-end-encrypted (e2ee) messaging technology to share URLs, and assume no liability in the event that such a URL is leaked.

-

Metadata provided by your browser to the server may be logged for the purpose of maintaining the service.

-

We do not provide individualized data to third parties unless required to by law.

+

+

+

+

+

diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 8e7682dc8..03e528543 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -17,7 +17,7 @@ define(function () { out.lag = 'Latence'; out.importButton = 'IMPORTER'; - out.importButtonTitle = 'Importer un document depuis un fichir local'; + out.importButtonTitle = 'Importer un document depuis un fichier local'; out.exportButton = 'EXPORTER'; out.exportButtonTitle = 'Exporter ce document vers un fichier local'; @@ -46,29 +46,59 @@ define(function () { out.okButton = 'OK (Entrée)'; out.cancelButton = 'Annuler (Echap)'; - out.initialState = [ - '

', - 'Voici CryptPad, l\'éditeur collaboratif en temps-réel "zero knowledge".', - '
', - 'Ce que vous tapez ici est crypté et donc seules les personnes possédant l\'adresse de la page y ont accès.', - '
', - 'Même le serveur ne peut pas voir ce que vous tapez.', - '

', - '

', - '', - 'Ce que vous voyez ici, ce que vous entendez ici, quand vous quittez, ça reste ici', - '', - '

', - ].join(''); + /* We don't want to change the initial states since they may interfere with Chainpad + * out.initialState = ''; + * out.codeInitialState = ''; + */ - out.codeInitialState = [ - '/*\n', - ' Voici Cryptpad, l\'éditeur collaboratif en temps-réel "zero knowledge".\n', - ' Ce que vous tapez ici est crypté et donc seules les personnes possédant l\'adresse de la page y ont accès.\n', - ' Même le serveur ne peut pas voir ce que vous tape.\n', - ' Ce que vous voyez ici, ce que vous entendez ici, quand vous quittez, ça reste ici.\n', - '*/' - ].join(''); + out.loginText = '

Votre nom d\'utilisateur et votre mot de passe sont utilisés pour générer une clé unique qui reste inconnue de notre serveur.

\n' + + '

Faites attention de ne pas oublier vos identifiants puisqu\'ils seront impossible à récupérer.

'; + + out.main_title = "Cryptpad: Editeur collaboratif en temps réel, zero knowledge"; + + out.main_p1 = 'CryptPad l\'éditeur collaboratif en temps réel zero knowledge. Le cryptage est effectué depuis votre navigateur, ce qui protège les données contre le serveur, le cloud, et la NSA. La clé de cryptage est stockée dans l\'identifieur de fragment de l\'URL qui n\'est jamais envoyée au serveur mais est accessible depuis javascript, de sorte qu\'en partageant l\'URL, vous donner l\'accès au pad à ceux qui souhaitent participer.'; + out.main_p2 = 'Ce projet utilise l\'éditeur visuel (WYSIWYG) CKEditor, l\'éditeur de code source CodeMirror, et le moteur temps-réel ChainPad.'; + out.main_howitworks = 'Comment ça fonctionne'; + out.main_howitworks_p1 = 'CryptPad utilise une variante de l\'algorithme d\'Operational transformation qui est capable de trouver un consensus distribué en utilisant une chaîne de bloc Nakamoto, un outil popularisé par le Bitcoin. De cette manière, l\'algorithme évite la nécessité d\'utiliser un serveur central pour résoudre les conflits d\'édition de l\'Operational Transformation, et sans ce besoin de résolution des conflits le serveur peut rester ignorant du contenu qui est édité dans le pad.'; + out.main_about = 'À propos'; + out.main_about_p1 = 'Vous pouvez en apprendre davantage sur notre politique de confidentialité et nos conditions d\'utilisation.'; + out.main_about_p2 = 'Si vous avez des questions ou commentaires, vous pouvez nous tweeter, ouvrir une issue sur Github, venir dire bonjour sur IRC (irc.freenode.net), ou nous envoyer un email.'; + out.main_oops = 'OUPS Afin de pouvoir réaliser le cryptage depuis votre navigateur, Javascript est vraiment requis.'; + + out.table_type = 'Type'; + out.table_link = 'Lien'; + out.table_created = 'Créé le'; + out.table_last = 'Dernier accès'; + + out.button_newpad = 'CRÉER UN PAD WYSIWYG'; + out.button_newcode = 'CRÉER UN PAD DE CODE'; + out.button_newpoll = 'CRÉER UN SONDAGE'; + + out.policy_title = 'Politique de confidentialité de Cryptpad'; + out.policy_whatweknow = 'Ce que nous savons de vous'; + out.policy_whatweknow_p1 = 'En tant qu\'application hébergée sur le web, Cryptpad a accès aux meta-données exposées par le protocole HTTP. Ceci inclus votre adresse IP et d\'autres en-têtes HTTP qui peuvent être utilisées pour identifier votre propre navigateur. Vous pouvez voir quelles informations votre navigateur partage en visitant WhatIsMyBrowser.com.'; + out.policy_whatweknow_p2 = 'Nous utilisons Piwik, une plateforme open source d\'analytique, afin d\'en apprendre plus sur nos utilisateurs. Piwik nous indique comment vous avez trouvé Cryptpad, que ce soit par une entrée directe, par un moteur de recherche ou depuis un lien provenant d\'un autre site web tel que Reddit ou Twitter. Nous savons également quand vous visitez le site, sur quels liens vous cliquez dans les pages informatives et combien de temps vous restez sur une page donnée.'; + out.policy_whatweknow_p3 = 'Ces outils d\'analytique sont utilisés uniquement sur les pages informatives. Nous ne collectons aucune information concernant votre utilisation de nos applications "zero knowledge".'; + out.policy_howweuse = 'Comment nous utilisons ce que nous apprenons'; + out.policy_howweuse_p1 = 'Nous utilisons ces informations pour prendre de meilleures décisions concernant la communication autour de Cryptpad, en évaluant le succès de ce qui a été realisé par le passé. Les informations concernant votre localisation nous permettent de savoir si nous devons considérer l\'ajout de traductions de Cryptpad dans d\'autres langues que l\'anglais.'; + out.policy_howweuse_p2 = "Les informations concernant votre navigateur (que ce soit un système d\'exploitation de bureau ou d\'appareil portable) nous aident à prendre des décisions lors de la priorisation des ajouts et améliorations de fonctionnalités. Notre équipe de développement est petite, et nous essayons de prendre des décisions qui amélioreront l\'expérience du plus grand nombre d\'utilisateurs possible."; + out.policy_whatwetell = 'Ce que nous dévoilons à d\'autres à propos de vous'; + out.policy_whatwetell_p1 = 'Nous ne fournissons aucune information que nous récoltons ou que vous nous fournissez à des tierces parties à moins d\'y être contraints par la loi.'; + out.policy_links = 'Liens vers d\'autres sites'; + out.policy_links_p1 = 'Ce site contient des liens vers d\'autres sites, certains étant produits par d\'autres organisations. Nous ne sommes responsables des pratiques de confidentialité ou du contenu d\'aucun site externe. De manière générale, les liens vers des sites externes sont lancés dans une nouvelle fenêtre (ou onglet) du navigateur, pour rendre clair le fait que vous quittez Cryptpad.fr.'; + out.policy_ads = 'Publicité'; + out.policy_ads_p1 = 'Nous n\'affichons pas de publicité en ligne, bien que nous puissions afficher des liens vers les sites des organisations qui financent nos recherches.'; + out.policy_choices = 'Vos choix'; + out.policy_choices_open = 'Notre code est open source, ce qui signifie que vous avez toujours la possibilité d\'héberger votre propre instance de Cryptpad.'; + out.policy_choices_vpn = 'Si vous souhaitez utiliser notre instance hébergée (cryptpad.fr) mais que vous ne souhaitez pas exposer votre adresse IP, vous pouvez la protéger en utilisant le navigateur Tor, ou un VPN.'; + out.policy_choices_ads = 'Si vous souhaitez uniquement bloquer notre plateforme d\'analytique, vous pouvez utiliser un bloqueur de publicités tel que Privacy Badger.'; + + out.tos_title = "Conditions d'utilisation de Cryptpad"; + out.tos_legal = "Veuillez ne pas être malveillant, abusif, ou faire quoi que ce soit d'illégal."; + out.tos_availability = "Nous espérons que vous trouvez ce service utile, mais nous ne pouvons garantir ses performances et disponibilités. Nous vous recommandons d'exporter vos données régurlièrement."; + out.tos_e2ee = "Les document sur Cryptpad peuvent être lus et modifiés par quiconque est en mesure de deviner ou d'obtenir de quelque manière que ce soit l'identificateur de fragment (hash) du document. Nous vous recommandons d'utiliser des technologies de messagerie cryptées de bout à bout (end-to-end encryption ou e2ee) pour partager les URLs, et déclinons toute responsabilité dans le cas ou une telle URL serait divulguée."; + out.tos_logs = "Les meta-données fournies par votre navigateur au serveur peuvent être enregistrées dans le but de maintenir le service."; + out.tos_3rdparties = "Nous ne fournissons aucune donnée individuelle à des tierces parties à moins d'y être contraints par la loi."; return out; }); diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js new file mode 100644 index 000000000..1db8779e4 --- /dev/null +++ b/customize.dist/translations/messages.js @@ -0,0 +1,124 @@ +define(function () { + var out = {}; + + out.errorBox_errorType_disconnected = 'Connection Lost'; + out.errorBox_errorExplanation_disconnected = [ + 'Lost connection to server, you may reconnect by reloading the page or review your work ', + 'by clicking outside of this box.' + ].join(''); + + out.editingAlone = 'Editing alone'; + out.editingWithOneOtherPerson = 'Editing with one other person'; + out.editingWith = 'Editing with'; + out.otherPeople = 'other people'; + out.disconnected = 'Disconnected'; + out.synchronizing = 'Synchronizing'; + out.reconnecting = 'Reconnecting...'; + out.lag = 'Lag'; + + out.importButton = 'IMPORT'; + out.importButtonTitle = 'Import a document from a local file'; + + out.exportButton = 'EXPORT'; + out.exportButtonTitle = 'Export this document to a local file'; + out.exportPrompt = 'What would you like to name your file?'; + + out.back = '⇐ Back'; + out.backToCryptpad = '⇐ Back to Cryptpad'; + + out.changeNameButton = 'Change name'; + out.changeNamePrompt = 'Change your name: '; + + out.renameButton = 'RENAME'; + out.renameButtonTitle = 'Change the title under which this document is listed on your home page'; + out.renamePrompt = 'How would you like to title this pad?'; + out.renameConflict = 'Another pad already has that title'; + + out.forgetButton = 'FORGET'; + out.forgetButtonTitle = 'remove this document from your home page listings'; + out.forgetPrompt = 'Clicking OK will remove the URL for this pad from localStorage, are you sure?'; + + out.disconnectAlert = 'Network connection lost!'; + + out.tryIt = 'Try it out!'; + out.recentPads = 'Your recent pads (stored only in your browser)'; + + out.okButton = 'OK (enter)'; + out.cancelButton = 'Cancel (esc)'; + + out.initialState = [ + '

', + 'This is CryptPad, the zero knowledge realtime collaborative editor.', + '
', + 'What you type here is encrypted so only people who have the link can access it.', + '
', + 'Even the server cannot see what you type.', + '

', + '

', + '', + 'What you see here, what you hear here, when you leave here, let it stay here', + '', + '

', + ].join(''); + + out.codeInitialState = [ + '/*\n', + ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', + ' What you type here is encrypted so only people who have the link can access it.\n', + ' Even the server cannot see what you type.\n', + ' What you see here, what you hear here, when you leave here, let it stay here.\n', + '*/' + ].join(''); + + out.loginText = '

Your username and password are used to generate a unique key which is never known by our server.

\n' + + '

Be careful not to forget your credentials, as they are impossible to recover

'; + + + out.main_title = "Cryptpad: Zero Knowledge, Collaborative Real Time Editing"; + + out.main_p1 = 'CryptPad is the zero knowledge realtime collaborative editor. Encryption carried out in your web browser protects the data from the server, the cloud, and the NSA. The secret encryption key is stored in the URL fragment identifier which is never sent to the server but is available to javascript so by sharing the URL, you give authorization to others who want to participate.'; + out.main_p2 = 'This project uses the CKEditor Visual Editor, CodeMirror, and the ChainPad realtime engine.'; + out.main_howitworks = 'How It Works'; + out.main_howitworks_p1 = 'CryptPad uses a variant of the Operational transformation algorithm which is able to find distributed consensus using a Nakamoto Blockchain, a construct popularized by Bitcoin. This way the algorithm can avoid the need for a central server to resolve Operational Transform Edit Conflicts and without the need for resolving conflicts, the server can be kept unaware of the content which is being edited on the pad.'; + out.main_about = 'About'; + out.main_about_p1 = 'You can read more about our privacy policy and terms of service.'; + out.main_about_p2 = 'If you have any questions or comments, you can tweet us, open an issue on github, come say hi on irc (irc.freenode.net), or send us an email.'; + out.main_oops = 'OOPS In order to do encryption in your browser, Javascript is really really required.'; + + out.table_type = 'Type'; + out.table_link = 'Link'; + out.table_created = 'Created'; + out.table_last = 'Last Accessed'; + + out.button_newpad = 'CREATE NEW WYSIWYG PAD'; + out.button_newcode = 'CREATE NEW CODE PAD'; + out.button_newpoll = 'CREATE NEW POLL'; + + out.policy_title = 'Cryptpad Privacy Policy'; + out.policy_whatweknow = 'What we know about you'; + out.policy_whatweknow_p1 = 'As an application that is hosted on the web, Cryptpad has access to metadata exposed by the HTTP protocol. This includes your IP address, and various other HTTP headers that can be used to identify your particular browser. You can see what information your browser is sharing by visiting WhatIsMyBrowser.com.'; + out.policy_whatweknow_p2 = 'We use Piwik, an open source analytics platform, to learn more about our users. Piwik tells us about how you found Cryptpad, via direct entry, through a search engine, or via a referral from another web service like Reddit or Twitter. We also learn when you visit, what links you click while on our informational pages, and how long you stay on a particular page.'; + out.policy_whatweknow_p3 = 'These analytics tools are only used on informational pages. We do not collect any information about your usage of our zero-knowledge applications.'; + out.policy_howweuse = 'How we use what we learn'; + out.policy_howweuse_p1 = 'We use this information to make better decisions about promoting Cryptpad, by evaluating which of our past efforts were successful. Information about your location lets us know whether we should consider providing better support for languages other than English.'; + out.policy_howweuse_p2 = "Information about your browser (whether it's a desktop or mobile operating system) helps us make decisions when prioritizing feature improvements. Our development team is small, and we try to make choices that will improve as many users' experience as possible."; + out.policy_whatwetell = 'What we tell others about you'; + out.policy_whatwetell_p1 = 'We do not furnish to third parties the information that we gather or that you provide to us unless we are legally required to do so.'; + out.policy_links = 'Links to other sites'; + out.policy_links_p1 = 'This site contains links to other sites, including those produced by other organizations. We are not responsible for the privacy practices or the contents of any outside sites. As a general rule, links to outside sites are launched in a new browser window, to make clear that you are leaving Cryptpad.fr.'; + out.policy_ads = 'Advertisement'; + out.policy_ads_p1 = 'We do not display any online advertising, though we may link to the bodies which are financing our research.'; + out.policy_choices = 'Choices you have'; + out.policy_choices_open = 'Our code is open source, so you always have the option of hosting your own instance of Cryptpad.'; + out.policy_choices_vpn = 'If you want to use our hosted instance, but don\'t want to expose your IP address, you can protect your IP using the Tor browser bundle, or a VPN.'; + out.policy_choices_ads = 'If you just want to block our analytics platform, you can use adblocking tools like Privacy Badger.'; + + out.tos_title = "Cryptpad Terms of Service"; + out.tos_legal = "Please don't be malicious, abusive, or do anything illegal."; + out.tos_availability = "We hope you find this service useful, but availability or performance cannot be guaranteed. Please export your data regularly."; + out.tos_e2ee = "Cryptpad documents can be read or modified by anyone who can guess or otherwise obtain the document's fragment identifier. We recommend that you use end-to-end-encrypted (e2ee) messaging technology to share URLs, and assume no liability in the event that such a URL is leaked."; + out.tos_logs = "Metadata provided by your browser to the server may be logged for the purpose of maintaining the service."; + out.tos_3rdparties = "We do not provide individualized data to third parties unless required to by law."; + + return out; +}); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 4da9816af..1b294bd9a 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -643,5 +643,11 @@ define([ }; }; + $('[data-localization]').each(function (i, e) { + var $el = $(this); + var key = $el.data('localization'); + $el.html(Messages[key]); + }); + return common; }); From 5c635859526a34ff390af0ce996eedc75d9a882c Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 15 Sep 2016 18:35:09 +0200 Subject: [PATCH 2/2] Complete the French translation --- customize.dist/BottomBar.html | 33 ++----- customize.dist/DecorateToolbar.js | 4 +- customize.dist/main.css | 5 + customize.dist/main.js | 10 +- customize.dist/messages.js | 50 +++++++++- customize.dist/translations/messages.fr.js | 90 +++++++++++++++--- customize.dist/translations/messages.js | 102 +++++++++++++++------ www/common/cryptpad-common.js | 6 +- www/common/toolbar.js | 2 +- www/poll/index.html | 26 +++--- www/poll/main.js | 45 +++++---- www/slide/main.js | 18 ++-- 12 files changed, 266 insertions(+), 125 deletions(-) diff --git a/customize.dist/BottomBar.html b/customize.dist/BottomBar.html index e5aeb9d3f..70eb8ee86 100644 --- a/customize.dist/BottomBar.html +++ b/customize.dist/BottomBar.html @@ -2,38 +2,21 @@
-

- - Made with - - in - - - - - +

+ + +
-

- - An - XWiki SAS Labs Project with the support of - OpenPaaS-ng - - +

diff --git a/customize.dist/DecorateToolbar.js b/customize.dist/DecorateToolbar.js index 3b5251805..bee23e500 100644 --- a/customize.dist/DecorateToolbar.js +++ b/customize.dist/DecorateToolbar.js @@ -3,8 +3,9 @@ */ define([ '/customize/languageSelector.js', + '/customize/messages.js', '/bower_components/jquery/dist/jquery.min.js' -], function (LS) { +], function (LS, Messages) { var $ = window.jQuery; var main = function () { $.ajax({ @@ -17,6 +18,7 @@ define([ href: '/customize/main.css' })); LS.main(); + Messages._applyTranslation(); } }); }; diff --git a/customize.dist/main.css b/customize.dist/main.css index 5511f5ae2..fc7a13de9 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -147,8 +147,13 @@ tr { margin-top: 12px; margin-bottom: 12px; white-space: nowrap; +} +.create { display: none; } +.action { + display: inline-block; +} /* Tables */ table { border-collapse: collapse; diff --git a/customize.dist/main.js b/customize.dist/main.js index d51f5b26f..3e9eab3b5 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -28,10 +28,10 @@ define([ Cryptpad.styleAlerts(); var padTypes = { - '/pad/': 'Pad', - '/code/': 'Code', - '/poll/': 'Poll', - '/slide/': 'Presentation', + '/pad/': Messages.type.pad, + '/code/': Messages.type.code, + '/poll/': Messages.type.poll, + '/slide/': Messages.type.slide, }; var $table = $('table.scroll'); @@ -85,7 +85,7 @@ define([ var $remove = $('', { 'class': 'remove', - title: "forget '"+shortTitle + "'" + title: Messages.forget + " '"+shortTitle + "'" }).text('✖').click(function () { Cryptpad.confirm(Messages.forgetPrompt + ' (' + Cryptpad.fixHTML(shortTitle) + ')', function (yes) { if (!yes) { return; } diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 309ad35d0..1b21b9835 100644 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -12,13 +12,17 @@ define(['/customize/languageSelector.js', var language = LS.getLanguage(); - if (!language || language === defaultLanguage || language === 'default' || !map[language]) { return Default; } - var messages; - // Add the missing translated keys to the returned object - messages = $.extend(true, {}, Default, map[language]); + if (!language || language === defaultLanguage || language === 'default' || !map[language]) { + messages = Default; + } + else { + // Add the translated keys to the returned object + messages = $.extend(true, {}, Default, map[language]); + } + // Get keys with parameters messages._getKey = function (key, argArray) { if (!messages[key]) { return '?'; } var text = messages[key]; @@ -27,5 +31,43 @@ define(['/customize/languageSelector.js', }); }; + messages._applyTranslation = function () { + $('[data-localization]').each(function (i, e) { + var $el = $(this); + var key = $el.data('localization'); + $el.html(messages[key]); + }); + $('[data-localization-title]').each(function (i, e) { + var $el = $(this); + var key = $el.data('localization-title'); + $el.attr('title', messages[key]); + }); + }; + + // Non translatable keys + messages.initialState = [ + '

', + 'This is CryptPad, the zero knowledge realtime collaborative editor.', + '
', + 'What you type here is encrypted so only people who have the link can access it.', + '
', + 'Even the server cannot see what you type.', + '

', + '

', + '', + 'What you see here, what you hear here, when you leave here, let it stay here', + '', + '

', + ].join(''); + + messages.codeInitialState = [ + '/*\n', + ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', + ' What you type here is encrypted so only people who have the link can access it.\n', + ' Even the server cannot see what you type.\n', + ' What you see here, what you hear here, when you leave here, let it stay here.\n', + '*/' + ].join(''); + return messages; }); diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 4d808c90b..4ddd2a2f6 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -1,15 +1,20 @@ define(function () { var out = {}; + out.main_title = "Cryptpad: Editeur collaboratif en temps réel, zero knowledge"; + + out.errorBox_errorType_disconnected = 'Connexion perdue'; out.errorBox_errorExplanation_disconnected = [ 'La connexion au serveur a été perdue. Vous pouvez essayer de vous reconnecter en rechargeant la page', 'ou vous pouvez revoir votre travail en fermant cette boîte de dialogue.', ].join(''); - out.editingAlone = 'Edition seul(e)'; - out.editingWithOneOtherPerson = 'Edition avec une autre personne'; - out.editingWith = 'Edition avec'; + out.common_connectionLost = 'Connexion au serveur perdue'; + + out.editingAlone = 'Pas d\'autre participant'; + out.editingWithOneOtherPerson = 'Édition avec une autre personne'; + out.editingWith = 'Édition avec'; out.otherPeople = 'autres personnes'; out.disconnected = 'Déconnecté'; out.synchronizing = 'Synchronisation'; @@ -24,7 +29,7 @@ define(function () { out.exportPrompt = 'Comment souhaitez-vous nommer ce fichier ?'; out.back = '⇐ Retour'; - out.backToCryptpad = '⇐ Retour vers Cryptpad'; + out.backToCryptpad = '⇐ Retour vers Cryptpad'; out.changeNameButton = 'Changer de nom'; out.changeNamePrompt = 'Changer votre nom : '; @@ -38,6 +43,17 @@ define(function () { out.forgetButtonTitle = 'Enlever ce document de la liste en page d\'accueil'; out.forgetPrompt = 'Cliquer sur OK supprimera l\'URL de ce document de la mémoire de votre navigateur (localStorage), êtes-vous sûr ?'; + out.shareButton = 'PARTAGER'; + out.shareButtonTitle = "Copier l'URL dans le presse-papiers"; + out.shareSuccess = 'URL copiée dans le presse-papiers'; + out.shareFailed = "Échec de la copie de l'URL dans le presse-papiers"; + + out.presentButton = 'PRÉSENTER'; + out.presentButtonTitle = "Entrer en mode présentation"; + out.presentSuccess = 'Appuyer sur Échap pour quitter le mode présentation'; + + out.commitButton = 'VALIDER'; + out.disconnectAlert = 'Perte de la connexion au réseau !'; out.tryIt = 'Essayez-le !'; @@ -46,11 +62,6 @@ define(function () { out.okButton = 'OK (Entrée)'; out.cancelButton = 'Annuler (Echap)'; - /* We don't want to change the initial states since they may interfere with Chainpad - * out.initialState = ''; - * out.codeInitialState = ''; - */ - out.loginText = '

Votre nom d\'utilisateur et votre mot de passe sont utilisés pour générer une clé unique qui reste inconnue de notre serveur.

\n' + '

Faites attention de ne pas oublier vos identifiants puisqu\'ils seront impossible à récupérer.

'; @@ -60,9 +71,55 @@ define(function () { out.type.poll = 'Sondage'; out.type.slide = 'Présentation'; - out.main_title = "Cryptpad: Editeur collaboratif en temps réel, zero knowledge"; - - out.main_p1 = 'CryptPad l\'éditeur collaboratif en temps réel zero knowledge. Le cryptage est effectué depuis votre navigateur, ce qui protège les données contre le serveur, le cloud, et la NSA. La clé de cryptage est stockée dans l\'identifieur de fragment de l\'URL qui n\'est jamais envoyée au serveur mais est accessible depuis javascript, de sorte qu\'en partageant l\'URL, vous donner l\'accès au pad à ceux qui souhaitent participer.'; + out.forget = "Oublier"; + + // Polls + + out.poll_title = "Sélecteur de date Zero Knowledge"; + out.poll_subtitle = "Planification de rendez-vous et sondages en temps-réel et Zero Knowledge"; + + out.poll_p_save = "Vos modifications sont mises à jour instantanément, donc vous n'avez jamais besoin de sauver le contenu."; + out.poll_p_encryption = "Tout ce que vous entrez est crypté donc seules les personnes possédant le lien du sondage y ont accès. Même le serveur ne peut pas voir le contenu."; + out.poll_p_howtouse = "Entrez votre nom dans le champ ci-dessous et cochez les cases lorsque les options vous conviennent."; + + out.promptName = "Quel est votre nom ?"; + + out.wizardButton = 'ASSISTANT'; + out.wizardLog = "Cliquez sur le bouton dans le coin supérieur gauche pour retourner au sondage"; + out.wizardTitle = "Utiliser l'assistant pour créer votre sondage"; + out.wizardConfirm = "Êtes-vous vraiment prêt à ajouter ces options au sondage ?"; + + out.poll_closeWizardButton = "Fermer l'assistant"; + out.poll_closeWizardButtonTitle = "Fermer l'assistant"; + out.poll_wizardComputeButton = "Générer les options"; + out.poll_wizardClearButton = "Vider le tableau"; + out.poll_wizardDescription = "Créer automatiquement des options en entrant des dates et des horaires correspondant"; + out.poll_wizardAddDateButton = "+ Dates"; + out.poll_wizardAddTimeButton = "+ Horaires"; + + out.poll_addUserButton = "+ Utilisateurs"; + out.poll_addUserButtonTitle = "Cliquer pour ajouter un utilisateur"; + out.poll_addOptionButton = "+ Options"; + out.poll_addOptionButtonTitle = "Cliquer pour ajouter une option"; + out.poll_addOption = "Indiquer la nouvelle option"; + out.poll_optionPlaceholder = "Option"; + out.poll_addUser = "Entrer un nom"; + out.poll_userPlaceholder = "Votre nom"; + out.poll_removeOption = "Êtes-vous sûr de vouloir supprimer cette option ?"; + out.poll_removeOptionTitle = "Supprimer la ligne"; + out.poll_removeUser = "Êtes-vous sûr de vouloir supprimer cet utilisateur ?"; + out.poll_removeUserTitle = "Supprimer la colonne"; + out.poll_editOption = "Êtes-vous sûr de vouloir éditer cette option ?"; + out.poll_editOptionTitle = "Éditer la ligne"; + out.poll_editUser = "Êtes-vous sûr de vouloir éditer les choix de cet utilisateur ?"; + out.poll_editUserTitle = "Éditer la colonne"; + + out.poll_titleHint = "Titre"; + out.poll_descriptionHint = "Description"; + + // index.html + + out.main_p1 = 'CryptPad est l\'éditeur collaboratif en temps réel zero knowledge. Le cryptage est effectué depuis votre navigateur, ce qui protège les données contre le serveur, le cloud, et la NSA. La clé de cryptage est stockée dans l\'identifieur de fragment de l\'URL qui n\'est jamais envoyée au serveur mais est accessible depuis javascript, de sorte qu\'en partageant l\'URL, vous donner l\'accès au pad à ceux qui souhaitent participer.'; out.main_p2 = 'Ce projet utilise l\'éditeur visuel (WYSIWYG) CKEditor, l\'éditeur de code source CodeMirror, et le moteur temps-réel ChainPad.'; out.main_howitworks = 'Comment ça fonctionne'; out.main_howitworks_p1 = 'CryptPad utilise une variante de l\'algorithme d\'Operational transformation qui est capable de trouver un consensus distribué en utilisant une chaîne de bloc Nakamoto, un outil popularisé par le Bitcoin. De cette manière, l\'algorithme évite la nécessité d\'utiliser un serveur central pour résoudre les conflits d\'édition de l\'Operational Transformation, et sans ce besoin de résolution des conflits le serveur peut rester ignorant du contenu qui est édité dans le pad.'; @@ -81,6 +138,8 @@ define(function () { out.button_newpoll = 'CRÉER UN SONDAGE'; out.button_newslide = 'CRÉER UNE PRÉSENTATION'; + // privacy.html + out.policy_title = 'Politique de confidentialité de Cryptpad'; out.policy_whatweknow = 'Ce que nous savons de vous'; out.policy_whatweknow_p1 = 'En tant qu\'application hébergée sur le web, Cryptpad a accès aux meta-données exposées par le protocole HTTP. Ceci inclus votre adresse IP et d\'autres en-têtes HTTP qui peuvent être utilisées pour identifier votre propre navigateur. Vous pouvez voir quelles informations votre navigateur partage en visitant WhatIsMyBrowser.com.'; @@ -100,6 +159,8 @@ define(function () { out.policy_choices_vpn = 'Si vous souhaitez utiliser notre instance hébergée (cryptpad.fr) mais que vous ne souhaitez pas exposer votre adresse IP, vous pouvez la protéger en utilisant le navigateur Tor, ou un VPN.'; out.policy_choices_ads = 'Si vous souhaitez uniquement bloquer notre plateforme d\'analytique, vous pouvez utiliser un bloqueur de publicités tel que Privacy Badger.'; + // terms.html + out.tos_title = "Conditions d'utilisation de Cryptpad"; out.tos_legal = "Veuillez ne pas être malveillant, abusif, ou faire quoi que ce soit d'illégal."; out.tos_availability = "Nous espérons que vous trouvez ce service utile, mais nous ne pouvons garantir ses performances et disponibilités. Nous vous recommandons d'exporter vos données régurlièrement."; @@ -107,5 +168,10 @@ define(function () { out.tos_logs = "Les meta-données fournies par votre navigateur au serveur peuvent être enregistrées dans le but de maintenir le service."; out.tos_3rdparties = "Nous ne fournissons aucune donnée individuelle à des tierces parties à moins d'y être contraints par la loi."; + // BottomBar.html + + out.bottom_love = 'Fait avec en '; + out.bottom_support = 'Un projet XWiki SAS Labs avec le soutien de OpenPaaS-ng'; + return out; }); diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index d1fd3a29f..3a43d9209 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -1,12 +1,17 @@ define(function () { var out = {}; + out.main_title = "Cryptpad: Zero Knowledge, Collaborative Real Time Editing"; + + out.errorBox_errorType_disconnected = 'Connection Lost'; out.errorBox_errorExplanation_disconnected = [ 'Lost connection to server, you may reconnect by reloading the page or review your work ', 'by clicking outside of this box.' ].join(''); + out.common_connectionLost = 'Server Connection Lost'; + out.editingAlone = 'Editing alone'; out.editingWithOneOtherPerson = 'Editing with one other person'; out.editingWith = 'Editing with'; @@ -24,7 +29,7 @@ define(function () { out.exportPrompt = 'What would you like to name your file?'; out.back = '⇐ Back'; - out.backToCryptpad = '⇐ Back to Cryptpad'; + out.backToCryptpad = '⇐ Back to Cryptpad'; out.changeNameButton = 'Change name'; out.changeNamePrompt = 'Change your name: '; @@ -38,48 +43,82 @@ define(function () { out.forgetButtonTitle = 'remove this document from your home page listings'; out.forgetPrompt = 'Clicking OK will remove the URL for this pad from localStorage, are you sure?'; + out.shareButton = 'SHARE'; + out.shareButtonTitle = "Copy URL to clipboard"; + out.shareSuccess = 'Copied URL to clipboard'; + out.shareFailed = "Failed to copy URL to clipboard"; + + out.presentButton = 'PRESENT'; + out.presentButtonTitle = "Enter presentation mode"; + out.presentSuccess = 'Hit ESC to exit presentation mode'; + + out.commitButton = 'COMMIT'; + out.disconnectAlert = 'Network connection lost!'; - out.tryIt = 'Try it out!'; + out.tryIt = ' out!'; out.recentPads = 'Your recent pads (stored only in your browser)'; out.okButton = 'OK (enter)'; out.cancelButton = 'Cancel (esc)'; - out.initialState = [ - '

', - 'This is CryptPad, the zero knowledge realtime collaborative editor.', - '
', - 'What you type here is encrypted so only people who have the link can access it.', - '
', - 'Even the server cannot see what you type.', - '

', - '

', - '', - 'What you see here, what you hear here, when you leave here, let it stay here', - '', - '

', - ].join(''); - - out.codeInitialState = [ - '/*\n', - ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', - ' What you type here is encrypted so only people who have the link can access it.\n', - ' Even the server cannot see what you type.\n', - ' What you see here, what you hear here, when you leave here, let it stay here.\n', - '*/' - ].join(''); - out.loginText = '

Your username and password are used to generate a unique key which is never known by our server.

\n' + '

Be careful not to forget your credentials, as they are impossible to recover

'; + // TODO : move at the beginning out.type = {}; out.type.pad = 'Pad'; out.type.code = 'Code'; out.type.poll = 'Poll'; out.type.slide = 'Presentation'; - out.main_title = "Cryptpad: Zero Knowledge, Collaborative Real Time Editing"; + out.forget = "Forget"; + + // Polls + + out.poll_title = "Zero Knowledge Date Picker"; + out.poll_subtitle = "Zero Knowledge, realtime scheduling"; + + out.poll_p_save = "Your settings are updated instantly, so you never need to save."; + out.poll_p_encryption = "All your input is encrypted so only people who have the link can access it. Even the server cannot see what you change."; + out.poll_p_howtouse = "Enter your name in the input field below and check the box for times when you are available"; + + out.promptName = "What is you name ?"; + + out.wizardButton = 'WIZARD'; + out.wizardLog = "Click the button in the top left to return to your poll"; + out.wizardTitle = "Use the wizard to create your poll"; + out.wizardConfirm = "Are you really ready to add these options to your poll?"; + + out.poll_closeWizardButton = "Close wizard"; + out.poll_closeWizardButtonTitle = "Close wizard"; + out.poll_wizardComputeButton = "Compute Options"; + out.poll_wizardClearButton = "Clear Table"; + out.poll_wizardDescription = "Automatically create a number of options by entering any number of dates and times segments"; + out.poll_wizardAddDateButton = "+ Dates"; + out.poll_wizardAddTimeButton = "+ Times"; + + out.poll_addUserButton = "+ Users"; + out.poll_addUserButtonTitle = "Click to add a user"; + out.poll_addOptionButton = "+ Options"; + out.poll_addOptionButtonTitle = "Click to add an option"; + out.poll_addOption = "Propose an option"; + out.poll_optionPlaceholder = "Option"; + out.poll_addUser = "Enter a name"; + out.poll_userPlaceholder = "Your name"; + out.poll_removeOption = "Are you sure you'd like to remove this option?"; + out.poll_removeOptionTitle = "Remove the row"; + out.poll_removeUser = "Are you sure you'd like to remove this user?"; + out.poll_removeUserTitle = "Remove the column"; + out.poll_editOption = "Are you sure you'd like to edit this option?"; + out.poll_editOptionTitle = "Edit the row"; + out.poll_editUser = "Are you sure you'd like to edit this user?"; + out.poll_editUserTitle = "Edit the column"; + + out.poll_titleHint = "Title"; + out.poll_descriptionHint = "Description"; + + // index.html out.main_p1 = 'CryptPad is the zero knowledge realtime collaborative editor. Encryption carried out in your web browser protects the data from the server, the cloud, and the NSA. The secret encryption key is stored in the URL fragment identifier which is never sent to the server but is available to javascript so by sharing the URL, you give authorization to others who want to participate.'; out.main_p2 = 'This project uses the CKEditor Visual Editor, CodeMirror, and the ChainPad realtime engine.'; @@ -100,6 +139,8 @@ define(function () { out.button_newpoll = 'CREATE NEW POLL'; out.button_newslide = 'CREATE NEW PRESENTATION'; + // privacy.html + out.policy_title = 'Cryptpad Privacy Policy'; out.policy_whatweknow = 'What we know about you'; out.policy_whatweknow_p1 = 'As an application that is hosted on the web, Cryptpad has access to metadata exposed by the HTTP protocol. This includes your IP address, and various other HTTP headers that can be used to identify your particular browser. You can see what information your browser is sharing by visiting WhatIsMyBrowser.com.'; @@ -119,6 +160,8 @@ define(function () { out.policy_choices_vpn = 'If you want to use our hosted instance, but don\'t want to expose your IP address, you can protect your IP using the Tor browser bundle, or a VPN.'; out.policy_choices_ads = 'If you just want to block our analytics platform, you can use adblocking tools like Privacy Badger.'; + // terms.html + out.tos_title = "Cryptpad Terms of Service"; out.tos_legal = "Please don't be malicious, abusive, or do anything illegal."; out.tos_availability = "We hope you find this service useful, but availability or performance cannot be guaranteed. Please export your data regularly."; @@ -126,5 +169,10 @@ define(function () { out.tos_logs = "Metadata provided by your browser to the server may be logged for the purpose of maintaining the service."; out.tos_3rdparties = "We do not provide individualized data to third parties unless required to by law."; + // BottomBar.html + + out.bottom_love = 'Made with in '; + out.bottom_support = 'An XWiki SAS Labs Project with the support of OpenPaaS-ng'; + return out; }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 2fd171ffc..b740f9585 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -716,11 +716,7 @@ define([ }; }; - $('[data-localization]').each(function (i, e) { - var $el = $(this); - var key = $el.data('localization'); - $el.html(Messages[key]); - }); + Messages._applyTranslation(); return common; }); diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 956defc4d..954b6f499 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -224,7 +224,7 @@ define([ return { failed: function () { connected = false; - userListElement.textContent = 'Disconnected'; + userListElement.textContent = Messages.disconnected; lagElement.textContent = ''; }, reconnecting: function (userId) { diff --git a/www/poll/index.html b/www/poll/index.html index 49d487487..9981f28b8 100644 --- a/www/poll/index.html +++ b/www/poll/index.html @@ -3,7 +3,7 @@ - Zero Knowledge Date Picker + Zero Knowledge Date Picker

CryptPoll

-

Zero Knowledge, realtime scheduling

+

-

Your settings are updated instantly, so you never need to save.

-

All your input is encrypted so only people who have the link can access it. Even the server cannot see what you change.

+

+



@@ -53,7 +53,7 @@
-

Enter your name in the input field below and check the box for times when you are available

+

@@ -62,7 +62,7 @@ @@ -70,7 +70,7 @@ @@ -82,28 +82,28 @@
-
+ Users
+
-
+ Options
+
diff --git a/www/poll/main.js b/www/poll/main.js index 9636beb4a..3ef0292e7 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -67,8 +67,8 @@ define([ module.Wizard = Wizard; // special UI elements - var $title = $('#title').attr('placeholder', Messages.dateTitleHint || 'title'); - var $description = $('#description').attr('placeholder', Messages.dateDescription || 'description'); + var $title = $('#title').attr('placeholder', Messages.poll_titleHint || 'title'); + var $description = $('#description').attr('placeholder', Messages.poll_descriptionHint || 'description'); var items = [$title, $description]; @@ -231,7 +231,7 @@ define([ 'class': 'save action', 'for': id, }) - .text('COMMIT') // TODO translate + .text(Messages.commitButton) .click(function () { module.activeColumn = ''; makeUserEditable(id, false); @@ -254,7 +254,7 @@ define([ var $user = Input({ id: id, type: 'text', - placeholder: 'your name', + placeholder: Messages.poll_userPlaceholder, disabled: true, }).on('keyup change', function () { proxy.table.cols[id] = $user.val() || ""; @@ -262,10 +262,10 @@ define([ var $edit = $('', { 'class': 'edit', - title: 'edit column', // TODO translate + title: Messages.poll_editUserTitle, }).click(function () { if ($edit.hasClass('editable')) { return; } - Cryptpad.confirm("Are you sure you'd like to edit this user?", + Cryptpad.confirm(Messages.poll_editUser, function (yes) { if (!yes) { return; } makeUserEditable(id, true); @@ -277,9 +277,9 @@ define([ var $remove = $('', { 'class': 'remove', - 'title': 'remove column', // TODO translate + 'title': Messages.poll_removeUserTitle, }).text('✖').click(function () { - Cryptpad.confirm("Are you sure you'd like to remove this user?", // TODO translate + Cryptpad.confirm(Messages.poll_removeUser, function (yes) { if (!yes) { return; } // remove commit button, and anything else... @@ -329,7 +329,7 @@ define([ var makeOption = function (proxy, id, value) { var $option = Input({ type: 'text', - placeholder: 'option', + placeholder: Messages.optionPlaceholder, id: id, }).on('keyup change', function () { proxy.table.rows[id] = $option.val(); @@ -337,11 +337,11 @@ define([ var $edit = $('', { 'class': 'edit', - title: 'edit option', // TODO translate + title: Messages.poll_editOptionTitle, }) .click(function () { if ($edit.hasClass('editable')) { return; } - Cryptpad.confirm("Are you sure you'd like to edit this option?", + Cryptpad.confirm(Messages.poll_editOption, function (yes) { if (!yes) { return; } makeOptionEditable(id, true); @@ -353,10 +353,9 @@ define([ var $remove = $('', { 'class': 'remove', - 'title': 'remove row', // TODO translate + 'title': Messages.poll_removeOptionTitle, }).text('✖').click(function () { - // TODO translate - var msg = "Are you sure you'd like to remove this option?"; + var msg = Messages.poll_removeOption; Cryptpad.confirm(msg, function (yes) { if (!yes) { return; } removeRow(proxy, id); @@ -384,7 +383,7 @@ define([ if (!module.isEditable) { return; } var id = coluid(); - var msg = "Enter a name"; // TODO translate + var msg = Messages.poll_addUser; Cryptpad.prompt(msg, "", function (name) { if (name === null) { return; } makeUser(module.rt.proxy, id, name).val(name); @@ -396,7 +395,7 @@ define([ if (!module.isEditable) { return; } var id = rowuid(); - var msg = "Propose an option"; + var msg = Messages.poll_addOption; Cryptpad.prompt(msg, "", function (option) { if (option === null || !option) { return; } makeOption(module.rt.proxy, id, option).val(option).focus(); @@ -405,7 +404,7 @@ define([ }); Wizard.$getOptions.click(function () { - Cryptpad.confirm("Are you really ready to add these options to your poll?", function (yes) { + Cryptpad.confirm(Messages.wizardConfirm, function (yes) { if (!yes) { return; } var options = Wizard.computeSlots(function (a, b) { return a + ' ('+ b + ')'; @@ -652,7 +651,7 @@ define([ var $toolbar = $('#toolbar'); - $toolbar.find('sub a').text('⇐ back to Cryptpad'); + $toolbar.find('sub a').text(Messages.backToCryptpad); var Button = function (opt) { return $('
-
+ Dates
+
-
+ Times
+