32
32
from sphinx import addnodes
33
33
from sphinx import version_info as sphinx_version_info
34
34
from sphinx .roles import XRefRole
35
- from sphinx .locale import l_ , _
35
+ from sphinx .locale import _
36
36
from sphinx .domains import Domain , ObjType , Index
37
37
from sphinx .directives import ObjectDescription
38
38
from sphinx .util .nodes import make_refnode
@@ -334,7 +334,7 @@ def get_index_text(self, names):
334
334
335
335
class LuaClass (LuaObject ):
336
336
doc_field_types = [
337
- Field ('extend' , label = l_ ('Extends' ), has_arg = False ,
337
+ Field ('extend' , label = _ ('Extends' ), has_arg = False ,
338
338
names = ('extend' ,)),
339
339
]
340
340
@@ -357,15 +357,15 @@ class LuaFunction(LuaObject):
357
357
typename = "function"
358
358
359
359
doc_field_types = [
360
- TypedField ('parameter' , label = l_ ('Parameters' ),
360
+ TypedField ('parameter' , label = _ ('Parameters' ),
361
361
names = ('param' , 'parameter' , 'arg' , 'argument' ),
362
362
typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
363
- TypedField ('returnvalues' , label = l_ ('Returns' ),
363
+ TypedField ('returnvalues' , label = _ ('Returns' ),
364
364
names = ('return' , 'ret' ), typerolename = 'obj' ,
365
365
typenames = ('rtype' , 'type' )),
366
- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
366
+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
367
367
names = ('returns' )),
368
- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
368
+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
369
369
names = ('returntype' ,)),
370
370
]
371
371
@@ -379,18 +379,18 @@ def get_index_name(self, names):
379
379
return '%s()' % (names ['fullname' ])
380
380
381
381
class LuaVarFunction (LuaObject ):
382
- typename = l_ ("varfunc" )
382
+ typename = _ ("varfunc" )
383
383
384
384
doc_field_types = [
385
- TypedField ('parameter' , label = l_ ('Parameters' ),
385
+ TypedField ('parameter' , label = _ ('Parameters' ),
386
386
names = ('param' , 'parameter' , 'arg' , 'argument' ),
387
387
typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
388
- TypedField ('returnvalues' , label = l_ ('Returns' ),
388
+ TypedField ('returnvalues' , label = _ ('Returns' ),
389
389
names = ('return' , 'ret' ), typerolename = 'obj' ,
390
390
typenames = ('rtype' , 'type' )),
391
- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
391
+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
392
392
names = ('returns' )),
393
- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
393
+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
394
394
names = ('returntype' ,)),
395
395
]
396
396
@@ -439,7 +439,7 @@ class LuaData(LuaObject):
439
439
)
440
440
441
441
doc_field_types = [
442
- Field ('type' , label = l_ ('Type' ), has_arg = False ,
442
+ Field ('type' , label = _ ('Type' ), has_arg = False ,
443
443
names = ('type' ,)),
444
444
]
445
445
@@ -450,7 +450,7 @@ def build_objtype(self):
450
450
return self .options .get ('objtype' ) or ""
451
451
452
452
class LuaAttribute (LuaData ):
453
- typename = l_ ("attribute" )
453
+ typename = _ ("attribute" )
454
454
455
455
lua_class_re = re .compile (
456
456
r'''([\w\./\-]+):([\w\./\-]+)?
@@ -471,18 +471,18 @@ def build_context(self, context):
471
471
return None , None
472
472
473
473
class LuaOperator (LuaObject ):
474
- typename = l_ ("operator" )
474
+ typename = _ ("operator" )
475
475
476
476
doc_field_types = [
477
- TypedField ('parameter' , label = l_ ('Parameters' ),
477
+ TypedField ('parameter' , label = _ ('Parameters' ),
478
478
names = ('param' , 'parameter' , 'arg' , 'argument' ),
479
479
typerolename = 'obj' , typenames = ('paramtype' , 'type' , 'ptype' )),
480
- TypedField ('returnvalues' , label = l_ ('Returns' ),
480
+ TypedField ('returnvalues' , label = _ ('Returns' ),
481
481
names = ('return' , 'ret' ), typerolename = 'obj' ,
482
482
typenames = ('rtype' , 'type' )),
483
- Field ('returnvalue' , label = l_ ('Returns' ), has_arg = False ,
483
+ Field ('returnvalue' , label = _ ('Returns' ), has_arg = False ,
484
484
names = ('returns' )),
485
- Field ('returntype' , label = l_ ('Return type' ), has_arg = False ,
485
+ Field ('returntype' , label = _ ('Return type' ), has_arg = False ,
486
486
names = ('returntype' ,)),
487
487
]
488
488
@@ -706,8 +706,8 @@ class LuaModuleIndex(Index):
706
706
Index subclass to provide the Lua module index.
707
707
"""
708
708
name = 'modindex'
709
- localname = l_ ('Lua Module Index' )
710
- shortname = l_ ('modules' )
709
+ localname = _ ('Lua Module Index' )
710
+ shortname = _ ('modules' )
711
711
712
712
def generate (self , docnames = None ):
713
713
content = {}
@@ -776,14 +776,14 @@ class LuaDomain(Domain):
776
776
name = 'lua'
777
777
label = 'Lua'
778
778
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' ),
787
787
}
788
788
789
789
directives = {
0 commit comments