[Tutor] Using .po translation file

Григор Колев grigor.kolev at gmail.com
Wed Aug 3 11:44:22 CEST 2011


I do not understand
I have bg.po file
And try the following.

import gettext
instance = gettext.GNUTranslations(open('bg.po'))
IOError: [Errno 0] Bad magic number: 'bg.po'

and this
instance = gettext.Catalog('bg.po')
IOError: [Errno 2] No translation file found for domain: 'bg.po'





В 14:48 +0530 на 03.08.2011 (ср), vishwajeet singh написа:
> 
> 
> 2011/8/3 Григор Колев <grigor.kolev at gmail.com>
>         Hi.
>         Some one help me.
>         Haw can I use .po translation file for my program.
>         
>          cat = gettext.Catalog(domain, localedir)
>          what should be domain
> 
> Domain is usually the name of po file it defaults to django and
> djangojs in some cases.
>  
> 
>         
>         _______________________________________________
>         Tutor maillist  -  Tutor at python.org
>         To unsubscribe or change subscription options:
>         http://mail.python.org/mailman/listinfo/tutor
> 
> 
> 
> -- 
> Vishwajeet Singh
> +91-9657702154 | dextrous85 at gmail.com | http://bootstraptoday.com
> Twitter: http://twitter.com/vishwajeets | LinkedIn:
> http://www.linkedin.com/in/singhvishwajeet




More information about the Tutor mailing list