# HG changeset patch # User mathieui # Date 1590312430 -7200 # Node ID 010b905a74d4cf797f89ba05e33c3f6a54ee8132 # Parent 6a7a99f5a0ca8c8e7dc5446ca0b98f0e7270fea2 Update translation strings - prepend i18n loading for all "templates" - add some strings - commit the po files to the repo diff --git a/build_website.py b/build_website.py --- a/build_website.py +++ b/build_website.py @@ -72,7 +72,7 @@ def generate_pages(language): ] for file_to_localize in files: with open(file_to_localize) as template_file: - template = Template(template_file.read()) + template = Template('{% load i18n %}' + template_file.read()) rendered = template.render(Context({'AVAILABLE_LANGUAGES': AVAILABLE_LANGUAGES})) filename = path.join(target_dir, file_to_localize) diff --git a/client.js b/client.js --- a/client.js +++ b/client.js @@ -122,7 +122,7 @@ document.addEventListener('DOMContentLoa { const new_node = document.createElementNS('http://www.w3.org/1999/xhtml', 'span'); const parent_node = connect.parentNode; - const text = document.createTextNode('Logged in as ' + connection.authzid + ' '); + const text = document.createTextNode('{% trans 'Logged in as {} ' %}'.replace('{}', connection.authzid)); new_node.appendChild(text); parent_node.insertBefore(new_node, connect); diff --git a/index.xhtml b/index.xhtml --- a/index.xhtml +++ b/index.xhtml @@ -1,5 +1,5 @@ - + diff --git a/locale/django.pot b/locale/django.pot new file mode 100644 --- /dev/null +++ b/locale/django.pot @@ -0,0 +1,177 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-24 11:25+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Logged in as {} " +msgstr "" + +msgid "Prosody IM account configuration" +msgstr "" + +msgid "Enter your JID (or XMPP address), on the form “you@your-server.tld”" +msgstr "" + +msgid "Enter the password used for this JID" +msgstr "" + +msgid "Profile" +msgstr "" + +msgid "Message Archiving" +msgstr "" + +msgid "Account" +msgstr "" + +msgid "PEP (advanced)" +msgstr "" + +msgid "Nickname" +msgstr "" + +msgid "Enter your nickname, so people you know can recognize you." +msgstr "" + +msgid "Who can see your nickname?" +msgstr "" + +msgid "Anyone" +msgstr "" + +msgid "Only your contacts" +msgstr "" + +msgid "This image allows your contacts to quickly identify you." +msgstr "" + +msgid "Upload new avatar" +msgstr "" + +msgid "Choose file…" +msgstr "" + +msgid "Use as your avatar" +msgstr "" + +msgid "Who can see your avatar?" +msgstr "" + +msgid "Anyone (pick this if you use public channel)" +msgstr "" + +msgid "Only your contacts (⚠️ your avatar won’t be usable in public channels)" +msgstr "" + +msgid "Personal Information" +msgstr "" + +msgid "Who are you?" +msgstr "" + +msgid "Full name" +msgstr "" + +msgid "Enter your name, so people you know can recognize you." +msgstr "" + +msgid "Email" +msgstr "" + +msgid "This can be used if you forget your password." +msgstr "" + +msgid "Birthday" +msgstr "" + +msgid "Who can see your personal information?" +msgstr "" + +msgid "JID" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Subscription" +msgstr "" + +msgid "Groups" +msgstr "" + +msgid "⚠️ Delete" +msgstr "" + +msgid "Change my password" +msgstr "" + +msgid "⚠️ Delete my account" +msgstr "" + +msgid "PEP" +msgstr "" + +msgid "This section is for advanced users, use at your own risk!" +msgstr "" + +msgid "PEP node" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Which messages to store in your archive?" +msgstr "" + +msgid "All messages" +msgstr "" + +msgid "No messages" +msgstr "" + +msgid "Messages from your contacts only" +msgstr "" + +msgid "Always:" +msgstr "" + +msgid "Never:" +msgstr "" + +msgid "Retrieve my message archive" +msgstr "" + +msgid "View my message archive" +msgstr "" + +msgid "Download my entire message archive" +msgstr "" + +msgid "⚠️ Purge my entire message archive" +msgstr "" + +msgid "Do you really want to remove the node {}?" +msgstr "" + +msgid "Do you really want to remove {}?" +msgstr "" diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po new file mode 100644 --- /dev/null +++ b/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-24 11:25+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Logged in as {} " +msgstr "" + +msgid "Prosody IM account configuration" +msgstr "" + +msgid "Enter your JID (or XMPP address), on the form “you@your-server.tld”" +msgstr "" + +msgid "Enter the password used for this JID" +msgstr "" + +msgid "Profile" +msgstr "" + +msgid "Message Archiving" +msgstr "" + +msgid "Account" +msgstr "" + +msgid "PEP (advanced)" +msgstr "" + +msgid "Nickname" +msgstr "" + +msgid "Enter your nickname, so people you know can recognize you." +msgstr "" + +msgid "Who can see your nickname?" +msgstr "" + +msgid "Anyone" +msgstr "" + +msgid "Only your contacts" +msgstr "" + +msgid "This image allows your contacts to quickly identify you." +msgstr "" + +msgid "Upload new avatar" +msgstr "" + +msgid "Choose file…" +msgstr "" + +msgid "Use as your avatar" +msgstr "" + +msgid "Who can see your avatar?" +msgstr "" + +msgid "Anyone (pick this if you use public channel)" +msgstr "" + +msgid "Only your contacts (⚠️ your avatar won’t be usable in public channels)" +msgstr "" + +msgid "Personal Information" +msgstr "" + +msgid "Who are you?" +msgstr "" + +msgid "Full name" +msgstr "" + +msgid "Enter your name, so people you know can recognize you." +msgstr "" + +msgid "Email" +msgstr "" + +msgid "This can be used if you forget your password." +msgstr "" + +msgid "Birthday" +msgstr "" + +msgid "Who can see your personal information?" +msgstr "" + +msgid "JID" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Subscription" +msgstr "" + +msgid "Groups" +msgstr "" + +msgid "⚠️ Delete" +msgstr "" + +msgid "Change my password" +msgstr "" + +msgid "⚠️ Delete my account" +msgstr "" + +msgid "PEP" +msgstr "" + +msgid "This section is for advanced users, use at your own risk!" +msgstr "" + +msgid "PEP node" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Which messages to store in your archive?" +msgstr "" + +msgid "All messages" +msgstr "" + +msgid "No messages" +msgstr "" + +msgid "Messages from your contacts only" +msgstr "" + +msgid "Always:" +msgstr "" + +msgid "Never:" +msgstr "" + +msgid "Retrieve my message archive" +msgstr "" + +msgid "View my message archive" +msgstr "" + +msgid "Download my entire message archive" +msgstr "" + +msgid "⚠️ Purge my entire message archive" +msgstr "" + +msgid "Do you really want to remove the node {}?" +msgstr "" + +msgid "Do you really want to remove {}?" +msgstr "" diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po new file mode 100644 --- /dev/null +++ b/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-24 11:25+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +msgid "Logged in as {} " +msgstr "" + +msgid "Prosody IM account configuration" +msgstr "" + +msgid "Enter your JID (or XMPP address), on the form “you@your-server.tld”" +msgstr "" + +msgid "Enter the password used for this JID" +msgstr "" + +msgid "Profile" +msgstr "" + +msgid "Message Archiving" +msgstr "" + +msgid "Account" +msgstr "" + +msgid "PEP (advanced)" +msgstr "" + +msgid "Nickname" +msgstr "" + +msgid "Enter your nickname, so people you know can recognize you." +msgstr "" + +msgid "Who can see your nickname?" +msgstr "" + +msgid "Anyone" +msgstr "" + +msgid "Only your contacts" +msgstr "" + +msgid "This image allows your contacts to quickly identify you." +msgstr "" + +msgid "Upload new avatar" +msgstr "" + +msgid "Choose file…" +msgstr "" + +msgid "Use as your avatar" +msgstr "" + +msgid "Who can see your avatar?" +msgstr "" + +msgid "Anyone (pick this if you use public channel)" +msgstr "" + +msgid "Only your contacts (⚠️ your avatar won’t be usable in public channels)" +msgstr "" + +msgid "Personal Information" +msgstr "" + +msgid "Who are you?" +msgstr "" + +msgid "Full name" +msgstr "" + +msgid "Enter your name, so people you know can recognize you." +msgstr "" + +msgid "Email" +msgstr "" + +msgid "This can be used if you forget your password." +msgstr "" + +msgid "Birthday" +msgstr "" + +msgid "Who can see your personal information?" +msgstr "" + +msgid "JID" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Subscription" +msgstr "" + +msgid "Groups" +msgstr "" + +msgid "⚠️ Delete" +msgstr "" + +msgid "Change my password" +msgstr "" + +msgid "⚠️ Delete my account" +msgstr "" + +msgid "PEP" +msgstr "" + +msgid "This section is for advanced users, use at your own risk!" +msgstr "" + +msgid "PEP node" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Which messages to store in your archive?" +msgstr "" + +msgid "All messages" +msgstr "" + +msgid "No messages" +msgstr "" + +msgid "Messages from your contacts only" +msgstr "" + +msgid "Always:" +msgstr "" + +msgid "Never:" +msgstr "" + +msgid "Retrieve my message archive" +msgstr "" + +msgid "View my message archive" +msgstr "" + +msgid "Download my entire message archive" +msgstr "" + +msgid "⚠️ Purge my entire message archive" +msgstr "" + +msgid "Do you really want to remove the node {}?" +msgstr "" + +msgid "Do you really want to remove {}?" +msgstr "" diff --git a/pep.js b/pep.js --- a/pep.js +++ b/pep.js @@ -65,7 +65,7 @@ function initPEP(connection) { button.classList.add('btn-danger'); button.textContent = '✕'; button.onclick = function (evt) { - const really = confirm('Do you really want to remove the node ' + node + '?'); + const really = confirm('{% trans 'Do you really want to remove the node {}?' %}'.replace('{}', node)); if (!really) return; const iq = $iq({type: 'set'}) diff --git a/roster.js b/roster.js --- a/roster.js +++ b/roster.js @@ -55,7 +55,7 @@ function initRoster(connection) { button.classList.add('btn-danger'); button.textContent = '✕'; button.onclick = function (evt) { - const really = confirm('Do you really want to remove ' + jid + '?'); + const really = confirm('{% trans 'Do you really want to remove {}?' %}'.replace('{}', jid)); if (!really) return; const iq = $iq({type: 'set'})