LocaleUtils#

class LocaleUtils#

Provides utilities for dealing with locales.

Overview#

perform_safe_locale_action

Switches to the correct locale, performs the specified action, and then switches

Import detail#

from ansys.tools.variableinterop.utils.locale_utils import LocaleUtils

Method detail#

static LocaleUtils.perform_safe_locale_action(locale_name: str, action: Callable) Any#

Switches to the correct locale, performs the specified action, and then switches back safely.

Parameters:
locale_name: str

Name of the locale to perform the action in.

actionCallable

Action to perform.

Returns:
Any

Object returned by the action.