23
23
from .layout import ContainerOverflow , EndOfContainer
24
24
from .number import NumberFormat
25
25
from .paragraph import StaticParagraph , Paragraph , ParagraphStyle
26
+ from .strings import StringCollection , String , StringField
26
27
from .structure import ListOf , ListOfSection
27
28
from .text import MixedStyledText , SingleStyledText , TextStyle , ErrorText
28
29
from .util import posix_path , ReadAliasAttribute , PeekIterator
@@ -397,7 +398,8 @@ def referenceable(self):
397
398
def text (self , container ):
398
399
try :
399
400
number = self .number (container )
400
- label = [self .referenceable .category , ' ' , number ]
401
+ category_label = StringField (FloatLabels , self .referenceable .category )
402
+ label = [category_label , ' ' , number ]
401
403
except KeyError :
402
404
label = []
403
405
return MixedStyledText (label + [self .content ], parent = self )
@@ -409,12 +411,19 @@ class FigureStyle(FloatStyle, GroupedFlowablesStyle):
409
411
410
412
class Figure (Float , StaticGroupedFlowables ):
411
413
style_class = FigureStyle
412
- category = 'Figure '
414
+ category = 'figure '
413
415
414
416
415
417
class ListOfFigures (ListOf ):
416
- category = 'Figure '
418
+ category = 'figure '
417
419
418
420
419
421
class ListOfFiguresSection (ListOfSection ):
420
422
list_class = ListOfFigures
423
+
424
+
425
+ class FloatLabels (StringCollection ):
426
+ """Collection of localized titles for common sections"""
427
+
428
+ figure = String ('Caption label for figures' )
429
+ table = String ('Caption label for tables' )
0 commit comments