Browse Source

Merge pull request #2 from toyg/italian

Italian
master
basst85 11 years ago
parent
commit
8729717f3b
  1. 7
      css/profile.css
  2. 23
      css/style.css
  3. 8
      interface_common.js
  4. 127
      interface_localization.js
  5. 3
      jquery.jsonrpcclient.js
  6. 7
      network.html
  7. 24
      twister_actions.js
  8. 107
      twister_formatpost.js
  9. 2
      twister_io.js
  10. 6
      twister_network.js
  11. 2
      twister_timeline.js

7
css/profile.css

@ -153,8 +153,9 @@
.profile-modal .modal-wrapper .profile-modal .modal-wrapper
{ {
width: 528px; width: 528px;
height: 590px; height: 680px;
margin: -300px 0 0 -264px; margin: -340px 0 0 -264px;
border-radius: 5px;
overflow: hidden; overflow: hidden;
} }
.profile-modal .modal-content .profile-modal .modal-content
@ -189,7 +190,7 @@
} }
.profile-modal .postboard-posts .post .profile-modal .postboard-posts .post
{ {
padding: 5px; padding: 0;
} }
.profile-modal .post-interactions .profile-modal .post-interactions
{ {

23
css/style.css

@ -509,22 +509,32 @@ button.disabled:hover
/*********************************** /***********************************
********************* POST AREA **** ********************* POST AREA ****
***********************************/ ***********************************/
.post-area-new .post-area-new {
{ padding-bottom: 4px;
padding: 10px;
} }
.post-area-new textarea .post-area-new textarea
{ {
resize: none; resize: none;
width: 100%; width: 445px;
display: block; display: block;
transition: all .3s linear; transition: all .3s linear;
height: 28px; height: 28px;
border-radius: 3px; border-radius: 3px;
border: solid 1px rgba(0, 0, 0, .3 ); border: solid 1px rgba(0, 0, 0, .3 );
margin-left: 55px;
margin-bottom: 10px;
padding: 4px; padding: 4px;
font-size: 13px; font-size: 13px;
} }
.mini-profile .post-area-new
{
padding: 9px;
}
.mini-profile .post-area-new textarea
{
margin-left: 0;
width: 100%;
}
.post-area-new.open textarea .post-area-new.open textarea
{ {
height: 80px; height: 80px;
@ -551,7 +561,6 @@ button.disabled:hover
{ {
height: 35px; height: 35px;
transition: all .6s linear; transition: all .6s linear;
padding-top: 4px;
} }
.post-area-remaining .post-area-remaining
{ {
@ -806,6 +815,7 @@ button.disabled:hover
font-size: 14px; font-size: 14px;
color: #e34f42; color: #e34f42;
text-decoration: none; text-decoration: none;
padding-left: 2px;
} }
.post-info-tag .post-info-tag
{ {
@ -1317,11 +1327,12 @@ button.disabled:hover
width: 560px; width: 560px;
height: 470px; height: 470px;
margin: -200px 0 0 -280px; margin: -200px 0 0 -280px;
overflow-x: hidden; overflow: hidden;
} }
.hashtag-modal .modal-content .hashtag-modal .modal-content
{ {
overflow-y: auto; overflow-y: auto;
height: 440px;
} }
.hashtag-modal .modal-buttons .hashtag-modal .modal-buttons
{ {

8
interface_common.js

@ -405,13 +405,19 @@ var postSubmit = function(e)
var $replyText = $this.closest(".post-area-new").find("textarea"); var $replyText = $this.closest(".post-area-new").find("textarea");
var $postOrig = $this.closest(".post-data"); var $postOrig = $this.closest(".post-data");
if( !$postOrig.length )
if (!$postOrig.length) {
$postOrig = $this.closest(".modal-content").find(".post-data"); $postOrig = $this.closest(".modal-content").find(".post-data");
}
newPostMsg($replyText.val(), $postOrig); newPostMsg($replyText.val(), $postOrig);
$replyText.val(""); $replyText.val("");
$replyText.attr("placeholder", polyglot.t("Your message was sent!")); $replyText.attr("placeholder", polyglot.t("Your message was sent!"));
var tweetForm = $this.parents("form");
var remainingCount = tweetForm.find(".post-area-remaining");
remainingCount.text(140);
$replyText.attr("placeholder", "Your message was sent!");
closeModal($this); closeModal($this);
} }

127
interface_localization.js

@ -4,7 +4,7 @@
// uses Polyglot.js ( https://github.com/airbnb/polyglot.js ) to translate interface // uses Polyglot.js ( https://github.com/airbnb/polyglot.js ) to translate interface
// translators: add your language code here such as "es" for Spanish, "ru" for Russian // translators: add your language code here such as "es" for Spanish, "ru" for Russian
var knownLanguages = ["en","nl"]; var knownLanguages = ["en","nl","it"];
// detect language with JavaScript // detect language with JavaScript
var preferredLanguage = window.navigator.userLanguage || window.navigator.language || "en"; var preferredLanguage = window.navigator.userLanguage || window.navigator.language || "en";
@ -114,7 +114,7 @@ if(preferredLanguage == "en"){
"send": "send", "send": "send",
"Send post with username": "Send post with username ", "Send post with username": "Send post with username ",
"Sent Direct Message": "Sent Direct Message", "Sent Direct Message": "Sent Direct Message",
"Sent Post to @": "Sent Post to @", "Sent Post to @": "Sent Post to @",
"Setup account": "Setup account", "Setup account": "Setup account",
"switch_to_network": "Local daemon is not connected to the network or\n" + "switch_to_network": "Local daemon is not connected to the network or\n" +
"block chain is outdated. If you stay in this page\n" + "block chain is outdated. If you stay in this page\n" +
@ -235,7 +235,7 @@ if(preferredLanguage == "nl"){
"send": "Verstuur", "send": "Verstuur",
"Send post with username": "Verstuur bericht met gebruikersnaam ", "Send post with username": "Verstuur bericht met gebruikersnaam ",
"Sent Direct Message": "Verstuur privébericht", "Sent Direct Message": "Verstuur privébericht",
"Sent Post to @": "Verstuur bericht naar @", "Sent Post to @": "Verstuur bericht naar @",
"Setup account": "Account instellingen", "Setup account": "Account instellingen",
"switch_to_network": "Local daemon is not connected to the network or\n" + "switch_to_network": "Local daemon is not connected to the network or\n" +
"block chain is outdated. If you stay in this page\n" + "block chain is outdated. If you stay in this page\n" +
@ -267,6 +267,125 @@ if(preferredLanguage == "nl"){
}; };
} }
if(preferredLanguage == "it"){
polyglot.locale("it");
wordset = {
"Actions ▼": "Azioni ▼",
"Active DHT nodes:": "Nodi DHT attivi:",
"Add DNS": "Connetti DNS",
"Add peer": "Connetti nodo",
"ajax_error": "Errore AJAX: %{error}", // JavaScript error
"All users publicly followed by": "Utenti seguiti pubblicamente da",
"Available": "Disponibile", // username is available
"Block chain information": "Informazioni sulla catena di blocchi",
"Block chain is up-to-date, twister is ready to use!": "Catena di blocchi aggiornata, Twister è pronto per l'uso!",
"Block generation": "Generatore di blocchi:",
"Cancel": "Cancella",
"Change user": "Cambia utente",
"Checking...": "Controllo in corso...", // checking if username is available
"Collapse": "Chiudi", // smaller view of a post
"Configure block generation": "Configura generatore di blocchi",
"Connections:": "Connessioni: ", // to network
"Connection lost.": "Connessione interrotta.",
"days": "%{smart_count} giorno |||| %{smart_count} giorni",
"Detailed information": "Informazioni dettagliate",
"DHT network down.": "DHT network inaccessibile.",
"Direct Messages": "Messaggi Diretti",
"Disable": "Disabilitato",
"Display mentions to @": "Mostra le menzioni di @",
"Display retransmissions": "Mostra Ripubblicazioni",
"DNS to obtain list of peers:": "DNS per la lista dei nodi:",
"downloading_block_chain": "Scaricamento della catena di blocchi in corso, attendere prego (la catena risale a %{days} giorni fa).",
"download_posts_status": "Scaricati %{portion} messaggi", // Downloaded 10/30 posts
"Enable": "Attivato",
"error": "Errore: %{error}",
"error_connecting_to_daemon": "Errore nella connessione al servizio Twister locale.",
"Error in 'createwalletuser' RPC.": "Errore in 'createwalletuser' RPC.",
"Error in 'importprivkey'": "Errore in 'importprivkey' RPC: %{rpc}",
"Error in 'sendnewusertransaction' RPC.": "Errore in 'sendnewusertransaction' RPC.",
"Expand": "Espandi", // larger view of a post
"Favorite": "Preferito",
"File APIs not supported in this browser.": "File APIs non supportati in questo browser.",
"Follow": "Segui",
"Followed by": "Seguito da",
"followed_by": "Seguiti da %{username}",
"Followers": "Lettori",
"Following": "Seguiti",
"Following users": "Utenti seguiti",
"Force connection to peer:": "Forza connessione al nodo:",
"General information": "Informazioni",
"Generate blocks (send promoted messages)": "Genera blocchi (invia messaggi pubblicitari)",
"Home": "Twister", // homepage -- no direct translation in Italian...?
"hours": "%{smart_count} ora |||| %{smart_count} ore",
"Internal error: lastPostId unknown (following yourself may fix!)": "Errore interno: lastPostId sconosciuto (prova a seguire te stesso per risolvere!)",
"Known peers:": "Nodi conosciuti: ",
"Last block is ahead of your computer time, check your clock.": "L'ultimo blocco è più recente del tuo orario, controlla l'orologio di sistema.",
"mentions_at": "Chi menziona @%{user}",
"minutes": "%{smart_count} minuto |||| %{smart_count} minuti",
"Must be 16 characters or less.": "Massimo 16 caratteri.", // username
"Network": "Rete",
"Network config": "Configurazione della rete",
"Network status": "Status della rete",
"New direct message...": "Nuovo messaggio diretto...",
"New Post...": "Nuovo messaggio...",
"new_posts": "%{smart_count} nuovo messaggio |||| %{smart_count} nuovi messaggi",
"nobody": "nessuno", // used to promote a post without attaching the user
"Not available": "Non disponibile", // username is not available
"Number of blocks in block chain:": "Numero di blocchi nella catena: ",
"Number of CPUs to use": "Numero di processori da usare:",
"Only alphanumeric and underscore allowed.": "Sono permessi solo caratteri alfanumerici e '_'",
"peer address": "Indirizzo del nodo",
"Private": "Privato",
"Profile": "Profilo",
"Postboard": "Bacheca",
"post": "Invia", // verb - button to post a message
"Post to promote:": "Messaggio pubblicitario: ",
"Posts": "Messaggi",
"propagating_nickname": "Propagazione sul network del nome %{username} in corso...",
"Public": "Pubblico",
"Refresh": "Ricarica",
"retransmit_this": "Ripubblica questo post ai tuoi lettori?",
"Reply": "Rispondi",
"Reply...": "Rispondi...",
"reply_to": "Rispondi a %{fullname}",
"Retransmit": "Ripubblica",
"Retransmits": "Ripubblicati",
"Retransmitted by": "Ripubblicato da",
"search": "Cerca",
"seconds": "%{smart_count} secondo |||| %{smart_count} secondi",
"send": "Invia",
"Send post with username": "Pubblica come utente ",
"Sent Direct Message": "Messaggi Diretti inviati",
"Sent Post to @": "Messaggi inviati a @",
"Setup account": "Configurazione Utente",
"switch_to_network": "Il servizio locale non è connesso alla rete Twister o la catena di blocchi è vecchia.\n" +
"Se rimani su questa pagina, Twister potrebbe non funzionare.\n" +
"Vuoi controllare lo stato della rete Twister, invece?",
"The File APIs are not fully supported in this browser.": "Le API File non sono interamente supportate da questo browser.",
"time_ago": "%{time} fa", // 5 minutes ago
"Time of the last block:": "Orario del blocco più recente: ",
"Type message here": "Scrivi qui",
"Unfollow": "Smetti di seguire",
"Update": "Aggiorna",
"Updating status...": "Aggiornamento in corso...", // status of block chain
"user_not_yet_accepted": "Gli altri nodi non hanno ancora accettato il nuovo utente.\n" +
"Al momento non puoi salvare il profilo o spedire messaggi.\n" +
"Attendi qualche minuto prima di continuare.\n\n" +
"Please wait a few minutes to continue.\n\n" +
"Il pulsante 'Salva modifiche' sarà abilitato automaticamente appena il processo sarà completato.\n" +
"(Prometto che è l'ultima attesa prima di poter usare Twister!).\n\n" +
"Suggerimento: nel frattempo, trova un'immagine da usare come avatar!",
"users_mentions": "Menzioni di @%{username}",
"users_profile": "Profilo di %{username}",
"username_undefined": "Utente non specificato, è necessario il login.",
"View": "Vedi",
"View All": "Mostra tutti",
"Who to Follow": "Chi seguire?",
"Your message was sent!": "Il messaggio è stato inviato!"
};
}
// translators: sample adding a language // translators: sample adding a language
if(preferredLanguage == "ru"){ if(preferredLanguage == "ru"){
// polyglot.locale() is used to support plurals // polyglot.locale() is used to support plurals
@ -280,7 +399,7 @@ if(preferredLanguage == "ru"){
polish: ['pl'], polish: ['pl'],
icelandic: ['is'] icelandic: ['is']
*/ */
polyglot.locale("ru"); polyglot.locale("ru");
// list of the English words and translations // list of the English words and translations

3
jquery.jsonrpcclient.js

@ -90,6 +90,7 @@
url : this.options.ajaxUrl, url : this.options.ajaxUrl,
data : $.toJSON(request), data : $.toJSON(request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8",
cache : false, cache : false,
beforeSend: function (xhr) { beforeSend: function (xhr) {
if( options.username != null && options.username != undefined ) { if( options.username != null && options.username != undefined ) {
@ -154,6 +155,7 @@
url : this.options.ajaxUrl, url : this.options.ajaxUrl,
data : $.toJSON(request), data : $.toJSON(request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8",
cache : false, cache : false,
beforeSend: function (xhr){ beforeSend: function (xhr){
if( options.username != null && options.username != undefined ) { if( options.username != null && options.username != undefined ) {
@ -395,6 +397,7 @@
url : self.jsonrpcclient.options.ajaxUrl, url : self.jsonrpcclient.options.ajaxUrl,
data : $.toJSON(batch_request), data : $.toJSON(batch_request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8",
cache : false, cache : false,
type : 'POST', type : 'POST',

7
network.html

@ -82,17 +82,20 @@
<li> <li>
<span class="network-status highlight connection-status">Updating status...</span> <span class="network-status highlight connection-status">Updating status...</span>
</li> </li>
<li>
<label>Client Version: </label>
<span class="version">00.00.00.00</label>
</ul> </ul>
<h3> Detailed information </h3> <h3> Detailed information </h3>
<ul> <ul>
<li class="connections"> <li class="connections">
<label>Connections: </label> <label>Connections: </label>
<span class="connection-count">1</span> <span class="connection-count">0</span>
</li> </li>
<li> <li>
<label>Known peers: </label> <label>Known peers: </label>
<span class="known-peers">6</span> <span class="known-peers">0</span>
</li> </li>
<li> <li>
<label>Active DHT nodes: </label> <label>Active DHT nodes: </label>

24
twister_actions.js

@ -223,8 +223,28 @@ function processHashtag(postboard, hashtag, data) {
function displayHashtagPending(postboard) { function displayHashtagPending(postboard) {
for( var i = 0; i < _hashtagPendingPosts.length; i++ ) { for( var i = 0; i < _hashtagPendingPosts.length; i++ ) {
var newStreamPost = postToElem(_hashtagPendingPosts[i], "original"); var streamPost = postToElem(_hashtagPendingPosts[i], "original");
postboard.prepend( newStreamPost ); var timePost = _hashtagPendingPosts[i]["userpost"]["time"];
var streamItems = postboard.children();
if( streamItems.length == 0) {
postboard.prepend( streamPost );
} else {
var j = 0;
for( j = 0; j < streamItems.length; j++) {
var streamItem = streamItems.eq(j);
var timeItem = streamItem.attr("data-time");
if( timeItem == undefined ||
timePost > parseInt(timeItem) ) {
// this post in stream is older, so post must be inserted above
streamItem.before(streamPost);
break;
}
}
if( j == streamItems.length ) {
postboard.append( streamPost );
}
}
} }
$.MAL.postboardLoaded(); $.MAL.postboardLoaded();
_hashtagPendingPosts = []; _hashtagPendingPosts = [];

107
twister_formatpost.js

@ -141,62 +141,65 @@ function dmDataToConversationItem(dmData, localUser, remoteUser) {
// todo: hashtags // todo: hashtags
function htmlFormatMsg( msg, output, mentions ) { function htmlFormatMsg( msg, output, mentions ) {
var tmp; var tmp;
var match = null;
var index;
var reAll = new RegExp("(#|@|http[s]?://)");
var reHttp = new RegExp("http[s]?://");
msg = escapeHtmlEntities(msg); msg = escapeHtmlEntities(msg);
while( msg != undefined && msg.length ) { while( msg != undefined && msg.length ) {
var atindex = msg.indexOf("@");
if( atindex != -1 ) { match = reAll.exec(msg);
output.append(msg.substr(0, atindex)); if( match ) {
tmp = msg.substr(atindex+1); if( match[0] == "@" ) {
var username = _extractUsername(tmp); output.append(msg.substr(0, match.index));
if( username.length ) { tmp = msg.substr(match.index+1);
if( mentions.indexOf(username) < 0 ) var username = _extractUsername(tmp);
mentions.push(username); if( username.length ) {
var userLinkTemplate = $("#msg-user-link-template").clone(true); if( mentions.indexOf(username) < 0 )
userLinkTemplate.removeAttr("id"); mentions.push(username);
userLinkTemplate.attr("href",$.MAL.userUrl(username)); var userLinkTemplate = $("#msg-user-link-template").clone(true);
userLinkTemplate.text("@"+username); userLinkTemplate.removeAttr("id");
output.append(userLinkTemplate); userLinkTemplate.attr("href",$.MAL.userUrl(username));
msg = tmp.substr(String(username).length); userLinkTemplate.text("@"+username);
continue; output.append(userLinkTemplate);
msg = tmp.substr(String(username).length);
continue;
}
} }
}
if( reHttp.exec(match[0]) ) {
var httpindex = msg.indexOf("http://"); output.append(msg.substr(0, match.index));
var httpsindex = msg.indexOf("https://"); tmp = msg.substring(match.index);
if (httpsindex != -1) { var space = tmp.indexOf(" ");
httpindex = httpsindex; var url;
} if( space != -1 ) url = tmp.substring(0,space); else url = tmp;
if( httpindex != -1 ) { if( url.length ) {
output.append(msg.substr(0, httpindex)); var extLinkTemplate = $("#external-page-link-template").clone(true);
tmp = msg.substring(httpindex); extLinkTemplate.removeAttr("id");
var space = tmp.indexOf(" "); extLinkTemplate.attr("href",url);
var url; extLinkTemplate.text(url);
if( space != -1 ) url = tmp.substring(0,space); else url = tmp; extLinkTemplate.attr("title",url);
if( url.length ) { output.append(extLinkTemplate);
var extLinkTemplate = $("#external-page-link-template").clone(true); msg = tmp.substr(String(url).length);
extLinkTemplate.removeAttr("id"); continue;
extLinkTemplate.attr("href",url); }
extLinkTemplate.text(url);
extLinkTemplate.attr("title",url);
output.append(extLinkTemplate);
msg = tmp.substr(String(url).length);
continue;
} }
}
if( match[0] == "#" ) {
var hashindex = msg.indexOf("#"); output.append(msg.substr(0, match.index));
if( hashindex != -1 ) { tmp = msg.substr(match.index+1);
output.append(msg.substr(0, hashindex)); var hashtag = _extractUsername(tmp);
tmp = msg.substr(hashindex+1); if( hashtag.length ) {
var hashtag = _extractUsername(tmp); var hashtagLinkTemplate = $("#hashtag-link-template").clone(true);
if( hashtag.length ) { hashtagLinkTemplate.removeAttr("id");
var hashtagLinkTemplate = $("#hashtag-link-template").clone(true); hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(hashtag));
hashtagLinkTemplate.removeAttr("id"); hashtagLinkTemplate.text("#"+hashtag);
hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(hashtag)); output.append(hashtagLinkTemplate);
hashtagLinkTemplate.text("#"+hashtag); msg = tmp.substr(String(hashtag).length);
output.append(hashtagLinkTemplate); continue;
msg = tmp.substr(String(hashtag).length); }
continue;
} }
} }

2
twister_io.js

@ -198,6 +198,8 @@ function getProfileResource( username, resource, item, cbFunc, cbArg ){
// get fullname and store it in item.text // get fullname and store it in item.text
function getFullname( username, item ){ function getFullname( username, item ){
// Set the username first in case the profile has no fullname
item.text(username);
getProfileResource( username, "fullname", item); getProfileResource( username, "fullname", item);
} }

6
twister_network.js

@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) {
twisterdAddrman = ret.addrman_total; twisterdAddrman = ret.addrman_total;
twisterdBlocks = ret.blocks; twisterdBlocks = ret.blocks;
twisterDhtNodes = ret.dht_nodes; twisterDhtNodes = ret.dht_nodes;
twisterVersion = ("0000000" + ret.version).slice(-8);
twisterDisplayVersion = twisterVersion.slice(0,2) + '.' +
twisterVersion.slice(2,4) + '.' +
twisterVersion.slice(4,6) + '.' +
twisterVersion.slice(6,8);
$(".connection-count").text(twisterdConnections); $(".connection-count").text(twisterdConnections);
$(".known-peers").text(twisterdAddrman); $(".known-peers").text(twisterdAddrman);
$(".blocks").text(twisterdBlocks); $(".blocks").text(twisterdBlocks);
$(".dht-nodes").text(twisterDhtNodes); $(".dht-nodes").text(twisterDhtNodes);
$(".version").text(twisterDisplayVersion);
if( !twisterdConnections ) { if( !twisterdConnections ) {
$.MAL.setNetworkStatusMsg(polyglot.t("Connection lost."), false); $.MAL.setNetworkStatusMsg(polyglot.t("Connection lost."), false);

2
twister_timeline.js

@ -146,7 +146,7 @@ function processReceivedPosts(req, posts)
streamPostAppended = true; streamPostAppended = true;
} else { } else {
var j = 0; var j = 0;
for( var j = 0; j < streamItems.length; j++) { for( j = 0; j < streamItems.length; j++) {
var streamItem = streamItems.eq(j); var streamItem = streamItems.eq(j);
var timeItem = streamItem.attr("data-time"); var timeItem = streamItem.attr("data-time");
if( timeItem == undefined || if( timeItem == undefined ||

Loading…
Cancel
Save