Log in
Model

LocaleEmulator

Magento\ImportExport\Model\LocaleEmulator

What it does

This class temporarily switches Magento's locale/language context while executing a callback function, then restores the original locale afterwards.

Developers use this during import/export operations when they need to process data in a specific language (e.g., translating product names) without affecting the rest of the application's locale settings.

Public Methods

  • emulate()