Repository: syncthing/syncthing
File: gui/default/syncthing/core/syncthingController.js (JavaScript)

Code before:
                // Fallback for modern browsers on HTTP and non-IE old browsers.
                // Check for document.queryCommandSupported("copy") support is
                // omitted on purpose, as old Chrome versions reported "false"
                // despite supporting the feature.
                var textarea = document.createElement("textarea");
                event.currentTarget.appendChild(textarea);
                textarea.style.position = "fixed";
                textarea.style.opacity = "0";
                textarea.textContent = text;
                textarea.select();
                try {
                    document.execCommand("copy");
                    return alert(success);
                }
                catch (ex) {
                    return alert(failure);
                }
                finally {
                    event.currentTarget.removeChild(textarea);
                }
            }
            return alert(failure);
        };

        $scope.shareDeviceIdBy = function(channel) {
            var body = $translate.instant("You have been invited to connect with {%name%} using Syncthing!", {name: $scope.currentDevice.name}) + "\r\n\r\n" + $translate.instant("Accept the invitation by adding a new device using the following ID.") + $translate.instant("If unsure what to do, continue reading below.") + "\r\n\r\n" + $scope.currentDevice.id + "\r\n\r\n" + $translate.instant("Syncthing is a continuous file synchronization program.") + $translate.instant("It synchronizes files between two or more computers in real time, safely protected from prying eyes.") + $translate.instant("Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it's transmitted over the internet.") + "\r\n\r\n" + $translate.instant("For more information about Syncthing please visit https://syncthing.net.");

            if (channel == 'email') {
                var subject = $translate.instant("Invitation to connect with {%name%} using Syncthing", {name: $scope.currentDevice.name});
                location.href = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
            } else if (channel == 'sms') {
                location.href = "sms://;?&body=" + encodeURIComponent(body);
            }
        }
    })
    .directive('shareTemplate', function () {
        return {
            templateUrl: 'syncthing/core/editShareTemplate.html',
            scope: {
                selected: '=',
                encryptionPasswords: '=',
                id: '@',
                label: '@',
                folderType: '@',
                untrusted: '=',
            },
            link: function(scope, elem, attrs) {
                var plain = false;
                scope.togglePasswordVisibility = function() {
                    scope.plain = !scope.plain;
                };

Review comment (bug):
This should really be broken into several source lines, e.g.

```
var body = $translate.instant(...);
body += '\r\n\r\n';
body += $translate.instant(...);
```
and so on...

Watch out for missing whitespace between individually translated text spans.

Also I'm not sure going for single sentences is wise here.  Should one of them ever get changed, looking at a partly translated message might be even more confusing.  We can translate whole paragraphs fine I guess.

Code after:

            var arch = {
                '386': '32-bit Intel/AMD',
                'amd64': '64-bit Intel/AMD',
                'arm': '32-bit ARM',
                'arm64': '64-bit ARM',
                'ppc64': '64-bit PowerPC',
                'ppc64le': '64-bit PowerPC (LE)',
                'mips': '32-bit MIPS',
                'mipsle': '32-bit MIPS (LE)',
                'mips64': '64-bit MIPS',
                'mips64le': '64-bit MIPS (LE)',
                'riscv64': '64-bit RISC-V',
                's390x': '64-bit z/Architecture',
            }[$scope.version.arch] || $scope.version.arch;

            return $scope.version.version + ', ' + os + ' (' + arch + ')';
        };

        $scope.versionBase = function () {
            if (!$scope.version.version) {
                return '';
            }
            var version = $scope.version.version;
            var pos = version.indexOf('-');
            if (pos > 0) {
                version = version.slice(0, pos);
            }
            return version;
        };

        $scope.docsURL = function (path) {
            var url = 'https://docs.syncthing.net';
            if (!path) {
                // Undefined or null should become a valid string.
                path = '';
            }
            var hash = path.indexOf('#');
            if (hash != -1) {
                url += '/' + path.slice(0, hash);
                url += '?version=' + $scope.versionBase();
                url += path.slice(hash);
            } else {
                url += '/' + path;
                url += '?version=' + $scope.versionBase();
            }
            return url;
        };

        $scope.inputTypeFor = function (key, value) {
            if (key.substr(0, 1) === '_') {