From f6ef43d3b002249280c96eb34c14adef5ed91ea2 Mon Sep 17 00:00:00 2001 From: Roman Anasal Date: Fri, 26 Sep 2014 10:39:09 +0200 Subject: [PATCH 1/2] Fix #485: sort localized country names alphabetically --- app/js/controllers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/js/controllers.js b/app/js/controllers.js index 5c8636a1..46802d3e 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -2519,6 +2519,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) } } } + $scope.countries.sort(function(a, b) { + return a.name.localeCompare(b.name); + }); }); }) From a257ded3cc0984e9b2bbf19c8bacc752bf22cfac Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 28 Sep 2014 22:15:56 +0400 Subject: [PATCH 2/2] Merged countries sort --- app/js/controllers.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 46802d3e..4c616dfc 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -2519,10 +2519,11 @@ angular.module('myApp.controllers', ['myApp.i18n']) } } } - $scope.countries.sort(function(a, b) { - return a.name.localeCompare(b.name); - }); - + if (String.prototype.localeCompare) { + $scope.countries.sort(function(a, b) { + return a.name.localeCompare(b.name); + }); + } }); })