HEX
Server: LiteSpeed
System: Linux server111.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: lacammxy (848)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/lacammxy/public_html/wp-content/themes/Divi/epanel/theme-options-library/app/lib/i18n.js
// External dependencies.
import { get } from 'lodash';

// Internal dependencies.
import config from './config';


const i18n = (context, key, ...args) => {
  const value = get(context, key, '');

  if ('production' !== process.env.NODE_ENV && '' === value) {
    console.error('Failed to find i18n string:', key);
  }

  if (args.length > 0) {
    const sprintf = get(window, 'wp.i18n.sprintf');
    return sprintf(value, ...args);
  }

  return value;
};

export default (path, key, ...args) => i18n(config.i18n, [path, key], ...args);