[GRASS-dev] [GRASS GIS] #2425: Import translation function instead of using a buildin

GRASS GIS trac at osgeo.org
Wed Sep 17 14:20:44 PDT 2014


#2425: Import translation function instead of using a buildin
-----------------------------------------------------+----------------------
 Reporter:  wenzeslaus                               |       Owner:  grass-dev@…              
     Type:  task                                     |      Status:  new                      
 Priority:  normal                                   |   Milestone:  7.1.0                    
Component:  Translations                             |     Version:  svn-releasebranch70      
 Keywords:  python, underscore, _, gettext, doctest  |    Platform:  All                      
      Cpu:  Unspecified                              |  
-----------------------------------------------------+----------------------

Comment(by glynn):

 Replying to [ticket:2425 wenzeslaus]:

 > Basically, it is necessary to remove all occurrences of:
 >
 {{{
 gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'),
 unicode = True)
 }}}
 >
 > By one code based on this line in some module:
 >
 {{{
 _ = gettext.translation('grasswxpy', os.path.join(os.getenv("GISBASE"),
 'locale')).ugettext
 }}}

 I'd suggest that what's actually "necessary" is to fix whatever can't cope
 with "_" being a built-in function.

 It shouldn't be necessary to explicitly import "_" into each and every
 file. This is why Python has a (mutable) built-in namespace.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2425#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list