Created
December 1, 2014 12:02
-
-
Save gsans/03ac638c5d69be51c4ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.config(function($httpProvider, $translateProvider) { | |
… //seen before | |
}) | |
// Service definition | |
.factory(‘Language’, function ($translate) { | |
//add the languages you support here. ar stands for arabic | |
var rtlLanguages = [‘ar’]; | |
var isRtl = function() { | |
var languageKey = $translate.proposedLanguage() || $translate.use(); | |
for (var i=0; i<rtlLanguages.length; i+=1) { | |
if (languageKey.indexOf(rtlLanguages[i])>-1) | |
return true; | |
} | |
return false; | |
}; | |
//public api | |
return { | |
isRtl: isRtl | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment