Every PacemElement
has a culture
property/attribute that may contextualize the webcomponent itself in a specific language.
Behind the scenes its change of value reflects onto the
lang
standard attribute.
Example:
In the example above the utility function Pacem.Utils.lang()
is used to retrieve the contextual culture.
This function checks the lang
attribute on the element first, then falls back to the documentElement lang
attribute value.
In order to keep the html (documentElement) in sync with the changes you may use the <pacem-html-proxy>
custom element.
Rewriting the above sample code, would result in:
Please notice how,
the change of the
culture
attribute/property suddenly triggers a refresh for all the element bindings!
<pacem-data>
model (i.e. a new datetime) is set.