public int SetValue(string screen, string key, string languageCode, string value)
    {
      Language language = new Language();
      language.Request.Code = languageCode;
      language.Get();

      return TranslationUtils.Set(screen, key, language.Response.Languages.FirstOrDefault(), value);
    }
    public HtmlString GetValues()
    {
      Language language = new Language();
      language.Get();

      Translation translation = new Translation();
      translation.Request.PageSize = 0;
      translation.Get();

      var result = translation.Response.Translations.Where(tran => tran.Application == TranslationUtils.ApplicationName).Select(tran=> new { Screen= tran.Screen, Key = tran.Key }).Distinct().Select(tran => new { Screen = tran.Screen, Key = tran.Key, Languages = language.Response.Languages.Select(lang => new { Code = lang.Code, Translation = TranslationUtils.Get(tran.Screen, tran.Key, lang, string.Empty) }) });

      return result.ToHtmlJson();
    }
Ejemplo n.º 3
0
    public static string Get(string screen, string key, int languageId, string defaultValue, params string[] parameters)
    {
      Language language = new Language();
      language.Request.Ids.Add(languageId);
      language.Get();

      Bm2s.Poco.Common.Parameter.Language lang = language.Response.Languages.FirstOrDefault();

      if (lang == null)
      {
        lang = UserUtils.CurrentUser.DefaultLanguage;
      }

      return TranslationUtils.Get(screen, key, lang, defaultValue, parameters);
    }
 public HtmlString GetLanguagesValues()
 {
   Language language = new Language();
   language.Get();
   return language.Response.Languages.ToHtmlJson();
 }