|
2 | 2 | using System.Threading;
|
3 | 3 | using System.Text.RegularExpressions;
|
4 | 4 | using i18n.Domain.Helpers;
|
| 5 | +using i18n.Helpers; |
5 | 6 | using i18n.Domain.Abstract;
|
6 | 7 | using i18n.Domain.Concrete;
|
7 | 8 |
|
@@ -179,6 +180,39 @@ public string DefaultLanguage
|
179 | 180 | /// </remarks>
|
180 | 181 | public SetLanguageHandler SetPrincipalAppLanguageForRequestHandlers { get; set; }
|
181 | 182 |
|
| 183 | + /// <summary> |
| 184 | + /// Declares a method type for a custom method called after a nugget has been translated |
| 185 | + /// that allows the resulting message to be modified. |
| 186 | + /// </summary> |
| 187 | + /// <remarks> |
| 188 | + /// In general it is good practice to postpone the escaping of characters until they |
| 189 | + /// are about to be displayed and then according to the content type of the output. |
| 190 | + /// Thus, a single quote character need not be escaped if in JSON, but should be escaped |
| 191 | + /// if in HTML or Javascript. |
| 192 | + /// This method allows for such conditional modification of the message. |
| 193 | + /// </remarks> |
| 194 | + /// <param name="context">Current http context.</param> |
| 195 | + /// <param name="nugget">The subject nugget being translated.</param> |
| 196 | + /// <param name="langtag">Language being set.</param> |
| 197 | + /// <param name="message">The message string which may be modified.</param> |
| 198 | + /// <returns> |
| 199 | + /// Modified message string (or message if no modification). |
| 200 | + /// </returns> |
| 201 | + public delegate string TweakMessageTranslationProc(System.Web.HttpContextBase context, Nugget nugget, LanguageTag langtag, string message); |
| 202 | + |
| 203 | + /// <summary> |
| 204 | + /// Registers a custom method called after a nugget has been translated |
| 205 | + /// that allows the resulting message to be modified. |
| 206 | + /// </summary> |
| 207 | + /// <remarks> |
| 208 | + /// In general it is good practice to postpone the escaping of characters until they |
| 209 | + /// are about to be displayed and then according to the content type of the output. |
| 210 | + /// This, a single quote character need not be escaped if in JSON, but should be escaped |
| 211 | + /// if in HTML or Javascript. |
| 212 | + /// This method allows for such conditional modification of the message. |
| 213 | + /// </remarks> |
| 214 | + public TweakMessageTranslationProc TweakMessageTranslation { get; set; } |
| 215 | + |
182 | 216 | /// <summary>
|
183 | 217 | /// Specifies the type of HTTP redirect to be issued by automatic language routing:
|
184 | 218 | /// true for 301 (permanent) redirects; false for 302 (temporary) ones.
|
|
0 commit comments