PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/lang_cs.rb

https://github.com/janv/localization_simplified
Ruby | 115 lines | 76 code | 10 blank | 29 comment | 2 complexity | 0b5c96fddc928655350b9f9a39aaf226 MD5 | raw file
  1. # lang_cs.rb
  2. # Czech translation file
  3. # Translation by Karel Minařík (karmi@karmi.cz)
  4. module LocalizationSimplified
  5. About = {
  6. :lang => "cs",
  7. :updated => "2007-07-16"
  8. }
  9. class ActiveRecord
  10. # ErrorMessages to override default messages in
  11. # +ActiveRecord::Errors::@@default_error_messages+
  12. # This plugin also replaces hardcoded 3 text messages
  13. # :error_translation is inflected using the Rails
  14. # inflector.
  15. #
  16. # Remember to modify the Inflector with your localized translation
  17. # of "error" and "errors" in the bottom of this file
  18. #
  19. ErrorMessages = {
  20. :inclusion => "není v seznamu povolených hodnot",
  21. :exclusion => "je vyhrazeno pro jiný účel",
  22. :invalid => "není platná hodnota",
  23. :confirmation => "nebylo potvrzeno",
  24. :accepted => "musí být potvrzeno",
  25. :empty => "nesmí být prázdný/é",
  26. :blank => "je povinná položka",# alternate formulation: "is required"
  27. :too_long => "je příliš dlouhá/ý (max. %d znaků)",
  28. :too_short => "je příliš krátký/á (min. %d znaků)",
  29. :wrong_length => "nemá správnou délku (očekáváno %d znaků)",
  30. :taken => "již databáze obsahuje",
  31. :not_a_number => "není číslo",
  32. #Jespers additions:
  33. :error_translation => "chyba",
  34. :error_header => "%s nebylo možné %s uložit", #FIX
  35. :error_subheader => "Tato pole obsahují chyby:"
  36. }
  37. end
  38. # Texts to override +distance_of_time_in_words()+
  39. class DateHelper
  40. Texts = {
  41. :less_than_x_seconds => "asi %d sekundami",
  42. :half_a_minute => "asi před půl minutou",
  43. :less_than_a_minute => "necelou minutou",
  44. :one_minute => "minutou",
  45. :x_minutes => "%d minutami",
  46. :one_hour => "hodinou",
  47. :x_hours => "%d hodinami",
  48. :one_day => "24 hodinami", # Nejde dát 'včera' -- srov. "před 3 minutami" x "před včera/jedním dnem" (angl. "one day ago")
  49. :x_days => "%d dny",
  50. :one_month => "měsícem",
  51. :x_months => "%d měsíci", # Nevyřešeno pro budoucnost -- srov. "před 2 měsíci" x "za 2 měsíce" (ang. "2 months ago" - "in 2 months")
  52. :one_year => "rokem",
  53. :x_years => "%d roky"
  54. }
  55. # Rails uses Month names in Date and time select boxes
  56. # (+date_select+ and +datetime_select+ )
  57. # Currently (as of version 1.1.6), Rails doesn't use daynames
  58. Monthnames = [nil] + %w{Leden Únor Březen Duben Květen Červen Červenec Srpen Září Říjen Listopad Prosinec}
  59. AbbrMonthnames = [nil] + %w{Led Úno Bře Dub Kvě Čvn Čvc Srp Zář Říj Lis Pro}
  60. Daynames = %w{Neděle Pondělí Úterý Středa Čtvrtek Pátek Sobota}
  61. AbbrDaynames = %w{Ne Po Út St Čt So}
  62. # Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
  63. # These are sent to strftime that Ruby's date and time handlers use internally
  64. # Same options as php (that has a better list: http://www.php.net/strftime )
  65. DateFormats = {
  66. :default => "%d. %m. %Y",
  67. :short => "%e. %b.",
  68. :long => "%e. %B %Y"
  69. }
  70. TimeFormats = {
  71. :default => "%d. %m. %Y, %H:%M:",
  72. :short => "%e. %m. %H:%M",
  73. :long => "%e. %B %Y, %H:%M"
  74. }
  75. # Set the order of +date_select+ and +datetime_select+ boxes
  76. # Note that at present, the current Rails version only supports ordering of date_select boxes
  77. DateSelectOrder = {
  78. :order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
  79. }
  80. end
  81. class NumberHelper
  82. # CurrencyOptions are used as default for +Number#to_currency()+
  83. # http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
  84. CurrencyOptions = {
  85. :unit => "Kč",
  86. :separator => ".", #unit separator (between integer part and fraction part)
  87. :delimiter => " ", #delimiter between each group of thousands. Example: 1.234.567
  88. :order => [:unit, :number] #order is at present unsupported in Rails
  89. #to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
  90. }
  91. end
  92. class ArrayHelper
  93. # Modifies +Array#to_sentence()+
  94. # http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
  95. ToSentenceTexts = {
  96. :connector => 'a',
  97. :skip_last_comma => true
  98. }
  99. end
  100. end
  101. # Use the inflector below to pluralize "error" from
  102. # @@default_error_messages[:error_translation] above (if necessary)
  103. ( ( ActiveSupport::Inflector if ActiveSupport.const_defined?(:Inflector) ) || Inflector ).inflections do |inflect|
  104. inflect.irregular 'chyba', 'chyby'
  105. end