Beyond defining labels as a resource on a page, is there a way to trigger labels that are needed to be loaded by Skuid? For example, some “global always load a defined set of labels” approach akin to the JS & CSS static resource concept?
Here’s the use case - We’ve built a framework that sits on top of skuid and our runtime requires the use of localizable strings (e.g. messages - we have lots of these). Since our runtime is included on all of our skuid pages (we have over 100 and counting), as I understand it, the only way to ensure that the label is made available on the skuid page itself would be to define the label on each page. In our case, that would mean repeating the same label definition on each and every one of our skuid pages. If there was a way to have a global “include” concept, this would allow our runtime labels to be included everywhere and then only page specific labels would need to be included in the builder on the specific page.
Possible solutions assuming something like this isn’t available out of the box:
- Write a custom component that would be the first component on every page. Would need to do this instead of document.ready to ensure the labels are always available before any UI elements are rendered. This component would make a sfdc api call (metadata api I’m guessing) to obtain all the labels required and then “add” them to skuid.label object. The downside here is that this component needs to live on every page where it would otherwise not be required.
- On the VF page that contains the skuid page, build up json server side then parse client side and “add” to skuid.label using the custom component approach. This would perform better but the downside is that that every VF page would require it (could be wrapped in a custom VF component so code only lives in one place).
- Controller extension that would expose remote method that could be called by a custom component. It would return JSON and client code would then “add” to skuid.label.
Insights, thoughts are appreciated!