Chromium Code Reviews| Index: ui/webui/resources/cr_elements/network/cr_onc_types.js |
| diff --git a/ui/webui/resources/cr_elements/network/cr_onc_types.js b/ui/webui/resources/cr_elements/network/cr_onc_types.js |
| index 7abb4310712f6a76ede592b87eb412f17263a0ac..08ad9e0c017820ec00229f1553dd93b364821d2e 100644 |
| --- a/ui/webui/resources/cr_elements/network/cr_onc_types.js |
| +++ b/ui/webui/resources/cr_elements/network/cr_onc_types.js |
| @@ -314,22 +314,23 @@ CrOnc.getAutoConnect = function(properties) { |
| /** |
| * @param {!CrOnc.NetworkProperties|!CrOnc.NetworkStateProperties|undefined} |
| * properties The ONC network properties or state properties. |
| + * @param {!Object} caller The caller, passed as 'this' to i18. |
|
michaelpg
2016/09/06 21:22:08
i18n
michaelpg
2016/09/06 21:22:09
nit: this is normally called "context", as it's th
stevenjb
2016/09/12 23:12:27
Done.
stevenjb
2016/09/12 23:12:27
Done.
|
| * @param {!Object<function(string, ...string):string>} i18n |
| * @return {string} The name to display for |network|. |
| */ |
| -CrOnc.getNetworkName = function(properties, i18n) { |
| +CrOnc.getNetworkName = function(properties, caller, i18n) { |
| if (!properties) |
| return ''; |
| let name = CrOnc.getStateOrActiveString(properties.Name); |
| let type = CrOnc.getStateOrActiveString(properties.Type); |
| if (!name) |
| - return i18n.call('OncType' + type); |
| + return i18n.call(caller, 'OncType' + type); |
|
michaelpg
2016/09/06 21:22:08
actually, this function would be simpler if you si
stevenjb
2016/09/12 23:12:27
OK, after a bit of wrangling I was able to define
|
| if (type == 'VPN' && properties.VPN) { |
| let vpnType = CrOnc.getStateOrActiveString(properties.VPN.Type); |
| if (vpnType == 'ThirdPartyVPN' && properties.VPN.ThirdPartyVPN) { |
| let providerName = properties.VPN.ThirdPartyVPN.ProviderName; |
| if (providerName) |
| - return i18n.call('vpnNameTemplate', providerName, name); |
| + return i18n.call(caller, 'vpnNameTemplate', providerName, name); |
| } |
| } |
| return name; |