martinandert / counterpart

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

translation file key has dots but is not a nested object #4

Closed ryanseddon closed 10 years ago

ryanseddon commented 10 years ago

I have a translation service that returns a flat object that is 1 level deep and all keys are namespaced using a dot as seperator for various reasons. Is there an option to tell counterpart to not split via dots?

{
  'namespace.subject' : 'A subject'
}

Would you be open to a PR adding this if it's not already possible?

martinandert commented 10 years ago

You are right, that's not already possible.

But I am always open to pull requests.

martinandert commented 10 years ago

Thanks for your pull request. After merging it I committed some "improvements":

A new minor version was released to npm.

I hope this works for you. Tell me if you still have issues with it.

ryanseddon commented 10 years ago

splitKeyChar was a terrible name so happy for the changes. get/setSeparator is a really good idea and is perfect for our needs. Thanks for merging :+1: