LocalizedString.cs 995 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. namespace I2.Loc
  3. {
  4. [Serializable]
  5. public struct LocalizedString
  6. {
  7. public LocalizedString(LocalizedString str)
  8. {
  9. this.mTerm = str.mTerm;
  10. this.mRTL_IgnoreArabicFix = str.mRTL_IgnoreArabicFix;
  11. this.mRTL_MaxLineLength = str.mRTL_MaxLineLength;
  12. this.mRTL_ConvertNumbers = str.mRTL_ConvertNumbers;
  13. }
  14. public static implicit operator string(LocalizedString s)
  15. {
  16. return s.ToString();
  17. }
  18. public static implicit operator LocalizedString(string term)
  19. {
  20. return new LocalizedString
  21. {
  22. mTerm = term
  23. };
  24. }
  25. public override string ToString()
  26. {
  27. string translation = LocalizationManager.GetTranslation(this.mTerm, !this.mRTL_IgnoreArabicFix, this.mRTL_MaxLineLength, !this.mRTL_ConvertNumbers, true, null, null);
  28. LocalizationManager.ApplyLocalizationParams(ref translation);
  29. return translation;
  30. }
  31. public string mTerm;
  32. public bool mRTL_IgnoreArabicFix;
  33. public int mRTL_MaxLineLength;
  34. public bool mRTL_ConvertNumbers;
  35. }
  36. }