Sha256: 893cd984cb05690bcd24d6cf92fc9a1871e12279b60f3efa1cbc4dcc84ddb814

Contents?: true

Size: 1005 Bytes

Versions: 35

Compression:

Stored size: 1005 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

35 entries across 35 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 gen/language/Buildfile
sproutcore-1.4.4-java lib/gen/language/Buildfile
sproutcore-1.4.4 lib/gen/language/Buildfile
sproutcore-1.4.3.1 lib/gen/language/Buildfile
sproutcore-1.4.3-java lib/gen/language/Buildfile
sproutcore-1.4.3 lib/gen/language/Buildfile
sproutcore-1.4.2-java lib/gen/language/Buildfile
sproutcore-1.4.2 lib/gen/language/Buildfile
sproutcore-1.4.1-java lib/gen/language/Buildfile
sproutcore-1.4.1 lib/gen/language/Buildfile
sproutcore-1.4.0-java lib/gen/language/Buildfile
sproutcore-1.4.0 lib/gen/language/Buildfile
sproutcore-1.4.0.rc.5 lib/gen/language/Buildfile
sproutcore-1.4.0.rc.4 lib/gen/language/Buildfile
sproutcore-1.4.0.rc.3 lib/gen/language/Buildfile
sproutcore-1.4.0.rc.2 lib/gen/language/Buildfile
sproutcore-1.4.0.rc gen/language/Buildfile
sproutcore-1.0.1049.pre.2 gen/language/Buildfile
sproutcore-1.0.1049.pre.1 gen/language/Buildfile
sproutcore-1.0.1046 gen/language/Buildfile