Index: turbogears/qstemplates/quickstart/setup.py_tmpl
===================================================================
--- turbogears/qstemplates/quickstart/setup.py_tmpl	(Revision 3028)
+++ turbogears/qstemplates/quickstart/setup.py_tmpl	(Arbeitskopie)
@@ -4,10 +4,18 @@
 import os
 execfile(os.path.join("${package}", "release.py"))
 
+packages=find_packages()
+package_data = find_package_data(where='${package}',
+    package='${package}')
+if os.path.isdir('locales'):
+    packages.append('locales')
+    package_data.update(find_package_data(where='locales',
+        exclude=('*.po',), only_in_packages=False))
+
 setup(
     name="${project}",
     version=version,
-    
+
     # uncomment the following lines if you fill them out in release.py
     #description=description,
     #author=author,
@@ -15,38 +23,37 @@
     #url=url,
     #download_url=download_url,
     #license=license,
-    
-    install_requires = [
+
+    install_requires=[
         "TurboGears >= ${turbogearsversion}",
-#if $identity == "sqlalchemy" 
-        "SQLAlchemy", 
-#end if 
+#if $identity == "sqlalchemy"
+        "SQLAlchemy",
+#end if
     ],
-    scripts = ["start-${package}.py"],
+    scripts=["start-${package}.py"],
     zip_safe=False,
-    packages=find_packages(),
-    package_data = find_package_data(where='${package}',
-                                     package='${package}'),
-    keywords = [
+    packages=packages,
+    package_data=package_data,
+    keywords=[
         # Use keywords if you'll be adding your package to the
         # Python Cheeseshop
-        
+
         # if this has widgets, uncomment the next line
         # 'turbogears.widgets',
-        
+
         # if this has a tg-admin command, uncomment the next line
         # 'turbogears.command',
-        
+
         # if this has identity providers, uncomment the next line
         # 'turbogears.identity.provider',
-    
+
         # If this is a template plugin, uncomment the next line
         # 'python.templating.engines',
-        
+
         # If this is a full application, uncomment the next line
         # 'turbogears.app',
     ],
-    classifiers = [
+    classifiers=[
         'Development Status :: 3 - Alpha',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
@@ -55,11 +62,11 @@
         # if this is an application that you'll distribute through
         # the Cheeseshop, uncomment the next line
         # 'Framework :: TurboGears :: Applications',
-        
+
         # if this is a package that includes widgets that you'll distribute
         # through the Cheeseshop, uncomment the next line
         # 'Framework :: TurboGears :: Widgets',
     ],
-    test_suite = 'nose.collector',
+    test_suite='nose.collector',
     )
-    
+
Index: turbogears/util.py
===================================================================
--- turbogears/util.py	(Revision 3028)
+++ turbogears/util.py	(Arbeitskopie)
@@ -101,11 +101,14 @@
     if "--egg" in sys.argv:
         projectname = sys.argv[sys.argv.index("--egg")+1]
         egg = pkg_resources.get_distribution(projectname)
-        package = list(egg._get_metadata("top_level.txt"))[0]
-        return package
-    fname = get_project_meta('top_level.txt')
-    if fname:
-        return open(fname).readline()[:-1]
+        top_level = egg._get_metadata("top_level.txt")
+    else:
+        fname = get_project_meta('top_level.txt')
+        top_level = fname and open(fname) or []
+    for package in top_level:
+        package = package.rstrip()
+        if package and package != 'locales':
+            return package
 
 def get_project_name():
     pkg_info = get_project_meta('PKG-INFO')
@@ -426,6 +429,6 @@
            "arg_index", "inject_arg", "inject_args", "bind_args",
            "recursive_update", "combine_contexts", "request_available",
            "flatten_sequence", "load_class", "Bunch",
-           "parse_http_accept_header", 
+           "parse_http_accept_header",
            "to_unicode", "to_utf8", "get_template_encoding_default",
            "find_precision", "copy_if_mutable"]

