init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
Framework/Util
48
Framework/Util/StringResourcesUtil.cs
Normal file
48
Framework/Util/StringResourcesUtil.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
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]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue