System.Globalization.I18NComplete.GetText C# (CSharp) Méthode

GetText() static private méthode

Gets a translated version of the supplied text message.
static private GetText ( string msgID, string languageCode = null, int lcid = null, bool plural = false ) : string
msgID string Text to be translated
languageCode string Language to translate into
lcid int Specify the Culture LCID for faster access if you know it
plural bool Specify whether you want the plural form of it or not
Résultat string
        internal static string GetText(string msgID, string languageCode = null,
            int? lcid = null, bool plural = false)
        {
            var msg = GetMessage(msgID, languageCode, lcid);
            //return msg == null ? null : msg.GetText(plural);
            var result = msg == null ? null : msg.GetText(plural);
            if (GettingText != null)
            {
                result = GettingText(msg, msgID, result, languageCode, lcid, plural);
            }
            return result;
        }

Usage Example

        /// <summary>
        ///     <para>@Alias <c>GetRaw</c> and <c>FormatRaw</c></para>
        ///     <para>Translates the given html applying string.Format(html, htmlArguments) to the current culture language. </para>
        ///     <para>Warning! Neither the html nor the htmlArguments will be encoded whatsoever</para>
        /// </summary>
        /// <param name="culture">The culture being extended</param>
        /// <param name="html">The html to be translated</param>
        /// <param name="htmlArguments">The html arguments to be applied. Warning! The arguments will not be htmlEncoded!</param>
        /// <returns>The translated formatted html as MvcHtmlString</returns>
        /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:46:39 GMT"/>
        public static MvcHtmlString ___(this CultureInfo culture, string html, params object[] htmlArguments)
        {
            var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments));

            return
                (#if DEBUG
                 I18NComplete.OnGetting___(result, culture, html, htmlArguments) ??
#endif
                 result);
        }
All Usage Examples Of System.Globalization.I18NComplete::GetText