Merge pull request #1300 from cmgustavo/feature/multilanguage-support
Feature/multilanguage support
This commit is contained in:
commit
a0eded69af
36 changed files with 1011 additions and 222 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
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ angular.module('copayApp.controllers').controller('VersionController',
|
|||
$scope.version = copay.version;
|
||||
$scope.commitHash = copay.commitHash;
|
||||
$scope.networkName = config.networkName;
|
||||
$scope.defaultLanguage = config.defaultLanguage;
|
||||
|
||||
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) {
|
||||
var toInt = function(s) {
|
||||
|
|
|
|||
|
|
@ -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