How to use the @bentley/presentation-frontend.Presentation.i18n function in @bentley/presentation-frontend

To help you get started, we’ve selected a few @bentley/presentation-frontend examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imodeljs / imodeljs / presentation / components / src / common / Utils.ts View on Github external
export const translate = async (stringId: string): Promise => {
  const localizationNamespaceName = "PresentationComponents";
  if (!localizationNamespace) {
    localizationNamespace = Presentation.i18n.registerNamespace(localizationNamespaceName);
  }
  await localizationNamespace.readFinished;
  stringId = `${localizationNamespaceName}:${stringId}`;
  return Presentation.i18n.translate(stringId);
};