SemanticKernelResources Class

  • java.lang.Object
    • com.microsoft.semantickernel.localization.SemanticKernelResources

public class SemanticKernelResources

Provides access to the resources used by the Semantic Kernel.

Constructor Summary

Constructor Description
SemanticKernelResources()

Method Summary

Modifier and Type Method and Description
static java.lang.String getString(String id)

Get the string for the specified id from the resource bundle.

static java.lang.String localize(String id, String defaultValue)

Get the string for the specified id from the resource bundle.

static java.util.Locale setLocale(Locale locale)

Set the locale for the Semantic Kernel.

static java.util.ResourceBundle setResourceBundle(Locale locale)

Load the localized resource bundle for the Semantic Kernel.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SemanticKernelResources

public SemanticKernelResources()

Method Details

getString

public static String getString(String id)

Get the string for the specified id from the resource bundle.

Parameters:

id - The id of the string.

Returns:

the localized string, or the id if the string is not found.

localize

public static String localize(String id, String defaultValue)

Get the string for the specified id from the resource bundle.

Parameters:

id - The id of the string.
defaultValue - The default value to return if the string is not found.

Returns:

the localized string, or the default value if the string is not found.

setLocale

public static Locale setLocale(Locale locale)

Set the locale for the Semantic Kernel. As a side effect, the localized resource bundle will be loaded.

Parameters:

locale - The locale to use.

Returns:

the locale.

setResourceBundle

public static ResourceBundle setResourceBundle(Locale locale)

Load the localized resource bundle for the Semantic Kernel. If there is no resource bundle for the specified locale, the default resource bundle will be loaded.

Parameters:

locale - The locale to use.

Returns:

the resource bundle.

Applies to