silke: thuban/Thuban/UI about.py,1.12,1.13

Martin Schulze joey at infodrom.org
Tue Aug 10 22:36:31 CEST 2004


cvs at intevation.de wrote:
> +import locale
   ^^^^^^^^^^^^^

> +
>  from Thuban import _
>  from Thuban.version import versions
>  from Thuban.Model.resource import gdal_support_status
> @@ -33,9 +35,9 @@
>          # characters to get byte strings in latin1.
>          lead_developer = 'Bernhard Herzog'
>          developers = [ 'Jonathan Coles', 'Frank Koormann',
> -                       'Martin M\xfcller', 'Jan-Oliver Wagner' ]
> +                       unicodeToLocale(u'Martin M\xfcller'), 'Jan-Oliver Wagner' ]
>          translators = [ ( _('French'), 'Daniel Calvelo Aros' ),
> -                        ( _('German'), 'Bj\xf6rn Broscheit'),
> +                        ( _('German'), unicodeToLocale(u'Bj\xf6rn Broscheit')),
>                          ( _('Italian'), 'Maurizio Napolitano'),
>                          ( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'),
>                          ( _('Russian'), 'Alex Shevlakov'),
> @@ -128,4 +130,11 @@
>      def OnCancel(self, event):
>          self.EndModal(wxID_CANCEL)
>  
> +
> +def unicodeToLocale(unicodeStr):
> +    " Function to convert a unicode object to an object \ in the user's locale encoding"
> +
> +
> +    import locale
       ^^^^^^^^^^^^^

> +    return unicodeStr.encode(locale.getlocale()[1])

Do you need to import the module twice?  (yes, I know Python won't import it twice).

I'd also expect "from locale import getlocale", though.

Regards,

	Joey

-- 
Life is too short to run proprietary software.  -- Bdale Garbee




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)