loading... Pacem JS

Local culture

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.


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.

Global culture

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!