air18n 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,6 @@ module Air18n
61
61
  alias_method_chain :t, :routes_context
62
62
  alias_method_chain :translate, :routes_context
63
63
 
64
- memoize :localized_path_explicit_locale
65
64
  memoize :language_from_locale
66
65
  end
67
66
  end
@@ -230,49 +230,6 @@ module Air18n
230
230
  end
231
231
  end
232
232
 
233
- # Replaces LOCALE and COUNTRY, if they are present in path, with
234
- # I18n.locale and I18n.country. You can explicitly set the locale and
235
- # country with options[:locale] and options[:country].
236
- #
237
- # Use this if the resource you reference lives under public/. For example,
238
- # to reference an image file, pass just call e.g.
239
- # localized_public_path("/images/buttons/awesome-LOCALE.png").
240
- def localized_public_path(path_relative_to_public, options = {})
241
- localized_path(path_relative_to_public, options.merge({:absolute_prefix_on_disk => Rails.public_path}))
242
- end
243
-
244
- # Replaces LOCALE and COUNTRY, if they are present in path, with
245
- # I18n.locale and I18n.country. You can explicitly set the locale and
246
- # country with options[:locale] and options[:country].
247
- #
248
- # If path is not absolute, you must also set
249
- # options[:absolute_prefix_on_disk] so that absolute_prefix_on_disk+path is
250
- # a valid absolute path (after locale or country interpolations).
251
- # If you are referencing something in public/, you should use
252
- # localized_public_path.
253
- #
254
- # If the file does not exist after interpolation, LOCALE will be replaced
255
- # with "en" and COUNTRY will be replaced with "us".
256
- def localized_path(path, options = {})
257
- options[:locale] ||= I18n.locale
258
- options[:country] ||= I18n.country
259
- localized_path_explicit_locale(path, options)
260
- end
261
-
262
- # Same as localized_path but explicitly uses options[:locale] and
263
- # options[:country] so that it can be memoized.
264
- def localized_path_explicit_locale(path, options = {})
265
- replaced = path.gsub('LOCALE', options[:locale].to_s).gsub('COUNTRY', options[:country].to_s)
266
-
267
- # TODO(jason) Use full locale and its fallbacks.
268
- absolute_path = options[:absolute_prefix_on_disk] ? File.join(options[:absolute_prefix_on_disk], "images", replaced) : replaced
269
- if File.exist?(absolute_path)
270
- replaced
271
- else
272
- path.gsub('COUNTRY', "US").gsub('LOCALE', "en")
273
- end
274
- end
275
-
276
233
  # Add :routes_context option, which is used for translation screenshotting.
277
234
  # I18n.fallback_routes_context is set by an ApplicationController
278
235
  # before_filter.
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
data/make_gem CHANGED
@@ -1,5 +1,5 @@
1
1
  # Run this to push the new version of the gem to rubygems!
2
- v=0.0.9
2
+ v=0.1.0
3
3
  gem build air18n.gemspec
4
4
  gem push air18n-${v}.gem
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-06-22 00:00:00.000000000 Z
16
+ date: 2012-06-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n