// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "CultureInfo.h"
#include "Engine/Core/Types/BaseTypes.h"
///
/// The language and culture localization manager.
///
API_CLASS(Static) class FLAXENGINE_API Localization
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Localization);
public:
///
/// Gets the current culture (date, time, currency and values formatting locale).
///
API_PROPERTY() static const CultureInfo& GetCurrentCulture();
///
/// Sets the current culture (date, time, currency and values formatting locale).
///
API_PROPERTY() static void SetCurrentCulture(const CultureInfo& value);
///
/// Gets the current language (text display locale).
///
API_PROPERTY() static const CultureInfo& GetCurrentLanguage();
///
/// Sets the current language (text display locale).
///
API_PROPERTY() static void SetCurrentLanguage(const CultureInfo& value);
///
/// Sets both the current language (text display locale) and the current culture (date, time, currency and values formatting locale) at once.
///
API_FUNCTION() static void SetCurrentLanguageCulture(const CultureInfo& value);
///
/// Occurs when current culture or language gets changed. Can be used to refresh UI to reflect language changes.
///
API_EVENT() static Delegate<> LocalizationChanged;
public:
///
/// Gets the localized string for the current language by using string id lookup.
///
/// The message identifier.
/// The optional fallback string value to use if localized string is missing.
/// The localized text.
API_FUNCTION() static String GetString(const String& id, const String& fallback = String::Empty);
///
/// Gets the localized plural string for the current language by using string id lookup.
///
/// The message identifier.
/// The value count for plural message selection.
/// The optional fallback string value to use if localized string is missing.
/// The localized text.
API_FUNCTION() static String GetPluralString(const String& id, int32 n, const String& fallback = String::Empty);
};