| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Globalization;
- namespace Abp.Localization
- {
- /// <summary>
- /// A class that gets the same string on every localization.
- /// </summary>
- [Serializable]
- public class FixedLocalizableString : ILocalizableString
- {
- /// <summary>
- /// The fixed string.
- /// Whenever Localize methods called, this string is returned.
- /// </summary>
- public virtual string FixedString { get; private set; }
- /// <summary>
- /// Needed for serialization.
- /// </summary>
- private FixedLocalizableString()
- {
- }
- /// <summary>
- /// Creates a new instance of <see cref="FixedLocalizableString"/>.
- /// </summary>
- /// <param name="fixedString">
- /// The fixed string.
- /// Whenever Localize methods called, this string is returned.
- /// </param>
- public FixedLocalizableString(string fixedString)
- {
- FixedString = fixedString;
- }
- public string Localize(ILocalizationContext context)
- {
- return FixedString;
- }
- public string Localize(ILocalizationContext context, CultureInfo culture)
- {
- return FixedString;
- }
- public override string ToString()
- {
- return FixedString;
- }
- }
- }
|