-
-
-
-
-
+
+
+
+
+
-
+
@@ -415,27 +416,27 @@
-
-
-
-
-
+
+
+
+
+
- Could not load license.txt.
+ [[localize('error-licenses')]]
@@ -445,7 +446,19 @@
const TOS_ACK_LOCAL_STORAGE_KEY = 'tos-ack';
Polymer({
is: 'app-root',
+ behaviors: [
+ Polymer.AppLocalizeBehavior
+ ],
properties: {
+ useKeyIfMissing: {
+ type: Boolean,
+ value: true
+ },
+ language: {
+ type: String,
+ readonly: true,
+ value: 'en'
+ },
serverList: {
type: Array,
value: [],
@@ -497,6 +510,11 @@
'SetUpGcpRequested': 'handleSetUpGcpRequested',
'ManualServerEntryCancelled': 'handleManualCancelled'
},
+ ready: function() {
+ // TODO(alalama): detect language
+ const messagesUrl = `/messages/${this.language}.json`;
+ this.loadResources(messagesUrl, this.language);
+ },
showIntro: function () {
this.maybeCloseDrawer();
this.selectedServer = undefined;
@@ -566,9 +584,8 @@
showError: function (errorMsg) {
this.showToast(errorMsg, Infinity);
},
- showNotification: function (message) {
- const NOTIFICATION_TOAST_DURATION_MS = 3000;
- this.showToast(message, NOTIFICATION_TOAST_DURATION_MS);
+ showNotification: function (message, durationMs=3000) {
+ this.showToast(message, durationMs);
},
showToast: function(message, duration) {
const toast = this.$.toast;
@@ -589,15 +606,15 @@
// cb is a function which accepts a single boolean which is true iff
// the user chose to retry the failing operation.
showConnectivityDialog: function (cb) {
- const dialogTitle = 'Connection problem';
- const dialogText = 'We\'re having trouble connecting to your DigitalOcean account. This is sometimes a temporary problem with DigitalOcean or with your internet connection. If retrying doesn\`t work, logging into DigitalOcean again should fix the problem.';
- this.showModalDialog(dialogTitle, dialogText, ['cancel', 'retry'])
+ const dialogTitle = this.localize('error-connectivity-title');
+ const dialogText = this.localize('error-connectivity');
+ this.showModalDialog(dialogTitle, dialogText, [this.localize('cancel'), this.localize('retry')])
.then((clickedButtonIndex) => {
cb(clickedButtonIndex === 1); // pass true if user clicked retry
});
},
getConfirmation: function(title, text, confirmButtonText, continueFunc) {
- this.showModalDialog(title, text, ['Cancel', confirmButtonText])
+ this.showModalDialog(title, text, [this.localize('cancel'), confirmButtonText])
.then((clickedButtonIndex) => {
if (clickedButtonIndex === 1) { // user clicked to confirm.
continueFunc();
@@ -605,7 +622,7 @@
});
},
showManualServerError: function (errorTitle, errorText) {
- this.showModalDialog(errorTitle, errorText, ['cancel', 'retry'])
+ this.showModalDialog(errorTitle, errorText, [this.localize('cancel'), this.localize('retry')])
.then((clickedButtonIndex) => {
if (clickedButtonIndex == 1) {
this.$.manualEntry.retryTapped();
diff --git a/src/server_manager/ui_components/cities.html b/src/server_manager/ui_components/cities.html
deleted file mode 100644
index 4d696e76..00000000
--- a/src/server_manager/ui_components/cities.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/server_manager/ui_components/outline-about-dialog.html b/src/server_manager/ui_components/outline-about-dialog.html
index e5a9626c..17cbe562 100644
--- a/src/server_manager/ui_components/outline-about-dialog.html
+++ b/src/server_manager/ui_components/outline-about-dialog.html
@@ -62,16 +62,15 @@
-
Version [[outlineVersion]]
-
Outline is an open source project created by Jigsaw to provide a safer way for news organizations and journalists to access the internet. Learn more about Outline on our website.
-
Outline is powered by Shadowsocks and is still an early stage project. You can contribute to the code on GitHub, and follow us on Reddit and Medium to hear when we expand to more platforms and add new features.
+
+
>
@@ -80,6 +79,7 @@
Polymer({
is: 'outline-about-dialog',
properties: {
+ localize: {type: Function, readonly: true},
outlineVersion: String
},
open: function () {
diff --git a/src/server_manager/ui_components/outline-cloud-instructions-view.html b/src/server_manager/ui_components/outline-cloud-instructions-view.html
index fc69d9e2..ef860a2a 100644
--- a/src/server_manager/ui_components/outline-cloud-instructions-view.html
+++ b/src/server_manager/ui_components/outline-cloud-instructions-view.html
@@ -75,7 +75,7 @@
@@ -93,7 +93,8 @@
title: String,
imagePath: String,
thumbnailPath: String,
- instructions: Array
+ instructions: Array,
+ localize: {type: Function, readonly: true},
},
_openImage: function() {
this.fire('OpenImageRequested', {imagePath: this.imagePath});
diff --git a/src/server_manager/ui_components/outline-do-oauth-step.html b/src/server_manager/ui_components/outline-do-oauth-step.html
index eea1cc64..83fe4721 100644
--- a/src/server_manager/ui_components/outline-do-oauth-step.html
+++ b/src/server_manager/ui_components/outline-do-oauth-step.html
@@ -71,50 +71,50 @@
- Sign in or create an account with DigitalOcean.
- With your account, Outline makes it easy to create a server and get connected.
+ [[localize('oauth-connect-title')]]
+ [[localize('oauth-connect-description')]]

-
Waiting to connect your account...
+
[[localize('oauth-connect-tag')]]
- Cancel
+ [[localize('cancel')]]
- Activate you DigitalOcean account.
- Check your inbox for an email from DigitalOcean, and click the link in it to confirm your account.
+ [[localize('oauth-activate-account')]]
+ [[localize('oauth-verify')]]

-
Confirm your email...
+
[[localize('oauth-verify-tag')]]
- Sign Out
+ [[localize('oauth-sign-out')]]
- Activate you DigitalOcean account.
- Enter your billing information on digitalocean.com and return to the app once you are done.
+ [[localize('oauth-activate-account')]]
+ [[localize('oauth-billing')]]

-
Enter billing information...
+
[[localize('oauth-billing-tag')]]
- Sign Out
+ [[localize('oauth-sign-out')]]
- Activate you DigitalOcean account.
- Your DigitalOcean account has been activated.
+ [[localize('oauth-activate-account')]]
+ [[localize('oauth-account-active')]]

-
Account activated! Loading server locations...
+
[[localize('oauth-account-active-tag')]]
- Sign Out
+ [[localize('oauth-sign-out')]]
@@ -132,6 +132,10 @@
type: String,
value: 'Cancel'
},
+ localize: {
+ type: Function,
+ readonly: true
+ },
onCancel: Function
},
_cancelTapped: function() {
diff --git a/src/server_manager/ui_components/outline-feedback-dialog.html b/src/server_manager/ui_components/outline-feedback-dialog.html
index f688dc6a..c1a6417d 100644
--- a/src/server_manager/ui_components/outline-feedback-dialog.html
+++ b/src/server_manager/ui_components/outline-feedback-dialog.html
@@ -88,34 +88,31 @@ see https://github.com/PolymerElements/paper-swatch-picker/issues/36 -->
[[feedbackExplanation]]
- General feedback
- Having trouble installing Outline
- Can't connect to my server
- Others can't connect to my server
- Having trouble managing my server
- Suggestions
+ [[localize('feedback-general')]]
+ [[localize('feedback-install')]]
+ [[localize('feedback-connection')]]
+ [[localize('feedback-connection-others')]]
+ [[localize('feedback-management')]]
+ [[localize('feedback-suggestion')]]
-
+
DigitalOcean
Amazon Web Services
Google Cloud Platform
- Other
+ [[localize('feedback-other')]]
-
- Please note that our team is only able to answer feedback in English.
-
-
- Your feedback, email address (if provided) and additional information
- referred to in the privacy policy
- will be sent to the Outline team.
+
+
[[localize('feedback-disclaimer')]]
+
+
- Cancel
- Submit
+ [[localize('cancel')]]
+ [[localize('feedback-submit')]]
@@ -149,19 +146,25 @@ see https://github.com/PolymerElements/paper-swatch-picker/issues/36 -->
type: Boolean,
computed: '_computeShouldShowLanguageDisclaimer(hasEnteredEmail)',
},
+ localize: {
+ type: Function,
+ readonly: true
+ },
},
- open: function(prepopulatedMessage, showInstallationFailed, feedbackCategory = 0) {
+ open: function(prepopulatedMessage, showInstallationFailed) {
// Clear all fields, in case feedback had already been entered.
if (showInstallationFailed) {
- this.title = 'Outline Server Installation Failed';
- this.feedbackExplanation = 'An error occurred while attempting to install Outline on your server. If you haven\'t been able to figure out a solution, please consider sending us feedback and telling us your email address (optional) so that we can get back to you.';
+ this.title = this.localize('feedback-title-install');
+ this.feedbackExplanation = this.localize('feedback-explanation-install');
this.$.dialog.classList.add('installationFailed');
this.$.feedbackCategoryListbox.selected = this.feedbackCategories.INSTALLATION;
} else {
- this.title = 'Send Feedback';
+ this.title = this.localize('feedback-title-generic');
this.feedbackExplanation = '';
this.$.dialog.classList.remove('installationFailed');
- this.$.feedbackCategoryListbox.selected = feedbackCategory;
+ // TODO(alalama): figure out why the localized category doesn't get displayed the first
+ // time opening the dialog.
+ this.$.feedbackCategoryListbox.selected = this.feedbackCategories.GENERAL;
}
this.$.userFeedback.invalid = false;
this.$.userFeedback.value = prepopulatedMessage || '';
diff --git a/src/server_manager/ui_components/outline-intro-step.html b/src/server_manager/ui_components/outline-intro-step.html
index 01a35932..e13705d3 100644
--- a/src/server_manager/ui_components/outline-intro-step.html
+++ b/src/server_manager/ui_components/outline-intro-step.html
@@ -89,6 +89,7 @@
font-weight: 500;
letter-spacing: .05em;
font-size: 10px;
+ text-transform: uppercase;
}
.card#digital-ocean .tag, .card#digital-ocean .email, .card p {
color: var(--medium-gray);
@@ -155,13 +156,13 @@
- Choose a cloud service, set up Outline.
- Don't have a server? Create an account with DigitalOcean.
+ [[localize('setup-title')]]
+ [[localize('setup-description')]]
@@ -169,78 +170,78 @@
- - Easiest setup process
- - Only $5 a month
- - 1 TB of data transfer
- - Cancel at anytime
+ - [[localize('setup-do-easiest')]]
+ - [[localize('setup-do-cost')]]
+ - [[localize('setup-do-data')]]
+ - [[localize('setup-do-cancel')]]
- Create a new server with your DigitalOcean account for an additional $5 USD/30 days for 1TB of data transfer.
+ [[localize('setup-do-create')]]
Google Cloud Platform
- - Step-by-step set-up guide
- - Firewall instructions
- - Simple install commands
+ - [[localize('setup-step-by-step')]]
+ - [[localize('setup-firewall-instructions')]]
+ - [[localize('setup-simple-commands')]]
Amazon Web Services
- - Step-by-step set-up guide
- - EC2 firewall instructions
- - Simple install commands
+ - [[localize('setup-step-by-step')]]
+ - [[localize('setup-firewall-instructions')]]
+ - [[localize('setup-simple-commands')]]
-
Set up Outline anywhere
+
[[localize('setup-anywhere')]]
- - Tested on VULTR, Linode, and Liquid Web
- - Simple install commands
+ - [[localize('setup-tested')]]
+ - [[localize('setup-simple-commands')]]
@@ -254,6 +255,10 @@
properties: {
isSignedInToDigitalOcean: Boolean,
digitalOceanEmail: String,
+ localize: {
+ type: Function,
+ readonly: true,
+ },
},
connectToDigitalOceanTapped: function() {
this.fire('ConnectToDigitalOcean');
diff --git a/src/server_manager/ui_components/outline-manual-server-entry.html b/src/server_manager/ui_components/outline-manual-server-entry.html
index 058c8ef3..8b4c20f7 100644
--- a/src/server_manager/ui_components/outline-manual-server-entry.html
+++ b/src/server_manager/ui_components/outline-manual-server-entry.html
@@ -162,42 +162,43 @@
}
- Follow the instructions below
- These steps will help you install Outline on a [[cloudProviderName]] Linux server.
+ [[localize('manual-server-title')]]
+ [[localize('manual-server-description', 'cloudProvider', cloudProviderName)]]
-
+
- - Add a new firewall rule to your Compute Engine project.
- - Type 'outline' in the 'Name' field.
- - Type 'outline' in the 'Target tags' field.
- - Type '0.0.0.0/0' in the 'Source IP ranges' field.
- - Select 'Allow all' under 'Protocols and ports'.
- - Click 'Create'.
+
+ - [[localize('gcp-firewall-create-1')]]
+ - [[localize('gcp-firewall-create-2')]]
+ - [[localize('gcp-firewall-create-3')]]
+ - [[localize('gcp-firewall-create-4')]]
+ - [[localize('gcp-firewall-create-5')]]
-
+
- - Navigate to the VM instances screen.
- - Click on the instance where you want to host Outline.
- - Click 'EDIT' at the top of the VM Instance details screen.
- - Type 'outline' in the 'Network tags' field.
- - Click 'SAVE'.
+
+ - [[localize('gcp-firewall-assign-1')]]
+ - [[localize('gcp-firewall-assign-2')]]
+ - [[localize('gcp-firewall-assign-3')]]
+ - [[localize('gcp-firewall-assign-4')]]
@@ -207,33 +208,33 @@
-
+
- - Once you've created your EC2 instance, open the EC2 Management Console.
- - Under 'Network & Security', select 'Security Groups'.
- - Click on 'Create Security Group'.
- - Type 'outline' in the 'Security group name' and 'Description' fields.
- - Click 'Add Rule'.
- - Select 'All traffic' under 'Type', and 'Anywhere' under 'Source'.
+
+ - [[localize('aws-group-create-1')]]
+ - [[localize('aws-group-create-2')]]
+ - [[localize('aws-group-create-3')]]
+ - [[localize('aws-group-create-4')]]
+ - [[localize('aws-group-create-5')]]
-
+
- - Navigate to Instances.
- - Click 'Actions' > 'Networking' > 'Change Security Groups' at the top of the 'Instances' screen.
- - Select the 'outline' Security Group, unselect other security groups.
- - Click 'Assign Security Groups'.
+
+ - [[localize('aws-group-assign-1')]]
+ - [[localize('aws-group-assign-2')]]
+ - [[localize('aws-group-assign-3')]]
@@ -244,7 +245,7 @@
sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"
@@ -255,15 +256,15 @@
@@ -302,7 +303,11 @@
enableDoneButton: {
type: Boolean,
value: false,
- }
+ },
+ localize: {
+ type: Function,
+ readonly: true,
+ },
},
doneTapped: function() {
this.showConnection = true;
diff --git a/src/server_manager/ui_components/outline-metrics-option-dialog.html b/src/server_manager/ui_components/outline-metrics-option-dialog.html
index da9a26e6..67b1e08a 100644
--- a/src/server_manager/ui_components/outline-metrics-option-dialog.html
+++ b/src/server_manager/ui_components/outline-metrics-option-dialog.html
@@ -22,24 +22,30 @@
- Metrics sharing
- Share anonymized metrics to help improve the reliability and performance of Outline, for you and for those you share your server with. Learn more.
+ [[localize('metrics-title')]]
+
diff --git a/src/server_manager/ui_components/outline-server-progress-step.html b/src/server_manager/ui_components/outline-server-progress-step.html
index 3a9b1c4f..ed2c8779 100644
--- a/src/server_manager/ui_components/outline-server-progress-step.html
+++ b/src/server_manager/ui_components/outline-server-progress-step.html
@@ -60,10 +60,10 @@
- Setting up Outline.
- This could take up to two minutes. You can destroy this server at anytime.
+ [[localize('setup-do-title')]]
+ [[localize('setup-do-description')]]
- Cancel
+ [[localize('cancel')]]
@@ -82,7 +82,8 @@
properties: {
serverName: String,
showCancelButton: Boolean,
- updateIntervalId: Number
+ updateIntervalId: Number,
+ localize: Function
},
start: function() {
if (this.updateIntervalId) {
diff --git a/src/server_manager/ui_components/outline-server-settings.html b/src/server_manager/ui_components/outline-server-settings.html
index fb98cdb0..f75c83ba 100644
--- a/src/server_manager/ui_components/outline-server-settings.html
+++ b/src/server_manager/ui_components/outline-server-settings.html
@@ -120,23 +120,23 @@
-
Digital Ocean
-
-
-
+
DigitalOcean
+
+
+
-
Server Information
-
-
Set a new name for your server. Note that this will not be reflected on the devices of the users that you invited to connect to it.
-
-
-
-
-
+
[[localize('settings-server-info')]]
+
+
[[localize('settings-server-rename')]]
+
+
+
+
+
@@ -144,10 +144,10 @@
-
Share anonymized metrics to help improve the reliability and performance of Outline, for you and for those you share your server with. Learn more.
+
@@ -169,6 +169,7 @@
serverLocation: {type: String, value: null},
serverMonthlyCost: {type: String, value: null},
serverMonthlyTransferLimit: {type: String, value: null},
+ localize: {type: Function, readonly: true},
},
update: function(name, metricsEnabled) {
this.initialName = name;
diff --git a/src/server_manager/ui_components/outline-server-view.html b/src/server_manager/ui_components/outline-server-view.html
index 725cb435..15157166 100644
--- a/src/server_manager/ui_components/outline-server-view.html
+++ b/src/server_manager/ui_components/outline-server-view.html
@@ -341,10 +341,10 @@
- Destroy server
+ [[localize('server-destroy')]]
- Remove server
+ [[localize('server-remove')]]
@@ -354,21 +354,24 @@
- Connections
- Settings
+ [[localize('server-connections')]]
+ [[localize('server-settings')]]

-
Server unreachable
-
We're having issues connecting to this server. Try again or remove this server from the application.
-
We're having issues connecting to this server. Try again or destroy this server and the virtual host.
+
[[localize('server-unreachable')]]
+
+
[[localize('server-unreachable-description')]]
+
[[localize('server-unreachable-managed-description')]]
+
[[localize('server-unreachable-manual-description')]]
+
@@ -381,7 +384,7 @@
[[_getFormattedTransferredValue(totalInboundBytes, '0')]]
[[_getFormattedTransferredUnit(totalInboundBytes, 'B')]]
- Data transferred / 30 days
+ [[localize('server-data-transfer')]]
@@ -389,17 +392,17 @@
[[managedServerUtilzationPercentage]]
-
of [[_formatBytesTransferred(monthlyOutboundTransferBytes)]]
+
/[[_formatBytesTransferred(monthlyOutboundTransferBytes)]]
-
Data used / 30 days
+
[[localize('server-data-used')]]
[[accessKeyRows.length]]
-
Keys
+
[[localize('server-keys')]]
-
Server access
+
[[localize('server-access')]]
@@ -407,12 +410,12 @@
@@ -497,23 +500,24 @@
server-monthly-cost="[[monthlyCost]]"
server-monthly-transfer-limit="[[_formatBytesTransferred(monthlyOutboundTransferBytes)]]"
is-server-managed="[[isServerManaged]]"
- server-location="[[serverLocation]]">
+ server-location="[[serverLocation]]"
+ localize="[[localize]]">