jeresig / i18n-node-2

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
507 stars 79 forks source link

JSON Object notation #44

Closed murdockcrc closed 9 years ago

murdockcrc commented 9 years ago

How to access text when the locale JSON file has nested text: For example: { "main-page": { "title": "This is the main title" } }

Trying to access this via I18n.__("main-page.title") returns the string "main-page.title" instead of the intended "This is the main title".

Would you mind to clarify how to access nested JSON elements within the locale file?

stevenvergenz commented 9 years ago

I'm working on a pull request for this now. Object notation certainly seems to be a fairly standard extra.