Skip to content

Instantly share code, notes, and snippets.

@zoobestik
Created December 30, 2013 17:14
Show Gist options
  • Save zoobestik/8184946 to your computer and use it in GitHub Desktop.
Save zoobestik/8184946 to your computer and use it in GitHub Desktop.
bug extend
var def = {
l10n:
{ langdetectDataPath: '/usr/share/yandex/lang_detect_data.txt',
'default': 'ru',
langParamName: 'lang',
localeParamName: 'locale',
currencyParamName: 'currency',
rewriteRegionIfNotInLocaleCountry: false,
decl:
{ ru:
{ defaultRegionId: 213,
defaultCountryId: 225,
langs: [ 'ru', 'uk', 'en' ],
currencies: [ 'RUR', 'USD', 'EUR', 'UAH', 'BYR', 'KZT' ] } } }
},
client = {
l10n:
{ rewriteRegionIfNotInLocaleCountry: true,
'default': 'ru',
decl:
{ ru:
{ id: 'ru',
defaultRegionId: 213,
defaultCountryId: 227,
langs: [ 'ru' ],
currencies: [ 'RUR', 'USD', 'EUR' ] } } } };
var util = require('nodules-libs').util;
console.log('default', def.l10n.decl.ru);
console.log('clinet', client.l10n.decl.ru);
console.log('result', util.extend(true, {}, def, client).l10n.decl.ru);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment