private IdentityError LocalizedIdentityError(string code, params object[] args)
        {
            var msg = GenericResourceReader.GetValue <T>(string.Empty, code, args);

            return(args == null
                ? new IdentityError {
                Code = code, Description = msg
            }
                : new IdentityError {
                Code = code, Description = string.Format(msg, args)
            });
        }
        private static string GetLoclizedModelBindingError <T>(string code, params object[] args) where T : class
        {
            var msg = GenericResourceReader.GetValue <T>(string.Empty, code, args);

            return(string.Format(msg, args));
        }
예제 #3
0
 public LocalizedHtmlString Text(Type resourceSource, string key, params object[] args)
 {
     return(GenericResourceReader.GetValue(resourceSource, CultureInfo.CurrentCulture.Name, key, args));
 }
예제 #4
0
 /// <summary>
 /// Localize a string according to a specific culture and specified resource type
 /// <para>Use in UI side, for backend text localization use GetLocalizedString instead</para>
 /// </summary>
 /// <param name="resourceSource"></param>
 /// <param name="culture"></param>
 /// <param name="key"></param>
 /// <param name="args"></param>
 /// <returns>LocalizedHtmlString</returns>
 public LocalizedHtmlString GetLocalizedHtmlString(Type resourceSource, string culture, string key, params object[] args)
 {
     return(GenericResourceReader.GetValue(resourceSource, culture, key, args));
 }