Skip to content

Commit

Permalink
fix(bookmark-link): RCS layer language switch
Browse files Browse the repository at this point in the history
Correctly handle switching languages on layers from RCS.

Closes #8992
  • Loading branch information
alyec committed Apr 2, 2015
1 parent 677103e commit d238fb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/js/RAMP/Modules/bookmarkLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,19 @@ define([
}

var paras = link.split('?')[1],
element = $("#wb-lng").find("li a"),
url = element.attr("href");
element = $('#wb-lng').find('li a'),
url = element.attr('href'),
dstLang = element.attr('lang'),
srcLang = RAMP.locale,
re = new RegExp('rcs\\.([\\w-+=]+)\\.({0})'.format(srcLang),'g');

url = url.split('?')[0] + "?" + paras;
console.log(paras);
paras = paras.replace(re,'rcs.$1.{0}'.format(dstLang));
console.log(paras);

element.attr("href", url);
url = url.split('?')[0] + '?' + paras;

element.attr('href', url);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/RAMP/RAMP-starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RAMP = {
* @property configServiceURL
* @type String
*/
configServiceURL: "http://localhost:5000/",
configServiceURL: "http://sncr01wbingsdv1.ncr.int.ec.gc.ca:8000/v1/",

/**
* The RAMP application config, it should be treated as read only by all modules other than globalStorage and bootstrapper
Expand Down

0 comments on commit d238fb2

Please sign in to comment.