3232from sphinx import addnodes
3333from sphinx import version_info as sphinx_version_info
3434from sphinx .roles import XRefRole
35- from sphinx .locale import l_ , _
35+ from sphinx .locale import _
3636from sphinx .domains import Domain , ObjType , Index
3737from sphinx .directives import ObjectDescription
3838from sphinx .util .nodes import make_refnode
@@ -334,7 +334,7 @@ def get_index_text(self, names):
334334
335335class LuaClass (LuaObject ):
336336 doc_field_types = [
337- Field ('extend' , label = l_ ('Extends' ), has_arg = False ,
337+ Field ('extend' , label = _ ('Extends' ), has_arg = False ,
338338 names = ('extend' ,)),
339339 ]
340340
@@ -357,15 +357,15 @@ class LuaFunction(LuaObject):
357357 typename = "function"
358358
359359 doc_field_types = [
360- TypedField ('parameter' , label = l_ ('Parameters' ),
360+ TypedField ('parameter' , label = _ ('Parameters' ),
361361 names = ('param' , 'parameter' , 'arg' , 'argument' ),
362362 typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
363- TypedField ('returnvalues' , label = l_ ('Returns' ),
363+ TypedField ('returnvalues' , label = _ ('Returns' ),
364364 names = ('return' , 'ret' ), typerolename = 'obj' ,
365365 typenames = ('rtype' , 'type' )),
366- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
366+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
367367 names = ('returns' )),
368- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
368+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
369369 names = ('returntype' ,)),
370370 ]
371371
@@ -379,18 +379,18 @@ def get_index_name(self, names):
379379 return '%s()' % (names ['fullname' ])
380380
381381class LuaVarFunction (LuaObject ):
382- typename = l_ ("varfunc" )
382+ typename = _ ("varfunc" )
383383
384384 doc_field_types = [
385- TypedField ('parameter' , label = l_ ('Parameters' ),
385+ TypedField ('parameter' , label = _ ('Parameters' ),
386386 names = ('param' , 'parameter' , 'arg' , 'argument' ),
387387 typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
388- TypedField ('returnvalues' , label = l_ ('Returns' ),
388+ TypedField ('returnvalues' , label = _ ('Returns' ),
389389 names = ('return' , 'ret' ), typerolename = 'obj' ,
390390 typenames = ('rtype' , 'type' )),
391- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
391+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
392392 names = ('returns' )),
393- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
393+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
394394 names = ('returntype' ,)),
395395 ]
396396
@@ -439,7 +439,7 @@ class LuaData(LuaObject):
439439 )
440440
441441 doc_field_types = [
442- Field ('type' , label = l_ ('Type' ), has_arg = False ,
442+ Field ('type' , label = _ ('Type' ), has_arg = False ,
443443 names = ('type' ,)),
444444 ]
445445
@@ -450,7 +450,7 @@ def build_objtype(self):
450450 return self .options .get ('objtype' ) or ""
451451
452452class LuaAttribute (LuaData ):
453- typename = l_ ("attribute" )
453+ typename = _ ("attribute" )
454454
455455 lua_class_re = re .compile (
456456 r'''([\w\./\-]+):([\w\./\-]+)?
@@ -471,18 +471,18 @@ def build_context(self, context):
471471 return None , None
472472
473473class LuaOperator (LuaObject ):
474- typename = l_ ("operator" )
474+ typename = _ ("operator" )
475475
476476 doc_field_types = [
477- TypedField ('parameter' , label = l_ ('Parameters' ),
477+ TypedField ('parameter' , label = _ ('Parameters' ),
478478 names = ('param' , 'parameter' , 'arg' , 'argument' ),
479479 typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
480- TypedField ('returnvalues' , label = l_ ('Returns' ),
480+ TypedField ('returnvalues' , label = _ ('Returns' ),
481481 names = ('return' , 'ret' ), typerolename = 'obj' ,
482482 typenames = ('rtype' , 'type' )),
483- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
483+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
484484 names = ('returns' )),
485- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
485+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
486486 names = ('returntype' ,)),
487487 ]
488488
@@ -706,8 +706,8 @@ class LuaModuleIndex(Index):
706706 Index subclass to provide the Lua module index.
707707 """
708708 name = 'modindex'
709- localname = l_ ('Lua Module Index' )
710- shortname = l_ ('modules' )
709+ localname = _ ('Lua Module Index' )
710+ shortname = _ ('modules' )
711711
712712 def generate (self , docnames = None ):
713713 content = {}
@@ -776,14 +776,14 @@ class LuaDomain(Domain):
776776 name = 'lua'
777777 label = 'Lua'
778778 object_types = {
779- 'class' : ObjType (l_ ('class' ), 'class' , 'obj' ),
780- 'attribute' : ObjType (l_ ('attribute' ), 'data' , 'obj' ),
781- 'function' : ObjType (l_ ('function' ), 'func' , 'obj' ),
782- 'varunc ' : ObjType (l_ ('varfunc' ), 'func' , 'obj' ),
783- 'method' : ObjType (l_ ('method' ), 'func' , 'obj' ),
784- 'operator' : ObjType (l_ ('operator' ), 'func' , 'obj' ),
785- 'module' : ObjType (l_ ('module' ), 'mod' , 'obj' ),
786- 'data' : ObjType (l_ ('data' ), 'data' , 'obj' ),
779+ 'class' : ObjType (_ ('class' ), 'class' , 'obj' ),
780+ 'attribute' : ObjType (_ ('attribute' ), 'data' , 'obj' ),
781+ 'function' : ObjType (_ ('function' ), 'func' , 'obj' ),
782+ 'varfunc ' : ObjType (_ ('varfunc' ), 'func' , 'obj' ),
783+ 'method' : ObjType (_ ('method' ), 'func' , 'obj' ),
784+ 'operator' : ObjType (_ ('operator' ), 'func' , 'obj' ),
785+ 'module' : ObjType (_ ('module' ), 'mod' , 'obj' ),
786+ 'data' : ObjType (_ ('data' ), 'data' , 'obj' ),
787787 }
788788
789789 directives = {
0 commit comments