Locale.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2001-2005 Novell, Inc.
  21. //
  22. // Authors:
  23. // Miguel de Icaza ([email protected])
  24. // Andreas Nahr ([email protected])
  25. // Peter Bartok ([email protected])
  26. //
  27. //
  28. // This class is basically disabled until we decide we are going to
  29. // translate winforms. There are only a handful of places where we
  30. // actually use this. The GetText method has been kept so those
  31. // continue to work and people can still add new ones if they choose.
  32. // At any rate, we really don't need to localize images (or at least
  33. // any of the ones we had).
  34. using System;
  35. using System.Globalization;
  36. using System.Reflection;
  37. using System.Resources;
  38. namespace System.Windows.Forms {
  39. internal sealed class Locale {
  40. //#region Local Variables
  41. //private static ResourceManager rm;
  42. //#endregion // Local Variables
  43. //#region Constructors
  44. //static Locale () {
  45. // rm = new ResourceManager("System.Windows.Forms", Assembly.GetExecutingAssembly());
  46. //}
  47. //#endregion
  48. //#region Static Properties
  49. //public static ResourceManager ResourceManager {
  50. // get {
  51. // return rm;
  52. // }
  53. //}
  54. //#endregion // Static Properties
  55. #region Static Methods
  56. public static string GetText (string msg){
  57. return msg;
  58. // string ret;
  59. //// This code and behaviour may change without notice. It's a placeholder until I
  60. //// understand how Miguels wants localization of strings done.
  61. // ret = (string)rm.GetObject(msg);
  62. // if (ret != null) {
  63. // return ret;
  64. // }
  65. // return msg;
  66. }
  67. public static string GetText (string msg, params object [] args)
  68. {
  69. return String.Format (GetText (msg), args);
  70. }
  71. //public static object GetResource(string name) {
  72. // return rm.GetObject(name);
  73. //}
  74. #endregion // Static Methods
  75. }
  76. }