Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

nested properties support #9

Merged
merged 2 commits into from
Oct 30, 2015
Merged

nested properties support #9

merged 2 commits into from
Oct 30, 2015

Conversation

a-wart
Copy link

@a-wart a-wart commented Aug 6, 2015

{"city_route":
      { "airline": "Fluglinie"}
}
console.log(__('city_route.airline')); // Fluglinie

@brandonbloom
Copy link

This assumes that keys are intended to be valid identifiers, but the existing usage supports arbitrary string keys.

@antonmedv
Copy link

That's ok. You can use it as you want.

@antonmedv
Copy link

ping @sokra

* @returns {*}
*/
function byString(object, stringKey) {
stringKey = stringKey.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either don't allow this at all or implement it correctly.

abc[def] is not the correct syntax. abc["def"] is the correct syntax. Also make sure that abc["def['ghi']"] works ;).

@sokra
Copy link
Member

sokra commented Aug 20, 2015

This would be a breaking change. It's propably better to make this opt-in.

Try the change the signature of the plugin to Plugin(localization, options) (plus backward-compatiblility) and add an nested property.

@vinkla
Copy link

vinkla commented Sep 2, 2015

👍 on adding support for nested values.

@ronkorving
Copy link

👍 from me too. I really wanna use this plugin, but it seems rather... dead and missing some key features. Should I roll my own, or is this coming back to life any time soon? :)

@antonmedv
Copy link

antonmedv commented Oct 19, 2015 via email

@a-wart
Copy link
Author

a-wart commented Oct 20, 2015

coming soon guys, just couple of days:)

@ronkorving
Copy link

I feel like a kid in a candy store 😊

@a-wart
Copy link
Author

a-wart commented Oct 26, 2015

@sokra I updated PR, check it please

object = object[key];
} else {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much spacing

@a-wart
Copy link
Author

a-wart commented Oct 26, 2015

@sokra , updated

@scythargon
Copy link

@sokra

sokra added a commit that referenced this pull request Oct 30, 2015
nested properties support
@sokra sokra merged commit b731c03 into webpack-contrib:master Oct 30, 2015
@sokra
Copy link
Member

sokra commented Oct 30, 2015

Thanks

@ronkorving
Copy link

@sokra and thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants