Loyc.Localize.Localized C# (CSharp) Метод

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
		public static string Localized([Localizable] this string message, params object[] args)
			{ return Symbol((Symbol)null, message, args); }

Same methods

Localize::Localized ( [ message, object arg1 ) : string
Localize::Localized ( [ message, object arg1, object arg2 ) : string

Usage Example

Пример #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);
            }
        }
All Usage Examples Of Loyc.Localize::Localized