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

23
css/style.css

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

8
interface_common.js

@ -405,13 +405,19 @@ var postSubmit = function(e) @@ -405,13 +405,19 @@ var postSubmit = function(e)
var $replyText = $this.closest(".post-area-new").find("textarea");
var $postOrig = $this.closest(".post-data");
if( !$postOrig.length )
if (!$postOrig.length) {
$postOrig = $this.closest(".modal-content").find(".post-data");
}
newPostMsg($replyText.val(), $postOrig);
$replyText.val("");
$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);
}

127
interface_localization.js

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
// 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
var knownLanguages = ["en","nl"];
var knownLanguages = ["en","nl","it"];
// detect language with JavaScript
var preferredLanguage = window.navigator.userLanguage || window.navigator.language || "en";
@ -114,7 +114,7 @@ if(preferredLanguage == "en"){ @@ -114,7 +114,7 @@ if(preferredLanguage == "en"){
"send": "send",
"Send post with username": "Send post with username ",
"Sent Direct Message": "Sent Direct Message",
"Sent Post to @": "Sent Post to @",
"Sent Post to @": "Sent Post to @",
"Setup account": "Setup account",
"switch_to_network": "Local daemon is not connected to the network or\n" +
"block chain is outdated. If you stay in this page\n" +
@ -235,7 +235,7 @@ if(preferredLanguage == "nl"){ @@ -235,7 +235,7 @@ if(preferredLanguage == "nl"){
"send": "Verstuur",
"Send post with username": "Verstuur bericht met gebruikersnaam ",
"Sent Direct Message": "Verstuur privébericht",
"Sent Post to @": "Verstuur bericht naar @",
"Sent Post to @": "Verstuur bericht naar @",
"Setup account": "Account instellingen",
"switch_to_network": "Local daemon is not connected to the network or\n" +
"block chain is outdated. If you stay in this page\n" +
@ -267,6 +267,125 @@ if(preferredLanguage == "nl"){ @@ -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
if(preferredLanguage == "ru"){
// polyglot.locale() is used to support plurals
@ -280,7 +399,7 @@ if(preferredLanguage == "ru"){ @@ -280,7 +399,7 @@ if(preferredLanguage == "ru"){
polish: ['pl'],
icelandic: ['is']
*/
polyglot.locale("ru");
// list of the English words and translations

3
jquery.jsonrpcclient.js

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

7
network.html

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

24
twister_actions.js

@ -223,8 +223,28 @@ function processHashtag(postboard, hashtag, data) { @@ -223,8 +223,28 @@ function processHashtag(postboard, hashtag, data) {
function displayHashtagPending(postboard) {
for( var i = 0; i < _hashtagPendingPosts.length; i++ ) {
var newStreamPost = postToElem(_hashtagPendingPosts[i], "original");
postboard.prepend( newStreamPost );
var streamPost = postToElem(_hashtagPendingPosts[i], "original");
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();
_hashtagPendingPosts = [];

107
twister_formatpost.js

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

2
twister_io.js

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

6
twister_network.js

@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) { @@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) {
twisterdAddrman = ret.addrman_total;
twisterdBlocks = ret.blocks;
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);
$(".known-peers").text(twisterdAddrman);
$(".blocks").text(twisterdBlocks);
$(".dht-nodes").text(twisterDhtNodes);
$(".version").text(twisterDisplayVersion);
if( !twisterdConnections ) {
$.MAL.setNetworkStatusMsg(polyglot.t("Connection lost."), false);

2
twister_timeline.js

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

Loading…
Cancel
Save