Skip to content

Commit 74b7c74

Browse files
committed
add posibility to use lang code directly in options.url
1 parent f9e2543 commit 74b7c74

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

angular-translate-loader-url.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* angular-translate - v2.8.1 - 2015-10-01
3-
*
3+
*
44
* Copyright (c) 2015 The angular-translate team, Pascal Precht; Licensed MIT
55
*/
66
(function (root, factory) {
@@ -50,8 +50,13 @@ function $translateUrlLoader($q, $http) {
5050
}
5151

5252
var requestParams = {};
53+
var queryParameter = options.queryParameter || 'lang';
5354

54-
requestParams[options.queryParameter || 'lang'] = options.key;
55+
if (options.url.indexOf('{' + queryParameter + '}')) {
56+
options.url = options.url.replace('{' + queryParameter + '}', options.key);
57+
} else {
58+
requestParams[options.queryParameter || 'lang'] = options.key;
59+
}
5560

5661
return $http(angular.extend({
5762
url: options.url,

angular-translate-loader-url.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)