2014-07-16 20:35:03 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Configuration;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using System.Web.Mvc.Ajax;
|
|
|
|
|
using System.Net.Mail;
|
|
|
|
|
using Yavsc;
|
|
|
|
|
using System.Globalization;
|
2015-01-02 04:52:48 +01:00
|
|
|
using Yavsc.Model;
|
2014-07-16 20:35:03 +02:00
|
|
|
|
2015-01-02 04:52:48 +01:00
|
|
|
namespace Yavsc.Helpers
|
2014-07-16 20:35:03 +02:00
|
|
|
{
|
2015-01-27 00:41:20 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// T.
|
|
|
|
|
/// </summary>
|
2015-06-18 11:02:23 +02:00
|
|
|
public static class T
|
2014-07-16 20:35:03 +02:00
|
|
|
{
|
2015-06-18 11:02:23 +02:00
|
|
|
|
2015-01-27 00:41:20 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the string.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>The string.</returns>
|
|
|
|
|
/// <param name="msg">Message.</param>
|
2015-01-02 04:52:48 +01:00
|
|
|
public static string GetString(string msg)
|
2014-07-16 20:35:03 +02:00
|
|
|
{
|
2015-01-02 04:52:48 +01:00
|
|
|
string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_"));
|
|
|
|
|
return tr==null?msg:tr;
|
2014-07-16 20:35:03 +02:00
|
|
|
}
|
2015-06-26 13:56:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Translate the specified helper and text.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="helper">Helper.</param>
|
|
|
|
|
/// <param name="text">Text.</param>
|
2015-11-01 01:47:42 +01:00
|
|
|
public static IHtmlString Translate(this HtmlHelper helper, string text)
|
2015-06-18 11:02:23 +02:00
|
|
|
{
|
|
|
|
|
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
|
2015-11-01 01:47:42 +01:00
|
|
|
return new MvcHtmlString(helper.Encode(GetString(text)));
|
2015-06-18 11:02:23 +02:00
|
|
|
}
|
|
|
|
|
|
2014-07-16 20:35:03 +02:00
|
|
|
}
|
|
|
|
|
}
|