martinandert / counterpart

A translation and localization library for Node.js and the browser.
MIT License
242 stars 25 forks source link

Added option to split key via different symbol #5

Closed ryanseddon closed 10 years ago

ryanseddon commented 10 years ago

This is my attempt to add the option to not split keys when there is a '.' in the lookup name.

The following locale file:

{
  'dont.split.on.dots': 'hello'
}

When calling translate with splitkeyChar option set to anything but a . yields:

translate('dont.split.on.dots', { splitKeyChar: '*' });  // => 'hello'
ryanseddon commented 10 years ago

@martinandert ping, thoughts?

martinandert commented 10 years ago

see #4