System.Globalization.I18NComplete.OnGetting_ C# (CSharp) Метод

OnGetting_() статический приватный Метод

Throws the Getting_ global event

@Alias _ and GetString

Translates the given text applying string.Format(text, arguments) to the current culture language.

The text and argument values will be HTML Encoded when used in ASP.NET MVC

static private OnGetting_ ( string defaultResult, CultureInfo culture, string text, object arguments ) : string
defaultResult string The I18NComplete default result. Returning null will fallback on this result, otherwise return a custom value to oveerride this.
culture CultureInfo The culture this translation is being translated
text string The text to be translated
arguments object Custom arguments list to be passed to string.Format
Результат string
        internal static string OnGetting_(string defaultResult, CultureInfo culture, string text, object[] arguments)
        {
            if (Getting_ != null)
                return Getting_(defaultResult, culture, text, arguments);
            return null;
        }

Usage Example

Пример #1
0
        /// <summary>
        ///     <para>@Alias <c>GetString</c> and <c>Format</c></para>
        ///     <para>Translates the given text applying string.Format(text, arguments) to the current culture language. </para>
        ///     <para>The text and argument values will be HTML Encoded when used in ASP.NET MVC</para>
        /// </summary>
        /// <param name="culture">The culture being extended</param>
        /// <param name="text">The text to be translated</param>
        /// <param name="arguments">Custom arguments list to be passed to string.Format</param>
        /// <returns>The translated formatted text as string</returns>
        /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:47:10 GMT"/>
        public static string _(this CultureInfo culture, string text, params object[] arguments)
        {
            var result = string.Format(I18NComplete.GetText(text, lcid: culture.LCID), arguments);

            return
                (#if DEBUG
                 I18NComplete.OnGetting_(result, culture, text, arguments) ??
#endif
                 result);
        }