Permalink
Browse files

set encoding to utf-8 on all files

  • Loading branch information...
1 parent d749b58 commit 9be3d4a311b5bf583eec5d39986176cc40c112f2 Sven Fuchs committed Aug 26, 2009
Showing with 106 additions and 4 deletions.
  1. +2 −0 lib/i18n.rb
  2. +7 −4 lib/i18n/backend/base.rb
  3. +2 −0 lib/i18n/backend/cache.rb
  4. +2 −0 lib/i18n/backend/chain.rb
  5. +2 −0 lib/i18n/backend/fallbacks.rb
  6. +2 −0 lib/i18n/backend/gettext.rb
  7. +2 −0 lib/i18n/backend/pluralization.rb
  8. +2 −0 lib/i18n/backend/simple.rb
  9. +2 −0 lib/i18n/exceptions.rb
  10. +2 −0 lib/i18n/gettext.rb
  11. +2 −0 lib/i18n/helpers/gettext.rb
  12. +2 −0 lib/i18n/locale/fallbacks.rb
  13. +2 −0 lib/i18n/locale/tag.rb
  14. +2 −0 lib/i18n/locale/tag/parents.rb
  15. +2 −0 lib/i18n/locale/tag/rfc4646.rb
  16. +2 −0 lib/i18n/locale/tag/simple.rb
  17. +2 −0 lib/i18n/string.rb
  18. +2 −0 test/all.rb
  19. +2 −0 test/api/basics.rb
  20. +2 −0 test/api/interpolation.rb
  21. +2 −0 test/api/lambda.rb
  22. +2 −0 test/api/link.rb
  23. +2 −0 test/api/localization/date.rb
  24. +2 −0 test/api/localization/date_time.rb
  25. +2 −0 test/api/localization/lambda.rb
  26. +2 −0 test/api/localization/time.rb
  27. +2 −0 test/api/pluralization.rb
  28. +2 −0 test/api/translation.rb
  29. +2 −0 test/backend/cache/cache_test.rb
  30. +2 −0 test/backend/chain/api_test.rb
  31. +2 −0 test/backend/chain/chain_test.rb
  32. +2 −0 test/backend/fallbacks/api_test.rb
  33. +2 −0 test/backend/fallbacks/fallbacks_test.rb
  34. +2 −0 test/backend/pluralization/api_test.rb
  35. +2 −0 test/backend/pluralization/pluralization_test.rb
  36. +2 −0 test/backend/simple/all.rb
  37. +1 −0 test/backend/simple/api_test.rb
  38. +1 −0 test/backend/simple/lookup_test.rb
  39. +2 −0 test/backend/simple/setup.rb
  40. +1 −0 test/backend/simple/translations_test.rb
  41. +2 −0 test/fixtures/locales/en.rb
  42. +2 −0 test/fixtures/locales/plurals.rb
  43. +2 −0 test/gettext/api_test.rb
  44. +2 −0 test/gettext/backend_test.rb
  45. +2 −0 test/i18n_exceptions_test.rb
  46. +1 −0 test/i18n_load_path_test.rb
  47. +2 −0 test/i18n_test.rb
  48. +2 −0 test/locale/fallbacks_test.rb
  49. +2 −0 test/locale/tag/rfc4646_test.rb
  50. +2 −0 test/locale/tag/simple_test.rb
  51. +2 −0 test/string_test.rb
  52. +1 −0 test/test_helper.rb
  53. +2 −0 test/with_options.rb
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# Authors:: Matt Aimonetti (http://railsontherun.com/),
# Sven Fuchs (http://www.artweb-design.de),
# Joshua Harvey (http://www.workingwithrails.com/person/759-joshua-harvey),
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'yaml'
module I18n
@@ -102,11 +104,12 @@ def lookup(locale, key, scope = [], separator = nil)
return unless key
init_translations unless initialized?
keys = I18n.send(:normalize_translation_keys, locale, key, scope, separator)
- keys.inject(translations) do |result, k|
- if (x = result[k.to_sym]).nil?
- return nil
+ keys.inject(translations) do |result, key|
+ key = key.to_sym
+ if result.respond_to?(:has_key?) and result.has_key?(key)
+ result[key]
else
- x
+ return nil
end
end
end
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# This module allows you to easily cache all responses from the backend - thus
# speeding up the I18n aspects of your application quite a bit.
#
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module I18n
module Backend
# Backend that chains multiple other backends and checks each of them when
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/locale/fallbacks'
# I18n locale fallbacks are useful when you want your application to use
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/gettext'
require File.expand_path(File.dirname(__FILE__) + '/../../../vendor/po_parser.rb')
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# I18n locale fallbacks are useful when you want your application to use
# translations from other locales when translations for the current locale are
# missing. E.g. you might want to use :en translations when translations in
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/backend/base'
# Stub class for the Simple backend. The actual implementation is provided by
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
class KeyError < IndexError
def initialize(message = nil)
super(message || "key not found")
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module I18n
module Gettext
PLURAL_SEPARATOR = "\001"
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module I18n
module Helpers
# Implements classical Gettext style accessors. To use this include the
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/locale/tag'
# Locale Fallbacks
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/locale/tag/simple'
require 'i18n/locale/tag/rfc4646'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module I18n
module Locale
module Tag
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# RFC 4646/47 compliant Locale tag implementation that parses locale tags to
# subtags such as language, script, region, variant etc.
#
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'i18n/locale/tag/parents'
# Simple Locale tag implementation that computes subtags by simply splitting
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
=begin
heavily based on Masao Mutoh's gettext String interpolation extension
http://github.com/mutoh/gettext/blob/f6566738b981fe0952548c421042ad1e0cdfb31e/lib/gettext/core_ext/string.rb
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
Dir[File.dirname(__FILE__) + '/**/*_test.rb'].sort.each do |file|
require file
end
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Api
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/cache'
require 'activesupport'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/chain'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/chain'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/fallbacks'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/fallbacks'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/pluralization'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'i18n/backend/pluralization'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
Dir[File.dirname(__FILE__) + '/*_test.rb'].each do |file|
require file
end
@@ -1,4 +1,5 @@
# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
class I18nSimpleBackendApiBasicsTest < Test::Unit::TestCase
@@ -1,4 +1,5 @@
# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
class I18nSimpleBackendLookupTest < Test::Unit::TestCase
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Tests
module Backend
module Simple
@@ -1,4 +1,5 @@
# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
class I18nSimpleBackendLoadTranslationsTest < Test::Unit::TestCase
@@ -1 +1,3 @@
+# encoding: utf-8
+
{ :en => { :fuh => { :bah => "bas" } } }
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
{
:af => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
:am => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
require 'i18n/backend/gettext'
require 'i18n/helpers/gettext'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
require 'i18n/backend/gettext'
require 'i18n/helpers/gettext'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class I18nExceptionsTest < Test::Unit::TestCase
@@ -1,4 +1,5 @@
# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class I18nLoadPathTest < Test::Unit::TestCase
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class I18nTest < Test::Unit::TestCase
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.dirname(__FILE__) + '/../test_helper.rb'
require 'i18n/locale/fallbacks'
require 'i18n/locale/tag'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.dirname(__FILE__) + '/../../test_helper.rb'
require 'i18n/locale/tag'
require 'i18n/locale/tag/rfc4646'
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.dirname(__FILE__) + '/../../test_helper.rb'
require 'i18n/locale/tag'
require 'i18n/locale/tag/simple'
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
# thanks to Masao's String extensions these should work the same in
View
@@ -1,4 +1,5 @@
# encoding: utf-8
+
$:.unshift "lib"
require 'rubygems'
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# this is only here so we can test I18n works nicely with ActiveSupports
# with_options. Maybe we can just remove it?

0 comments on commit 9be3d4a

Please sign in to comment.