3 #TODO : translate messages
4 #from Products.PlacelessTranslationService.MessageID import MessageIDFactory
5 #_ = MessageIDFactory('plinn')
6 _
= lambda x
: lambda : x
8 translate
= lambda msg
: _(msg
)().decode('iso-8859-1').encode('utf-8')
9 portal
= context
.portal_url
.getPortalObject()
10 ucn
= translate(portal
.getProperty('untitled_content_name', 'Untitled-'))
13 untitledNumbers
= [ id[ucnl
:] for id in context
.objectIds() if id.startswith(ucn
) ]
15 for strN
in untitledNumbers
:
18 if n
> nMax
: nMax
= n
22 return ucn
+ str(nMax
+ 1)