Fix: i18n sync status
This commit is contained in:
parent
cd1f78e19e
commit
008ca33b16
|
@ -1027,6 +1027,43 @@
|
||||||
"optionsSyncLogin": {
|
"optionsSyncLogin": {
|
||||||
"message": "Login"
|
"message": "Login"
|
||||||
},
|
},
|
||||||
|
"optionsSyncStatusPull": {
|
||||||
|
"message": "Pulling style $loaded$ of $total$",
|
||||||
|
"placeholders": {
|
||||||
|
"loaded": {
|
||||||
|
"content": "$1"
|
||||||
|
},
|
||||||
|
"total": {
|
||||||
|
"content": "$2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"optionsSyncStatusPush": {
|
||||||
|
"message": "Pushing style $loaded$ of $total$",
|
||||||
|
"placeholders": {
|
||||||
|
"loaded": {
|
||||||
|
"content": "$1"
|
||||||
|
},
|
||||||
|
"total": {
|
||||||
|
"content": "$2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"optionsSyncStatusSyncing": {
|
||||||
|
"message": "Syncing..."
|
||||||
|
},
|
||||||
|
"optionsSyncStatusConnecting": {
|
||||||
|
"message": "Connecting..."
|
||||||
|
},
|
||||||
|
"optionsSyncStatusConnected": {
|
||||||
|
"message": "Connected"
|
||||||
|
},
|
||||||
|
"optionsSyncStatusDisconnecting": {
|
||||||
|
"message": "Disconnecting..."
|
||||||
|
},
|
||||||
|
"optionsSyncStatusDisconnected": {
|
||||||
|
"message": "Disconnected"
|
||||||
|
},
|
||||||
"paginationCurrent": {
|
"paginationCurrent": {
|
||||||
"message": "Current page",
|
"message": "Current page",
|
||||||
"description": "Tooltip for the current page index in search results"
|
"description": "Tooltip for the current page index in search results"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* exported getActiveTab onTabReady stringAsRegExp getTabRealURL openURL
|
/* exported getActiveTab onTabReady stringAsRegExp getTabRealURL openURL
|
||||||
getStyleWithNoCode tryRegExp sessionStorageHash download
|
getStyleWithNoCode tryRegExp sessionStorageHash download
|
||||||
closeCurrentTab */
|
closeCurrentTab capitalize */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const CHROME = Boolean(chrome.app) && parseInt(navigator.userAgent.match(/Chrom\w+\/(?:\d+\.){2}(\d+)|$/)[1]);
|
const CHROME = Boolean(chrome.app) && parseInt(navigator.userAgent.match(/Chrom\w+\/(?:\d+\.){2}(\d+)|$/)[1]);
|
||||||
|
@ -481,3 +481,7 @@ function closeCurrentTab() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function capitalize(s) {
|
||||||
|
return s[0].toUpperCase() + s.slice(1);
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* global messageBox msg setupLivePrefs enforceInputRange
|
/* global messageBox msg setupLivePrefs enforceInputRange
|
||||||
$ $$ $create $createLink
|
$ $$ $create $createLink
|
||||||
FIREFOX OPERA CHROME URLS openURL prefs t API ignoreChromeError */
|
FIREFOX OPERA CHROME URLS openURL prefs t API ignoreChromeError capitalize */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
setupLivePrefs();
|
setupLivePrefs();
|
||||||
|
@ -121,17 +121,15 @@ document.onclick = e => {
|
||||||
if (status.syncing) {
|
if (status.syncing) {
|
||||||
if (status.progress) {
|
if (status.progress) {
|
||||||
const {phase, loaded, total} = status.progress;
|
const {phase, loaded, total} = status.progress;
|
||||||
return `${phase}ing style ${loaded + 1} of ${total}`;
|
return chrome.i18n.getMessage(`optionsSyncStatus${capitalize(phase)}`, [loaded + 1, total]) ||
|
||||||
|
`${phase} ${loaded} / ${total}`;
|
||||||
}
|
}
|
||||||
return 'syncing...';
|
return chrome.i18n.getMessage('optionsSyncStatusSyncing') || 'syncing';
|
||||||
}
|
}
|
||||||
if (status.state.endsWith('ing')) {
|
if ((status.state === 'connected' || status.state === 'disconnected') && status.errorMessage) {
|
||||||
return status.state + '...';
|
|
||||||
}
|
|
||||||
if (status.errorMessage) {
|
|
||||||
return status.errorMessage;
|
return status.errorMessage;
|
||||||
}
|
}
|
||||||
return status.state;
|
return chrome.i18n.getMessage(`optionsSyncStatus${capitalize(status.state)}`) || status.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
connectButton.addEventListener('click', e => {
|
connectButton.addEventListener('click', e => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user