merge i18n fixes

This commit is contained in:
Kanwei Li
2010-07-07 14:25:52 -04:00
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1657,7 +1657,7 @@ class DataSourceTool( Tool ):
data.extension = param_dict.get( 'data_type', data.extension )
#TODO: these should be possible as part of data_source.py and external set_meta, see the upload tool:
if data.extension in [ 'txt', 'tabular' ]:
data_type = sniff.guess_ext( data.file_name, sniff_order=app.datatypes_registry.sniff_order )
data_type = sniff.guess_ext( data.file_name, sniff_order=app.datatypes_registry.sniff_order, is_multi_byte=self.is_multi_byte )
if data.extension != data_type:
data.change_datatype( data_type )
elif not isinstance( data.datatype, datatypes.interval.Bed ) and isinstance( data.datatype, datatypes.interval.Interval ):
+2 -1
View File
@@ -27,6 +27,7 @@ import mako.runtime
pkg_resources.require( "Babel" )
from babel.support import Translations
from babel import Locale
pkg_resources.require( "SQLAlchemy >= 0.4" )
from sqlalchemy import and_
@@ -200,7 +201,7 @@ class GalaxyWebTransaction( base.DefaultWebTransaction ):
if 'HTTP_ACCEPT_LANGUAGE' in self.environ:
# locales looks something like: ['en', 'en-us;q=0.7', 'ja;q=0.3']
locales = self.environ['HTTP_ACCEPT_LANGUAGE'].split( ',' )
locales = [ l.split( ';' )[0] for l in locales ]
locales = [ Locale.parse(l.split( ';' )[0], sep='-').language for l in locales ]
else:
# Default to English
locales = 'en'