Class SemanticKernelResources
- java.lang.Object
-
- com.microsoft.semantickernel.localization.SemanticKernelResources
-
public class SemanticKernelResources extends Object
Provides access to the resources used by the Semantic Kernel.
-
-
Constructor Summary
Constructors Constructor Description SemanticKernelResources()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetString(String id)Get the string for the specified id from the resource bundle.static Stringlocalize(String id, String defaultValue)Get the string for the specified id from the resource bundle.static LocalesetLocale(Locale locale)Set the locale for the Semantic Kernel.static ResourceBundlesetResourceBundle(Locale locale)Load the localized resource bundle for the Semantic Kernel.
-
-
-
Method Detail
-
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.
-
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.
-
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.
-
-