diff --git a/app-localize-behavior.html b/app-localize-behavior.html
index a990747..7448cd5 100644
--- a/app-localize-behavior.html
+++ b/app-localize-behavior.html
@@ -110,12 +110,30 @@
* @event app-resources-error
*/
+ /**
+ * This event is fired when each instance of app-localize-behavior
+ * is created. It is useful for collecting the instances so that
+ * later a method can be called on each of them. For an example,
+ * see demo/app-localize-behavior-mgr.html.
+ *
+ * @event app-localize-behavior-ready
+ */
+
+ /**
+ * This event is fired every time the language is changed.
+ * For an example of how this might be used,
+ * see demo/app-localize-behavior-mgr.html.
+ *
+ * @event app-language-changed
+ */
+
properties: {
/**
* The language used for translation.
*/
language: {
- type: String
+ type: String,
+ observer: '__languageChanged'
},
/**
@@ -194,6 +212,10 @@
}
},
+ ready() {
+ this.fire('app-localize-behavior-ready', this);
+ },
+
/**
* Returns a computed `localize` method, based on the current `language`.
*/
@@ -227,6 +249,10 @@
};
},
+ __languageChanged: function() {
+ this.fire('app-language-changed', this.language);
+ },
+
__onRequestResponse: function(event) {
this.resources = event.response;
this.fire('app-resources-loaded');
diff --git a/demo/app-localize-behavior-mgr.html b/demo/app-localize-behavior-mgr.html
new file mode 100644
index 0000000..18ef456
--- /dev/null
+++ b/demo/app-localize-behavior-mgr.html
@@ -0,0 +1,44 @@
+
+
+