more russian google translate, fallback to english

This commit is contained in:
Martti Malmi 2020-05-25 22:44:58 +03:00
parent a14121b611
commit 2642b9137f
3 changed files with 54 additions and 19 deletions

View File

@ -73,10 +73,10 @@
</div>
</form>
<div id="existing-account-login" class="hidden">
<p><a href="#" id="show-create-account">&lt; Back</a></p>
<input id="paste-privkey" placeholder="Paste a private key">
<p><a href="#" id="show-create-account">&lt; <%= back %></a></p>
<input id="paste-privkey" placeholder="<%= paste_private_key %>">
<p>
<button id="scan-privkey-btn">Scan private key QR code</button>
<button id="scan-privkey-btn"><%= scan_private_key_qr_code %></button>
</p>
</p>
<video id="privkey-qr-video" width="320" height="320" style="object-fit: cover;" class="hidden"></video>
@ -91,8 +91,8 @@
<div class="user-name"></div>
</div>
<div id="enable-notifications-prompt">
<div class="title">Get notified of new messages</div>
<div><a>Turn on desktop notifications</a></div>
<div class="title"><%= get_notified_new_messages %></div>
<div><a><%= turn_on_desktop_notifications %></a></div>
</div>
<div class="chat-list">
<div class="chat-item new">
@ -100,7 +100,7 @@
viewBox="0 0 510 510" xml:space="preserve">
<path fill="currentColor" d="M459,0H51C22.95,0,0,22.95,0,51v459l102-102h357c28.05,0,51-22.95,51-51V51C510,22.95,487.05,0,459,0z M102,178.5h306v51 H102V178.5z M306,306H102v-51h204V306z M408,153H102v-51h306V153z"/>
</svg>
New chat
<%= new_chat %>
</div>
<div id="welcome" class="visible-xs-block">
<h3>Iris Messenger</h3>
@ -125,7 +125,7 @@
</div>
<div id="not-seen-by-them" style="display: none">
<p>If the other person doesn't see your message, you can give them <b>your</b> chat link through some other channel:</p>
<p><button class="copy-chat-link">Copy your chat link</button></p>
<p><button class="copy-chat-link"><%= copy_your_chat_link %></button></p>
</div>
<div class="message-form" style="display:none">
<form autocomplete="off">
@ -145,19 +145,19 @@
<!-- New chat view -->
<div class="main-view" id="new-chat">
<h3>Have someone's chat link?</h3>
<input id="paste-chat-link" type="text" placeholder="Paste their chat link">
<button id="scan-chatlink-qr-btn">Or scan their QR code</button>
<h3><%= have_someones_chat_link %></h3>
<input id="paste-chat-link" type="text" placeholder="<%= paste_their_chat_link %>">
<button id="scan-chatlink-qr-btn"><%= or_scan_qr_code %></button>
<video id="chatlink-qr-video" width="320" height="320" style="object-fit: cover;"></video>
<h3>Give your chat link:</h3>
<button class="copy-chat-link">Copy your chat link</button>
<button id="show-my-qr-btn">Or show your QR code</button>
<h3><%= give_your_chat_link %></h3>
<button class="copy-chat-link"><%= copy_your_chat_link %></button>
<button id="show-my-qr-btn"><%= or_show_qr_code %></button>
<p id="my-qr-code" class="qr-container" style="display:none"></p>
<p><small>Beware of sharing your chat link publicly: you might get spammed with message requests. Publicly share your <a class="profile-link">profile link</a> instead.</small></p>
<h3>New group</h3>
<h3><%= new_group %></h3>
<p>
<input id="new-group-name" type="text" placeholder="Group name">
<button id="new-group-create">Create</button>
<input id="new-group-name" type="text" placeholder="<%= group_name %>">
<button id="new-group-create"><%= create %></button>
</p>
<hr/>
<h3>Your Chat Links</h3>

View File

@ -71,6 +71,11 @@ if (iris.util.isElectron) {
var AVAILABLE_LANGUAGES = Object.keys(IRIS_TRANSLATIONS);
var language = localStorage.getItem('language') || (navigator.language && navigator.language.slice(0,2)) || 'en';
language = AVAILABLE_LANGUAGES.indexOf(language) >= 0 ? language : 'en';
var languageObj = IRIS_TRANSLATIONS[language];
if (language !== 'en') {
var en = IRIS_TRANSLATIONS['en'];
Object.keys(en).forEach(k => languageObj[k] = languageObj[k] || en[k]);
}
var main_content_temp = _.template($('#main-content-template').html());
$('body').prepend($('<div>').attr('id', 'main-content').html(main_content_temp(IRIS_TRANSLATIONS[language])));
AVAILABLE_LANGUAGES.forEach(l => {
@ -592,7 +597,7 @@ function showNewChat() {
resetView();
$('.chat-item.new').toggleClass('active', true);
$('#new-chat').show();
$("#header-content").text('New chat');
$("#header-content").text(languageObj.new_chat);
$('#show-my-qr-btn').off().click(() => {
$('#my-qr-code').toggle()
})

View File

@ -4,13 +4,43 @@ var IRIS_TRANSLATIONS = {
iris_messenger: "Iris Messenger",
whats_your_name: "What's your name?",
new_user_go: "Go",
already_have_an_account: "Already have an account?"
already_have_an_account: "Already have an account?",
back: "Back",
scan_private_key_qr_code: "Scan private key QR code",
paste_private_key: "Paste a private key",
get_notified_new_messages: "Get notified of new messages",
turn_on_desktop_notifications: "Turn on desktop notifications",
new_chat: "New chat",
copy_your_chat_link: "Copy your chat link",
have_someones_chat_link: "Have someone's chat link?",
paste_their_chat_link: "Paste their chat link",
give_your_chat_link: "Give your chat link:",
or_scan_qr_code: "Or scan their QR code",
or_show_qr_code: "Or show your QR code",
new_group: "New group",
group_name: "Group name",
create: "Create",
},
"ru": {
language_name: "Русский",
iris_messenger: "Iris Messenger",
whats_your_name: "Как вас зовут?",
new_user_go: "Вход",
already_have_an_account: "Уже есть аккаунт?"
already_have_an_account: "Уже есть аккаунт?",
back: "назад",
scan_private_key_qr_code: "Сканируйте QR-код",
paste_private_key: "Вставить закрытый ключ",
get_notified_new_messages: "Получать уведомления о новых сообщениях",
turn_on_desktop_notifications: "Включить уведомления на рабочем столе",
new_chat: "Новый чат",
copy_your_chat_link: "Скопируйте ссылку на чат",
have_someones_chat_link: "Есть чья-то ссылка на чат?",
paste_their_chat_link: "Вставьте их ссылку на чат",
give_your_chat_link: "Дайте ссылку на чат:",
or_scan_qr_code: "Или отсканируйте их QR-код",
or_show_qr_code: "Или покажите свой QR-код",
new_group: "Новая группа",
group_name: "Имя группы",
create: "Создайте",
}
};