Localized() публичный статический Метод

Finds and formats a localization of the given message. If none is found, the original string is formatted.
public static Localized ( [ message ) : string
message [ The message to translate, which may include argument /// placeholders (e.g. "{0}"). The default formatter also accepts named /// parameters like "{firstName}"; see for /// details.
Результат string
Пример #1
0
        /// <summary>Converts a quadruplet (type, context, format, args) to a single
        /// string containing all that information. The format string and the Severity
        /// are localized with <see cref="Localize.Localized(string, object[])"/>.</summary>
        /// <remarks>For example, <c>FormatMessage(Severity.Error, "context", "Something happened!")</c>
        /// comes out as "Error: context: Something happened!".</remarks>
        public static string FormatMessage(Severity type, object context, string format, params object[] args)
        {
            string loc       = ContextToString(context);
            string formatted = Localize.Localized(format, args);

            if (string.IsNullOrEmpty(loc))
            {
                return(type.ToString().Localized() + ": " + formatted);
            }
            else
            {
                return(loc + ": " +
                       type.ToString().Localized() + ": " + formatted);
            }
        }
Пример #2
0
 public void Write(Severity type, object context, string format, params object[] args)
 {
     WriteCore(type, context, Localize.Localized(format, args));
 }
Пример #3
0
 public void Write(Severity type, object context, string format, object arg0, object arg1 = null)
 {
     WriteCore(type, context, Localize.Localized(format, arg0, arg1));
 }
Пример #4
0
 public void Write(Severity type, object context, string format)
 {
     WriteCore(type, context, Localize.Localized(format));
 }