ILocalizationConfiguration.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.Generic;
  2. using Abp.Localization;
  3. namespace Abp.Configuration.Startup
  4. {
  5. /// <summary>
  6. /// Used for localization configurations.
  7. /// </summary>
  8. public interface ILocalizationConfiguration
  9. {
  10. /// <summary>
  11. /// Used to set languages available for this application.
  12. /// </summary>
  13. IList<LanguageInfo> Languages { get; }
  14. /// <summary>
  15. /// List of localization sources.
  16. /// </summary>
  17. ILocalizationSourceList Sources { get; }
  18. /// <summary>
  19. /// Used to enable/disable localization system.
  20. /// Default: true.
  21. /// </summary>
  22. bool IsEnabled { get; set; }
  23. /// <summary>
  24. /// If this is set to true, the given text (name) is returned
  25. /// if not found in the localization source. That prevent exceptions if
  26. /// given name is not defined in the localization sources.
  27. /// Also writes a warning log.
  28. /// Default: true.
  29. /// </summary>
  30. bool ReturnGivenTextIfNotFound { get; set; }
  31. /// <summary>
  32. /// It returns the given text by wrapping with [ and ] chars
  33. /// if not found in the localization source.
  34. /// This is considered only if <see cref="ReturnGivenTextIfNotFound"/> is true.
  35. /// Default: true.
  36. /// </summary>
  37. bool WrapGivenTextIfNotFound { get; set; }
  38. /// <summary>
  39. /// It returns the given text by converting string from 'PascalCase' to a 'Sentense case'
  40. /// if not found in the localization source.
  41. /// This is considered only if <see cref="ReturnGivenTextIfNotFound"/> is true.
  42. /// Default: true.
  43. /// </summary>
  44. bool HumanizeTextIfNotFound { get; set; }
  45. /// <summary>
  46. /// Write (or not write) a warning log if given text can not found in the localization source.
  47. /// Default: true.
  48. /// </summary>
  49. bool LogWarnMessageIfNotFound { get; set; }
  50. }
  51. }