Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(service): respect case in available languages
Browse files Browse the repository at this point in the history
If a language matches an available language using lowercase comparison, the available language will be returned with case intact.

Relates #1788
  • Loading branch information
Karl Berggren authored and knalli committed Oct 3, 2017
1 parent 8d7eeb0 commit 8fb6f5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ function $translate($STORAGE_KEY, $windowProvider, $translateSanitizationProvide
}

// Check for an exact match in our list of available keys
if (indexOf(avail, locale) > -1) {
return preferred;
i = indexOf(avail, locale);
if (i > -1) {
return $availableLanguageKeys[i];
}

if ($languageKeyAliases) {
Expand Down

0 comments on commit 8fb6f5d

Please sign in to comment.