elmasse/elmasse-bundle

Reference Other properties

littlefyr opened this issue · 5 comments

One feature that would be exceptionally useful is internal property references.

Lets say I have the properties for OK and Cancel buttons. So I'm going to put them in app.common.button.ok.label and app.common.button.cancel.label.

So for all my alerts and what not, I'm going to use those two for the buttons. Great. Except that when I don the "Send Message" window, what I want is "Send" and "Cancel" So now, do I use app.sendmessage.button.send.label?

So far its not to onerous. Simply create new properties for the exceptions.

Invariably, you run into some situation where for most of the languages you can use the "common" value but in this one, there is a better choice that can be used. So you end up with several languages where the value is the same as elsewhere and one where it is different.

It would be nice if we could refer to other properties in some property. So in my exmaple, I'd have:

app.sendmessage.button.send.label:Send
app.sendmessage.button.cancel.label:@app.common.button.cancel.label

I would take the same approach as Android, and make it all or nothing. If the entire value (trimmed of leading and following white space) is the name of a property, replace that string with the value of the property.

This looks very interesting. It seems to me that is something not that hard to implement: just once the store is loaded we can run a process to replace values starting with @ symbol. But I'll do this by setting a property on the Bundle instance like 'enablelinkedValues: true' so we avoid breaking any existent impl.

I'll take a look on this and I'll get back to you as soon as I have a working example!

Thanks for the feedback!

Oh, BTW, What Ext version are you using? I have to merge the ext5 branch into master yet.

We're on 4.2.x

Please try this commit: 1f1f029 it should solve this. See the demo and properties files. I have linked the key panel.linked with panel.html and it seems to be working just fine. In case you don't find any issue I will tag this as a new release and will start working on merging branch ext5.

Fixed in release 0.3.4