diff --git a/data/translations.telegram.org.html b/data/translations.telegram.org.html new file mode 100644 index 0000000000..fac572750d --- /dev/null +++ b/data/translations.telegram.org.html @@ -0,0 +1,297 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+

Translating Telegram

+ +
+ +
+ +

We've worked hard to make Telegram's English version as smooth as possible in terms of language. Now we're looking for equally smooth translations into the rest of the world's languages. If you're a linguist, pro translator or language geek and would like to help us get closer to perfection, you've come to the right place.

+

Start Translating

+ +

The Interface

+

To get started, simply log in, find a phrase in your language that you can improve and suggest a new translation – or vote for an existing suggestion. As soon as your suggestions are reviewed and accepted, the new phrases become immediately available in Telegram apps, no updates required.

+

Official Translations

+

We're gradually expanding the list of languages available to all users from the “Language” menu in their apps. If you would like to help us maintain the official translation to your language on a continuous basis, see this page.

+
+

Style Guide

+

We think a good translation should be:

+
1. Consistent
+

The same things need to have the same names everywhere. Not just within one app, but also on all platforms. Telegram features should have the same names on Android, iOS, Windows and macOS – unless they have to do with platform defaults. For system features, we should always use platform defaults (unless they are truly ugly or don't fit).

+
2. Natural
+

You don't have to always stick to the English original. Sometimes it makes more sense to simply describe what the app does in your own language.

+

But please don't get carried away:

+
3. Default
+

It's no longer 2001 and our users have seen many other apps. It will be much easier for them to use Telegram if familiar concepts have familiar names here. Whenever you're looking for a word, focus on those that people are used to seeing in relevant context. What does Apple use in this case? What does Google use? What do Telegram's main competitors in your region use?

+
4. Beautiful
+

Use good language that would make the app look as if it was built in your region. Respect your language's grammar and style where possible. Avoid abbreviations. Try to find ways around gender problems instead of going for things like o(a), unless the workaround looks even more awkward. In most cases it's possible to find a way of saying anything without hurting the language.

+
5. And it MUST FIT
+

This last one is never easy. Sometimes you need to look to the surrounding phrases and change them for the problematic phrase to fit and work.

+
+

An example: the German team couldn't make the secret chats description fit into the lines on an empty chat page. The English text says: 'A user has invited you to a secret chat. Secret chats:' then comes a list that has this item: 'use end-to-end encryption'. The maximum length for the list items is 25 characters. The problem with German is that the term for end-to-end encryption is 'Ende-zu-Ende Verschlüsselung' and is 28 characters long even without the 'use'. An anglicized version would have been 'End-to-end Verschlüsselung' — but it's still too long at 26 characters.

+

The German team found a workaround. They went and changed the first phrase, so that it now says 'A user has invited you to an end-to-end encrypted secret chat. Secret chats:' and then they came up with a new list item to replace the E2E encryption one, which was moved to the top - where there was enough room.

+
+
+

Typography

+

What we're looking for is not just linguistic, but also typographic and aesthetic correctness. The text is inseparable from design. Text is design and we need to make sure it works. So approach the text as a magazine editor would:

+
    +
  1. Everything must fit into its allotted space. So always check in-app after editing. Words and phrases that are too long will be automatically cut (Like thi…) or contracted (Li…is) — we can't allow this to happen. In other cases the text may flow over into the next line.
  2. +
  3. The text should ideally be kept from spreading over two lines where the original only has one line.
  4. +
  5. Same with double lines, try to avoid letting them spread into triple lines. Although this is a less strict requirement — it isn't too bad if you let the double-line descriptions in Settings become triple lined.
  6. +
  7. We need to avoid hanging words when there's just one or two words left on a new line.
  8. +
  9. We need to avoid gaps in the text, for example when the top right space is empty before the line break. A good way of avoiding this is to use shorter words, so that they wrap more easily. When short words are not an option, put your long ones at the beginning of the line, then add short words as padding.
  10. +
  11. There will be times when making things fit will seem impossible. Our experience shows that it never is. Several determined people focusing on a word and the phrases around it will always find a solution after a few weeks, or even earlier. After all, it's just words.
  12. +
+

This takes some effort, but it really makes you feel proud when you're done.

+
+

Applied Typography

+

On the whole, we've worked hard to make the English version as typographically sound as possible. So as a rule of thumb, if your phrase is the same length as the English one, it will fit well. If it is shorter — not too much of a problem, but beware of hanging words and gaps.

+

Note for iPhone Plus users: When checking strings in-app, try iOS Settings > Display & Brightness > View > 'Zoomed'. Using this mode you can make sure that strings will fit the screens of the narrower models.

+
+

And that‘s about it. Let’s bring perfection to the localized versions of Telegram, together.

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en.html b/data/translations.telegram.org/en.html new file mode 100644 index 0000000000..19b6f50bb3 --- /dev/null +++ b/data/translations.telegram.org/en.html @@ -0,0 +1,333 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+

+ English (English) + +

+
+ +
+
+

DiscussionsNEW

+

+ Feel free to join the discussion of this language pack. + View Discussion +

+
+
+

Sharing LinkNEW

+

+ Anyone can switch their Telegram interface to English by following this link: +

+ +
+
+

Actions

+ +
+
+
+ +
English
+
English
+
Please open this link on a desktop to help translate Telegram into English:
+ + +
Feel free to join the discussion of this language pack.
+
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/android.html b/data/translations.telegram.org/en/android.html new file mode 100644 index 0000000000..8396fd1e5b --- /dev/null +++ b/data/translations.telegram.org/en/android.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ Android4038 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/android_x.html b/data/translations.telegram.org/en/android_x.html new file mode 100644 index 0000000000..c49d547b7f --- /dev/null +++ b/data/translations.telegram.org/en/android_x.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ Android X3163 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/ios.html b/data/translations.telegram.org/en/ios.html new file mode 100644 index 0000000000..f0009150fb --- /dev/null +++ b/data/translations.telegram.org/en/ios.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ iOS4663 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/macos.html b/data/translations.telegram.org/en/macos.html new file mode 100644 index 0000000000..ec183cb52a --- /dev/null +++ b/data/translations.telegram.org/en/macos.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ macOS3412 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/tdesktop.html b/data/translations.telegram.org/en/tdesktop.html new file mode 100644 index 0000000000..ef442ecec8 --- /dev/null +++ b/data/translations.telegram.org/en/tdesktop.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ TDesktop2701 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/tsf.telegram.org/js/main.js b/data/tsf.telegram.org/js/main.js new file mode 100644 index 0000000000..898af98e24 --- /dev/null +++ b/data/tsf.telegram.org/js/main.js @@ -0,0 +1,675 @@ +var startTime = +(new Date()); +function dT() { + return '[' + ((+(new Date()) - startTime)/ 1000.0) + '] '; +} + +var jsonpCallbacks = []; +function twitterCustomShareInit () { + var btns = document.querySelectorAll + ? document.querySelectorAll('.tl_twitter_share_btn') + : [document.getElementById('tl_twitter_share_btn')]; + + if (!btns.length) { + return; + } + var head = document.getElementsByTagName('head')[0], i, script; + for (i = 0; i < btns.length; i++) { + (function (btn) { + var status = btn.getAttribute('data-text'), + url = btn.getAttribute('data-url') || location.toString() || 'https://telegram.org/', + via = btn.getAttribute('data-via'), + urlEncoded = encodeURIComponent(url), + popupUrl = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(status) + '&url=' + urlEncoded + '&via=' + encodeURIComponent(via); + + btn.setAttribute('href', popupUrl); + btn.href = popupUrl; + + btn.addEventListener('click', function (e) { + var popupW = 550, + popupH = 450, + params = [ + 'width=' + popupW, + 'height=' + popupH, + 'left=' + Math.round(screen.width / 2 - popupW / 2), + 'top=' + Math.round(screen.height / 2 - popupH / 2), + 'personalbar=0', + 'toolbar=0', + 'scrollbars=1', + 'resizable=1' + ].join(','), + popup = window.open(popupUrl, '_blank', params); + + if (popup) { + try { + popup.focus(); + } catch (e) {} + } + + return cancelEvent(e); + }, false); + })(btns[i]); + } +} + +function blogRecentNewsInit () { + if (document.querySelectorAll) { + var sideImages = document.querySelectorAll('.blog_side_image_wrap'); + var sideImage, parent, i; + var len = len = sideImages.length; + for (i = 0; i < len; i++) { + sideImage = sideImages[i]; + parent = sideImage.parentNode.parentNode; + if (parent) { + parent.insertBefore(sideImage, parent.firstChild); + } + } + } + + var moreBtn = document.getElementById('tlb_blog_head_more_link'); + if (!moreBtn) { + return false; + } + + var activeClassName = 'tlb_blog_head_recent_active'; + moreBtn.addEventListener('click', function (event) { + var parent = this.parentNode; + var className = parent.className; + if (className.indexOf(activeClassName) == -1) { + className += ' ' + activeClassName; + } else { + className = className.replace(' ' + activeClassName, ''); + } + parent.className = className; + + return cancelEvent(event); + }); +} + +function blogSideImageUpdate(argument) { + var isDesktop = document.documentElement.offsetWidth >= 1000 + document.querySelectorAll('.blog_side_image_wrap').forEach(function (imageWrap) { + if (isDesktop) { + var titleHeight = imageWrap.parentNode.previousElementSibling.clientHeight; + var beforeTitleEl = imageWrap.parentNode.previousElementSibling.previousElementSibling; + if (beforeTitleEl) { + titleHeight += beforeTitleEl.clientHeight; + } + imageWrap.firstElementChild.style.marginTop = (-titleHeight - 8) + 'px'; + } else { + imageWrap.firstElementChild.style.marginTop = ''; + } + }) +} + +function blogSideImageInit() { + window.addEventListener('resize', blogSideImageUpdate, false); + setTimeout(blogSideImageUpdate, 0); +} + +function cancelEvent (event) { + event = event || window.event; + if (event) event = event.originalEvent || event; + + if (event.stopPropagation) event.stopPropagation(); + if (event.preventDefault) event.preventDefault(); + + return false; +} + +function trackDlClick (element, event) { + var href = element.getAttribute('href'), + track = element.getAttribute('data-track') || false; + + if (!track || !window.ga) { + return; + } + + var trackData = track.toString().split('/'); + + ga('send', 'event', trackData[0], trackData[1], href); + + if ((element.getAttribute('target') || '').toLowerCase() != '_blank') { + setTimeout(function() { location.href = href; }, 200); + return false; + } +} + +var toTopWrapEl, + toTopEl, + pageContentWrapEl, + curVisible, + curShown = false; +function backToTopInit (labelHtml) { + pageContentWrapEl = document.getElementById('dev_page_content_wrap'); + if (!pageContentWrapEl) { + return false; + } + var t = document.createElement('div'); + + t.innerHTML = '
' + labelHtml + '
'; + toTopEl = t.firstChild; + t.innerHTML = ''; + toTopWrapEl = t.firstChild; + + toTopWrapEl.appendChild(toTopEl); + document.body.appendChild(toTopWrapEl); + + if (window.addEventListener) { + window.addEventListener('resize', backToTopResize, false); + window.addEventListener('scroll', backToTopScroll, false); + } + backToTopResize(); +} + +function backToTopGo () { + window.scroll(0, 0); + backToTopScroll(); +} + +function backToTopResize () { + var left = getXY(pageContentWrapEl)[0], + dwidth = Math.max(window.innerWidth, document.documentElement.clientWidth, 0), + dheight = Math.max(window.innerHeight, document.documentElement.clientHeight); + + curVisible = pageContentWrapEl && left > 130 && dwidth > 640; + toTopWrapEl.style.width = left + 'px'; + toTopEl.style.height = dheight + 'px'; + backToTopScroll(); +} + +function backToTopScroll () { + var st = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop || document.documentElement.scrollTop; + if ((st > 400 && curVisible) != curShown) { + curShown = !curShown; + if (curShown) { + toTopWrapEl.classList.add('back_to_top_shown'); + } else { + toTopWrapEl.classList.remove('back_to_top_shown'); + } + } +} + +function removePreloadInit() { + if (window.addEventListener) { + window.addEventListener('load', function () { + document.body.classList.remove('preload'); + }, false); + } else { + setTimeout(function () { + document.body.classList.remove('preload'); + }, 1000) + } +} + +function getXY (obj) { + if (!obj) return [0, 0]; + + var left = 0, top = 0; + if (obj.offsetParent) { + do { + left += obj.offsetLeft; + top += obj.offsetTop; + } while (obj = obj.offsetParent); + } + return [left, top]; +} + + +var onDdBodyClick, + currentDd; +function dropdownClick (element, event) { + var parent = element.parentNode; + var isOpen = (parent.className || '').indexOf('open') > 0; + if (currentDd && currentDd != parent) { + dropdownHide(currentDd); + } + if (!isOpen) { + parent.className = (parent.className || '') + ' open'; + if (!onDdBodyClick) { + window.addEventListener('click', dropdownPageClick, false); + } + currentDd = parent; + } else { + dropdownHide(currentDd); + currentDd = false; + } + event.cancelBubble = true; + return false; +} + +function dropdownHide (parent) { + parent.className = parent.className.replace(' open', ''); +} + +function dropdownPageClick (event) { + if (currentDd) { + dropdownHide(currentDd); + currentDd = false; + } +} + +function escapeHTML (html) { + html = html || ''; + return html.replace(/&/g, '&') + .replace(/>/g, '>') + .replace(/'); + var lastLi = false; + var items = 0; + $('a.anchor').each(function (k, anchor) { + var parentTag = anchor.parentNode.tagName; + var matches = parentTag.match(/^h([34])$/i); + var anchorName = anchor.name; + if (!matches || !anchorName) { + return; + } + anchor.id = anchor.name; + var level = parseInt(matches[1]); + var li = $('
  • ' + escapeHTML(anchor.nextSibling.textContent) + '
  • '); + if (level == 3) { + li.appendTo(menu); + lastLi = li; + } else { + // console.log(lastLi); + if (!lastLi) { + return; + } + var subMenu = $('ul', lastLi)[0] || $('').appendTo(lastLi); + // console.log(subMenu); + li.appendTo(subMenu); + } + items++; + }); + // console.log(items, menu); + // console.timeEnd('page nav'); + if (items < 2) { + return false; + } + + return menu; +} + +function showTitleIfOverflows(element) { + if (element && + element.innerText && + element.scrollWidth && + element.offsetWidth && + element.offsetWidth < element.scrollWidth) { + element.setAttribute('title', element.innerText); + } + else if (element.removeAttribute) { + element.removeAttribute('title'); + } +} + +function initDevPageNav() { + window.hasDevPageNav = true; + var menu = getDevPageNav(); + if (!menu) { + return; + } + var sideNavCont = $('#dev_side_nav_cont'); + if (!sideNavCont.length) { + sideNavCont = $('#dev_page_content_wrap'); + } + var sideNavWrap = $('
    ').prependTo(sideNavCont); + var sideNav = $('
    ').appendTo(sideNavWrap); + menu.appendTo(sideNav); + $('body').css({position: 'relative'}).scrollspy({ target: '.dev_side_nav' }); + + $('body').on('activate.bs.scrollspy', function () { + $('.dev_side_nav > ul').affix('checkPosition'); + var active_el = $('.dev_side_nav li.active').get(-1); + if (active_el) { + if (active_el.scrollIntoViewIfNeeded) { + active_el.scrollIntoViewIfNeeded(); + } else if (active_el.scrollIntoView) { + active_el.scrollIntoView(false); + } + } + }); + $('body').trigger('activate.bs.scrollspy'); + + updateMenuAffix(menu); +} + +function updateDevPageNav() { + if (!window.hasDevPageNav) { + return; + } + var menu = getDevPageNav() || $(''); + $('.dev_side_nav > ul').replaceWith(menu); + $('body').scrollspy('refresh'); + updateMenuAffix(menu); +} + +function updateMenuAffix(menu) { + menu.affix({ + offset: { + top: function () { + return $('.dev_side_nav_wrap').offset().top; + }, + bottom: function () { + return (this.bottom = $('.footer_wrap').outerHeight(true) + 20) + } + } + }) +} + + +function initScrollVideos(desktop) { + var videos = document.querySelectorAll + ? document.querySelectorAll('video.tl_blog_vid_autoplay') + : []; + + window.pageVideos = Array.prototype.slice.apply(videos); + if (!pageVideos.length) { + return; + } + window.pageVideosPlaying = {}; + + var index = 1; + var tgStickersCnt = document.querySelectorAll('.js-tgsticker_image').length; + var preloadVideos = tgStickersCnt ? 0 : 2; + for (var i = 0; i < pageVideos.length; i++) { + var videoEl = pageVideos[i]; + videoEl.setAttribute('vindex', index++); + videoEl.setAttribute('preload', i >= preloadVideos ? 'metadata' : 'auto'); + videoEl.preload = i >= preloadVideos ? 'metadata' : 'auto'; + if (desktop) { + videoEl.removeAttribute('controls'); + videoEl.autoplay = false; + videoEl.removeAttribute('autoplay'); + } else { + videoEl.autoplay = true; + videoEl.playsinline = true; + videoEl.setAttribute('autoplay', 'autoplay'); + videoEl.setAttribute('playsinline', 'playsinline'); + } + } + if (!desktop) { + return; + } + + window.addEventListener('scroll', checkScrollVideos, false); + window.addEventListener('resize', checkScrollVideos, false); + setTimeout(checkScrollVideos, 1000); +} + +function checkScrollVideos() { + var w = window, + d = document, + e = d.documentElement, + g = d.getElementsByTagName('body')[0], + winWidth = w.innerWidth || e.clientWidth || g.clientWidth, + winHeight = w.innerHeight|| e.clientHeight|| g.clientHeight, + scrollTop = e.scrollTop || g.scrollTop || w.pageYOffset; + + for (var i = 0; i < pageVideos.length; i++) { + var videoEl = pageVideos[i]; + var curIndex = videoEl.getAttribute('vindex'); + var posY = getFullOffsetY(videoEl); + var height = videoEl.offsetHeight; + // console.log(scrollTop, winHeight, posY, height); + + + if (isVisibleEnough(posY, height, scrollTop, winHeight, 0.7, 0.9)) { + if (!pageVideosPlaying[curIndex]) { + pageVideosPlaying[curIndex] = true; + console.log('play', videoEl); + videoEl.play(); + } + } else { + if (pageVideosPlaying[curIndex]) { + delete pageVideosPlaying[curIndex]; + console.log('pause', videoEl); + videoEl.pause(); + } + } + } +} + +function isVisibleEnough(boxOffset, boxSize, viewOffset, viewSize, boxThreshold, viewThreshold) { + var boxEnd = boxOffset + boxSize; + var viewEnd = viewOffset + viewSize; + var viewBox = Math.min(viewEnd, boxEnd) - Math.max(boxOffset, viewOffset); + if (viewBox < 0) { + return false; + } + if (viewBox / boxSize > boxThreshold) { + return true; + } + if (viewThreshold && viewBox / viewSize > viewThreshold) { + return true; + } + return false +} + +function getFullOffsetY(el) { + var offsetTop = el.offsetTop || 0; + if (el.offsetParent) { + offsetTop += getFullOffsetY(el.offsetParent); + } + return offsetTop; +} + +function redraw(el) { + el.offsetTop + 1; +} + +function initRipple() { + if (!document.querySelectorAll) return; + var rippleTextFields = document.querySelectorAll('.textfield-item input.form-control'); + for (var i = 0; i < rippleTextFields.length; i++) { + (function(rippleTextField) { + function onTextRippleStart(e) { + if (document.activeElement === rippleTextField) return; + var rect = rippleTextField.getBoundingClientRect(); + if (e.type == 'touchstart') { + var clientX = e.targetTouches[0].clientX; + } else { + var clientX = e.clientX; + } + var ripple = rippleTextField.parentNode.querySelector('.textfield-item-underline'); + var rippleX = (clientX - rect.left) / rippleTextField.offsetWidth * 100; + ripple.style.transition = 'none'; + redraw(ripple); + ripple.style.left = rippleX + '%'; + ripple.style.right = (100 - rippleX) + '%'; + redraw(ripple); + ripple.style.left = ''; + ripple.style.right = ''; + ripple.style.transition = ''; + } + rippleTextField.removeEventListener('mousedown', onTextRippleStart); + rippleTextField.removeEventListener('touchstart', onTextRippleStart); + rippleTextField.addEventListener('mousedown', onTextRippleStart); + rippleTextField.addEventListener('touchstart', onTextRippleStart); + })(rippleTextFields[i]); + } + var rippleHandlers = document.querySelectorAll('.ripple-handler'); + for (var i = 0; i < rippleHandlers.length; i++) { + (function(rippleHandler) { + function onRippleStart(e) { + var rippleMask = rippleHandler.querySelector('.ripple-mask'); + if (!rippleMask) return; + var rect = rippleMask.getBoundingClientRect(); + if (e.type == 'touchstart') { + var clientX = e.targetTouches[0].clientX; + var clientY = e.targetTouches[0].clientY; + } else { + var clientX = e.clientX; + var clientY = e.clientY; + } + var rippleX = (clientX - rect.left) - rippleMask.offsetWidth / 2; + var rippleY = (clientY - rect.top) - rippleMask.offsetHeight / 2; + var ripple = rippleHandler.querySelector('.ripple'); + ripple.style.transition = 'none'; + redraw(ripple); + ripple.style.transform = 'translate3d(' + rippleX + 'px, ' + rippleY + 'px, 0) scale3d(0.2, 0.2, 1)'; + ripple.style.opacity = 1; + redraw(ripple); + ripple.style.transform = 'translate3d(' + rippleX + 'px, ' + rippleY + 'px, 0) scale3d(1, 1, 1)'; + ripple.style.transition = ''; + + function onRippleEnd(e) { + ripple.style.transitionDuration = '.2s'; + ripple.style.opacity = 0; + document.removeEventListener('mouseup', onRippleEnd); + document.removeEventListener('touchend', onRippleEnd); + document.removeEventListener('touchcancel', onRippleEnd); + } + document.addEventListener('mouseup', onRippleEnd); + document.addEventListener('touchend', onRippleEnd); + document.addEventListener('touchcancel', onRippleEnd); + } + rippleHandler.removeEventListener('mousedown', onRippleStart); + rippleHandler.removeEventListener('touchstart', onRippleStart); + rippleHandler.addEventListener('mousedown', onRippleStart); + rippleHandler.addEventListener('touchstart', onRippleStart); + })(rippleHandlers[i]); + } +} + +function mainInitRetinaVideos() { + var videoEls = document.querySelectorAll('video.video__init_retina'); + var isRetina = window.devicePixelRatio >= 1.5; + var videoEl, i, badChildren, j, badChild, sources, sourceEl; + for (i = 0; i < videoEls.length; i++) { + videoEl = videoEls[i]; + sources = (videoEl.getAttribute('data-sources')||'').split(','); + sourceEl = document.createElement('source'); + sourceEl.type = 'video/mp4'; + sourceEl.src = sources[isRetina ? 1 : 0]; + videoEl.appendChild(sourceEl); + videoEl.classList.remove('video__init_retina'); + videoEl.setAttribute('preload', 'auto'); + } +} + +function mainInitDemoAutoplay(videoLinkElsSelector) { + var videoLinkEls = document.querySelectorAll(videoLinkElsSelector); + var videoLinkEl, videoEl, i; + for (i = 0; i < videoLinkEls.length; i++) { + videoLinkEl = videoLinkEls[i]; + videoEl = videoLinkEl.querySelector('video'); + if (!videoEl) { + continue; + } + if (videoEl.readyState > 1) { + mainDemoVideoHover(videoLinkEl, 1); + } else { + videoEl.load(); + videoEl.addEventListener('loadeddata', (function(el) { + return function () { + setTimeout(function () { + mainDemoVideoHover(el, 1); + }, 0) + } + })(videoLinkEl), false); + } + } +} + +function mainDemoVideoHover(videoLinkEl, isHover) { + var outTimeout = videoLinkEl.outTimeout; + var curIsHover = videoLinkEl.isHover || 0; + if (outTimeout) { + clearTimeout(outTimeout); + } + if (curIsHover == isHover) { + return false; + } + if (!isHover) { + outTimeout = setTimeout(function () { + mainDemoVideoDoHover(videoLinkEl, isHover) + }, 100); + videoLinkEl.outTimeout = outTimeout; + return false; + } + mainDemoVideoDoHover(videoLinkEl, isHover); +} + +function mainDemoVideoDoHover(videoLinkEl, isHover) { + delete videoLinkEl.outTimeout; + + var videoEl = videoLinkEl.querySelector('video'); + if (isHover) { + if (videoEl.readyState > 1) { + videoLinkEl.classList.add('video_play'); + videoEl.play(); + videoLinkEl.isHover = 1; + } + } else { + videoLinkEl.isHover = 0; + } + if (!videoEl.inited) { + videoEl.inited = true; + // videoEl.onended = + videoEl.addEventListener('ended', function onVideoEnded(e) { + if (videoLinkEl.isHover) { + videoEl.currentTime = 0; + videoEl.play(); + } else { + videoEl.pause(); + videoEl.currentTime = 0; + videoLinkEl.classList.remove('video_play') + } + }, false); + } +} + +function mainInitTgStickers(options) { + options = options || {}; + if (!RLottie.isSupported) { + if (options.unsupportedURL) { + if (!getCookie('stel_notgs')) { + setCookie('stel_notgs', 1, 7); + } + location = options.unsupportedURL; + } + return false; + } + document.querySelectorAll('.js-tgsticker_image').forEach(function (imgEl) { + RLottie.init(imgEl, options); + }); +} + +function setCookie(name, value, days) { + var expires = ''; + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 86400000)); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + (value || "") + expires + "; path=/"; +} + +function getCookie(name) { + var nameEQ = name + '='; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') { + c = c.substr(1, c.length); + } + if (c.indexOf(nameEQ) == 0) { + return c.substr(nameEQ.length, c.length); + } + } + return null; +} diff --git a/data/tsf.telegram.org/manuals/answering_questions.html b/data/tsf.telegram.org/manuals/answering_questions.html new file mode 100644 index 0000000000..faae32817f --- /dev/null +++ b/data/tsf.telegram.org/manuals/answering_questions.html @@ -0,0 +1,265 @@ + + + + + Telegram Support Force + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +

    Answering Questions

    + +

    We answer questions. This document holds general ideas on how to handle them.
    This was intended for volunteers of the Telegram Support Force, but anyone else is free to take a look as well.

    +

    General

    +
      +
    1. Our goal is to bring human support to human beings. To achieve this goal, we rely on volunteers. Your pay is perfection in what you do, so be cool.

      +
    2. +
    3. Corporate support standards do not apply here. Treat people in a kind, personal, informal manner. No need to pretend to be something you are not (unless you're a dog in disguise — keep human appearances in this case).

      +
    4. +
    5. Never lie to people.

      +
    6. +
    7. Check everything before you reply. Things change or may no longer work the way you remember. This includes interface details, links (!) and, well, everything.

      +
    8. +
    9. Support is a form of Art, so be fun and creative.

      +
    10. +
    +

    The result

    +

    As support volunteers, we need to provide a solution for the user. Remember, that this doesn't always have to be the solution the user was asking for. So first, we want to understand the problem that drove them to ask the question. And then find a way of solving — completely or partially — that problem.

    +

    For example, some users ask us for an option to send sketches or drawings to their friends. While this is not possible directly, one could take a photo with their thumb on the camera (to get a black picture), then use the drawing tools built into the photo editor to make their doodle.

    +

    This isn‘t what the user was looking for, but it solves the problem — and it is even more flexible and customizable than the original idea (since you could also add stickers and emoji out of the box). Some solutions are less elegant. For example, right now you can’t email your Telegram conversations. While there is much less need to do so, since you can access everything in the cloud from any of your devices, this may be a problem in some cases. What one could do then, is open the conversation in Telegram Web (or any other desktop client), select multiple messages with the mouse, then copy and paste them into a text document. Any solution is better than no solution at all.

    +

    There will be cases, when it is not possible to solve the problem at all. As a user in this situation, I want that people on the other end of the line understand me and care about the whole thing. Therefore, two things become important:

    +
      +
    • Make it clear that you understand the issue. ‘No, you can’t do that‘ is not a good answer. ’No, I‘m afraid it is not possible to make Telegram wash your dishes in a fast and securely encrypted way’ — is better.
    • +
    • Be gentle. Gentle doesn‘t mean soft — if we really can’t do something, it means just that — we can‘t. But adding ’Sorry about that' helps a lot.
    • +
    +

    Lastly, whatever the outcome, I always look for help from a human being, not a dumb interface. When you're casual and witty, the user feels more at ease. On the other hand, human beings, as opposed to dumb interfaces, usually understand what is appropriate in which situation. For example, when a user is in distress, he most likely needs help first — and jokes can wait until the crisis has been dealt with.

    +
    +

    To sum up, we need to be: smart (to identify the problem and find an approach to the user), inventive (to find a solution, not always the obvious one), compassionate (in case there is no immediate solution) — and witty (otherwise it gets boring). I'm sure we are.

    +

    What if I don't know the answer

    +

    Happens to all. Don't worry, you can always find one. The TSF BIOS will tell you what to do in most situations. In case it doesn‘t or you’re not sure, ask your fellow volunteers in the group — they should know. If worst comes to worst, consult Markus.

    +

    Admitting you don't know something is infinitely better than trying to cover it up. So when cornered use this mantra: ‘I’m afraid I don‘t know this. Will ask my teammates and get back to you’. Just make sure that the question is not in the FAQs before you say this.

    +

    Handling user suggestions

    +

    The three rules for requests and suggestions are: don‘t lie, don’t promise anything, and don't give an exact timeframe.

    +
      +
    • The internal Suggestions board on Trello has a list of most frequently suggested features together with estimations on how likely, when and why they will be introduced.
    • +
    • For insights into the decision making process, check our Feature Philosophy.
    • +
    +

    Plans change frequently, so it‘s best if we only talk about things that exist. Never say that something will be done. ’We may do this‘, ’we will definitely add this at some point in the future‘ or ’this is coming soon' — is as far as we can go.

    +

    Same applies to the negative: never say we will never do something (except steal users‘ spouses and enslave their children, as mentioned in the general FAQ). The worst thing that can happen is ’we are currently not working on this‘, ’we may consider this', etc.

    +

    Even if you know something is happening tomorrow, say ‘in the next few days’. People love it when they get things earlier than they expected — and get downright angry if we get 5 minutes (or a few months) late.

    +

    Reporting bugs in Telegram

    +

    Every now and then you will get actual bug-reports. We have an internal board on trello, so you will be able to search all known issues and get the relevant info.

    +
      +
    • The Handling Bugs manual covers all you need to know about bug reporting in Telegram.
    • +
    • The internal Issues board on Trello lists all known issues.
    • +
    +

    If you are not part of the team and are looking for advanced troubleshooting tips, you may find the Troubleshooting section interesting.

    +

    Chatting

    +

    Truth is, most users come to simply say ‘hello’. Hello them back if you have the time. Sometimes these users do have a question after all. In other cases they may be new to Telegram, without many friends to chat with or show them around. So you can tell them more about Telegram, point to interesting features — or even other Telegram apps. No need to advertise, just explain what needs explaining.

    +

    Remember: we’re here to help those we can help and talk to others that we feel we have the time to talk to, but not more. If kids get too insistent without any real needs, it’s ok to ignore them after a few replies. If somebody seems to be a nice conversation partner, it’s always a good idea to discuss Telegram, see what the user thinks is missing. Maybe tell them about our Support Initiative.

    +

    Real-life problems

    +

    Unfortunately, we cannot really help people with real-life problems. A few kind words wouldn‘t hurt, but generally we should send those users to places where they can get actual help, like a crisis line or chat. (Now, if you want to be a member of the TSF and read this far, go send a picture of a kangaroo to the auditions account. No, this is not a joke. It is a test that helps us understand whether or not you actually read this. And don’t tell others. If you're already a member, you know what to do: humpa viceroy squid)

    +

    Insults

    +

    Yep, everyone gets their share of those. First of all, remember that these people are not really talking to you. They just see an abstract ‘Telegram’ entity. My advice is to humor them — I usually send a ‘well, that escalated quickly’ picture and it helps many users. Joke around with them and you’ll be surprised how that can humble people. And never insult back, even if they manage to get you angry for some reason. Nonviolent irony is always your best — and only — weapon.

    +
    +
    Other TSF documents:
    +

    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + +