Sha256: 07315cc60e50afc1190f84ccf0fcb7f987e0430d4814d21c8d46e3ebfbb0d695

Contents?: true

Size: 1006 Bytes

Versions: 13

Compression:

Stored size: 1006 Bytes

Contents

# ==========================================================================
# Generator: Language
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
#            portions copyright ©2009 Apple, Inc.
# ==========================================================================

namespace :generator do

  # First argument must be the namespace.  Second argument should be the 
  # language we want to add.  Generate a filename (foo.lproj) and language
  # name.
  task :prepare do
    long_languages = %w(english french german italian spanish japanese)
    if language = GENERATOR.arguments[2]
      if long_languages.include?(language.downcase)
        GENERATOR.language = language.downcase.capitalize
        GENERATOR.filename = language.downcase + '.lproj'
      else
        GENERATOR.language = language.gsub('_', '-') 
        GENERATOR.filename = language.gsub('-', '_') + '.lproj'
      end
    end
    GENERATOR.requires! :target_project, :target, :language, :filename
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 gen/language/Buildfile
sproutit-sproutcore-1.0.0.20090408130025 gen/language/Buildfile
sproutit-sproutcore-1.0.0.20090416161445 gen/language/Buildfile
sproutit-sproutcore-1.0.0.20090720093355 gen/language/Buildfile
sproutit-sproutcore-1.0.0.20090720202429 gen/language/Buildfile
sproutit-sproutcore-1.0.0.20090721125122 gen/language/Buildfile
sproutit-sproutcore-1.0.126 gen/language/Buildfile
sproutit-sproutcore-1.0.20090721145236 gen/language/Buildfile
sproutit-sproutcore-1.0.20090721145251 gen/language/Buildfile
sproutit-sproutcore-1.0.20090721145280 gen/language/Buildfile
sproutit-sproutcore-1.0.20090721145281 gen/language/Buildfile
sproutit-sproutcore-1.0.20090721145282 gen/language/Buildfile
sproutit-sproutcore-1.0.203 gen/language/Buildfile