Multi-language support. English by default
This commit is contained in:
parent
08024c1c77
commit
302e75228d
8 changed files with 53 additions and 5 deletions
|
|
@ -24,6 +24,7 @@ var copayApp = window.copayApp = angular.module('copayApp', [
|
|||
'mm.foundation',
|
||||
'monospaced.qrcode',
|
||||
'ngIdle',
|
||||
'gettext',
|
||||
'copayApp.filters',
|
||||
'copayApp.services',
|
||||
'copayApp.controllers',
|
||||
|
|
|
|||
|
|
@ -9,6 +9,22 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
$scope.insightPort = config.blockchain.port;
|
||||
$scope.insightSecure = config.blockchain.schema === 'https';
|
||||
$scope.forceNetwork = config.forceNetwork;
|
||||
$scope.defaultLanguage = config.defaultLanguage || 'en';
|
||||
|
||||
$scope.availableLanguages = [{
|
||||
name: 'English',
|
||||
isoCode: 'en',
|
||||
}, {
|
||||
name: 'Spanish',
|
||||
isoCode: 'es',
|
||||
}];
|
||||
|
||||
for (var ii in $scope.availableLanguages) {
|
||||
if ($scope.defaultLanguage === $scope.availableLanguages[ii].isoCode) {
|
||||
$scope.selectedLanguage = $scope.availableLanguages[ii];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.unitOpts = [{
|
||||
name: 'Satoshis (100,000,000 satoshis = 1BTC)',
|
||||
|
|
@ -90,7 +106,8 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
alternativeName: $scope.selectedAlternative.name,
|
||||
alternativeIsoCode: $scope.selectedAlternative.isoCode,
|
||||
|
||||
version: copay.version
|
||||
version: copay.version,
|
||||
defaultLanguage: $scope.selectedLanguage.isoCode
|
||||
}));
|
||||
|
||||
// Go home reloading the application
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ angular
|
|||
$idleProvider.warningDuration(20); // in seconds
|
||||
$keepaliveProvider.interval(2); // in seconds
|
||||
})
|
||||
.run(function($rootScope, $location, $idle) {
|
||||
.run(function($rootScope, $location, $idle, gettextCatalog) {
|
||||
gettextCatalog.currentLanguage = config.defaultLanguage;
|
||||
$idle.watch();
|
||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||
if (!localStorage || localStorage.length < 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue