diff options
| author | hukl <contact@smyck.org> | 2010-01-14 22:21:43 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2010-01-14 22:21:43 +0100 |
| commit | 57d1382013c85a7b11ac8ce5e683f6006b12b328 (patch) | |
| tree | 19646c4fa5952fa1cf0a2c874952affa346373f1 /vendor/plugins/globalize2/lib/globalize/translation.rb | |
| parent | 1b86bf5f2e35d1820bfa32d979bcc2d9ff9a9a8e (diff) | |
Updated globalize2 to latest version. Modified existing code accoringly
Diffstat (limited to 'vendor/plugins/globalize2/lib/globalize/translation.rb')
| -rw-r--r-- | vendor/plugins/globalize2/lib/globalize/translation.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/vendor/plugins/globalize2/lib/globalize/translation.rb b/vendor/plugins/globalize2/lib/globalize/translation.rb deleted file mode 100644 index a80afcd7..00000000 --- a/vendor/plugins/globalize2/lib/globalize/translation.rb +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | module Globalize | ||
| 2 | # Translations are simple value objects that carry some context information | ||
| 3 | # alongside the actual translation string. | ||
| 4 | |||
| 5 | class Translation < String | ||
| 6 | class Attribute < Translation | ||
| 7 | attr_accessor :requested_locale, :locale, :key | ||
| 8 | end | ||
| 9 | |||
| 10 | class Static < Translation | ||
| 11 | attr_accessor :requested_locale, :locale, :key, :options, :plural_key, :original | ||
| 12 | |||
| 13 | def initialize(string, meta = nil) | ||
| 14 | self.original = string | ||
| 15 | super | ||
| 16 | end | ||
| 17 | end | ||
| 18 | |||
| 19 | def initialize(string, meta = nil) | ||
| 20 | set_meta meta | ||
| 21 | super string | ||
| 22 | end | ||
| 23 | |||
| 24 | def fallback? | ||
| 25 | locale.to_sym != requested_locale.to_sym | ||
| 26 | end | ||
| 27 | |||
| 28 | def set_meta(meta) | ||
| 29 | meta.each {|name, value| send :"#{name}=", value } if meta | ||
| 30 | end | ||
| 31 | end | ||
| 32 | end \ No newline at end of file | ||
