48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
namespace Kreta.Framework
|
|
{
|
|
/// <summary>
|
|
/// Helper class for compatibility with old stringresources cache
|
|
/// </summary>
|
|
public static class StringResourcesUtil
|
|
{
|
|
private static string Get(int id, int lcid)
|
|
{
|
|
return SDAServer.Instance.CacheManager.AquireCache<Caching.StringResourcesCache>().Get(id, lcid);
|
|
}
|
|
|
|
/// <summary>
|
|
/// String visszaadasa ID alapjan a magyar szoveget
|
|
/// Ha van CustomizedText akkor azt adom vissza
|
|
/// Egyebkent a defaultot
|
|
/// </summary>
|
|
public static string GetString(int id)
|
|
{
|
|
int lcid = UserContext.Instance == null ? LanguageContext.Current.LCID : UserContext.Instance.LanguageContext.LCID;
|
|
return GetString(id, lcid);
|
|
}
|
|
|
|
/// <summary>
|
|
/// String visszaadasa LCID es ID alapjan
|
|
/// Ha van CustomizedText akkor azt adom vissza
|
|
/// Egyebkent a defaultot
|
|
/// </summary>
|
|
/// <returns>a kivant sztring</returns>
|
|
public static string GetString(int id, int lcid)
|
|
{
|
|
if (lcid == 0)
|
|
{
|
|
lcid = 1038;
|
|
}
|
|
|
|
try
|
|
{
|
|
return Get(id, lcid);
|
|
}
|
|
catch (DataIntegrityException)
|
|
{
|
|
// egyébként pedig Nincs ilyen szöveget adunk vissza
|
|
return $"[{id}_NincsIlyenSzöveg]";
|
|
}
|
|
}
|
|
}
|
|
}
|