How to use the indico.util.i18n.i18nformat function in indico

To help you get started, weโ€™ve selected a few indico examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github indico / indico / indico / MaKaC / webinterface / pages / abstracts.py View on Github external
def _getMergeFromHTML(self):
        abstracts = self._abstract.getMergeFromList()
        if not abstracts:
            return ""
        l = []
        for abstract in abstracts:
            if abstract.getOwner():
                l.append("""<a href="%s">%s : %s</a><br>\n""" % (urlHandlers.UHAbstractManagment.getURL(abstract), abstract.getId(), abstract.getTitle()))
            else:
                l.append("""%s : %s [DELETED]<br>\n""" % (abstract.getId(), abstract.getTitle()))

        return i18nformat("""
                    <span class="dataCaptionFormat"> _("Merged from")</span>
                    %s
                """) % "".join(l)
github indico / indico / indico / MaKaC / webinterface / pages / registrants.py View on Github external
"Position": _("Position"),
                       "Institution": _("Institution"),
                       "Phone": _("Phone"),
                       "City": _("City"),
                       "Country": _("Country"),
                       "Address": _("Address"),
                       "ArrivalDate": _("Arrival Date"),
                       "DepartureDate": _("Departure Date"),
                       "amountToPay": _("Amount"),
                       "idpayment": _("Payment ID"),
                       "isPayed": _("Paid"),
                       "eTicket": _("e-ticket"),
                       "checkedIn": _("Checked in"),
                       "checkInDate": _("Check in Date"),
                       "more": _("General info"),
                       "RegistrationDate": i18nformat(
                           """_("Registration date") (%s)""") % self._conf.getTimezone()
                       }

            tit = self._conf.getRegistrationForm().getSessionsForm().getTitle()
            if not self._conf.getRegistrationForm().getSessionsForm().isEnabled():
                tit = '%s <span style="color:red;font-size: 75%%">(disabled)</span>' % tit
            columns["Sessions"] = tit
            tit = self._conf.getRegistrationForm().getAccommodationForm().getTitle()
            if not self._conf.getRegistrationForm().getAccommodationForm().isEnabled():
                tit = '%s <span style="color:red;font-size: 75%%">(disabled)</span>' % tit
            columns["Accommodation"] = tit
            tit = self._conf.getRegistrationForm().getSocialEventForm().getTitle()
            if not self._conf.getRegistrationForm().getSocialEventForm().isEnabled():
                tit = '%s <span style="color:red;font-size: 75%%">(disabled)</span>' % tit
            columns["SocialEvents"] = tit
            tit = self._conf.getRegistrationForm().getReasonParticipationForm().getTitle()
github indico / indico / indico / MaKaC / webinterface / pages / contributions.py View on Github external
if not self._contrib.getConference().getAbstractMgr().isActive() or not self._contrib.getConference().hasEnabledSection("cfa"):
            return ""
        abs = self._contrib.getAbstract()
        if abs is not None:
            html = i18nformat("""
             
                <span class="dataCaptionFormat"> _("Abstract")</span>
                <a href="%s">%s - %s</a>
            
            
                &nbsp;
            
                """) % (quoteattr(str(urlHandlers.UHAbstractManagment.getURL(abs))),
                        self.htmlText(abs.getId()), abs.getTitle())
        else:
            html = i18nformat("""
             
                <span class="dataCaptionFormat"> _("Abstract")</span>
                &nbsp;&nbsp;&nbsp;<font color="red"> _("The abstract associated with this contribution has been removed")</font>
            
            
                &nbsp;
            
                """)
        return html
github indico / indico / indico / MaKaC / webinterface / pages / registrants.py View on Github external
def _getAccommodationHTML(self):
        regForm = self._conf.getRegistrationForm()
        if regForm.getAccommodationForm().isEnabled():
            accommodation = self._registrant.getAccommodation()
            accoType =   i18nformat("""<font color="\&quot;red\&quot;">--_("not selected")--</font>""")
            cancelled = ""
            if accommodation is not None and accommodation.getAccommodationType() is not None:
                accoType = accommodation.getAccommodationType().getCaption()
                if accommodation.getAccommodationType().isCancelled():
                    cancelled =  i18nformat("""<font color="\&quot;red\&quot;"> _("(disabled)")</font>""")
            arrivalDate =  i18nformat("""<font color="\&quot;red\&quot;">--_("not selected")--</font>""")
            if accommodation is not None and accommodation.getArrivalDate() is not None:
                arrivalDate = accommodation.getArrivalDate().strftime("%d-%B-%Y")
            departureDate =  i18nformat("""<font color="\&quot;red\&quot;">--_("not selected")--</font>""")
            if accommodation is not None and accommodation.getDepartureDate() is not None:
                departureDate = accommodation.getDepartureDate().strftime("%d-%B-%Y")
            text =  i18nformat("""
                        <table>
                          <tbody><tr>
                            <td align="right"><b> _("Arrival date"):</b></td>
                            <td align="left">%s</td>
                          </tr>
                          <tr>
                            <td align="right"><b> _("Departure date"):</b></td>
                            <td align="left">%s</td>
                          </tr>
                          <tr></tr></tbody></table>
github indico / indico / indico / MaKaC / webinterface / pages / registrationForm.py View on Github external
def _getSessionsHTML(self):
        regForm = self._conf.getRegistrationForm()
        sessions = self._registrant.getSessionList()
        if regForm.getSessionsForm().isEnabled():
            if regForm.getSessionsForm().getType() == "2priorities":
                session1 = i18nformat("""<span class="not-selected">_("Not selected")</span>""")
                session2 = i18nformat("""<span class="not-selected">_("Not selected")</span>""")
                if len(sessions) &gt; 0:
                    session1 = sessions[0].getTitle()
                    if sessions[0].isCancelled():
                        session1 = i18nformat("""%s <span class="not-selected">(_("Cancelled"))</span>""") % session1
                if len(sessions) &gt; 1:
                    session2 = sessions[1].getTitle()
                    if sessions[1].isCancelled():
                        session2 = i18nformat("""%s <span class="not-selected">(_("Cancelled"))</span>""") % session2
                text = i18nformat("""
                        <table>
                          <tbody><tr>
                            <td class="regform-done-caption">_("Preferred choice")</td>
                            <td class="regform-done-data">%s</td>
                          </tr>
                          <tr>
                            <td class="regform-done-caption">_("Secondary choice")</td>
                            <td class="regform-done-data">%s</td>
                          </tr>
                        </tbody></table>
                        """) % (session1, session2)
                return _("""
                        
                          %s
                        
github indico / indico / indico / MaKaC / webinterface / pages / tasks.py View on Github external
def _getCommentsList(self, task):
        keys = task.getCommentHistory().keys()
        keys.sort()
        #raise "%s"%keys
        out = i18nformat("""
        """)
        html = []
        
        for k in keys :
            c = task.getCommentHistory()[k]
            tz = DisplayTZ(self._aw,None,useServerTZ=1).getDisplayTZ()
            date = "%s"%c.getCreationDate().astimezone(timezone(tz))
            text = """
            <table width="100%">
            <tbody><tr>
                <td width="22%"><span class="titleCellFormat">&nbsp; _("Date")</span></td>
                <td width="50%"><span class="titleCellFormat">&nbsp; _("Text")</span></td>
                <td width="28%"><span class="titleCellFormat">&nbsp; _("Author")</span></td>
            </tr><tr>
                <td width="2%%">%s</td>
                <td width="50%%">%s</td></tr></tbody></table>
github indico / indico / indico / MaKaC / webinterface / pages / registrants.py View on Github external
sessform = self._regForm.getSessionsForm()
        sesstypes = sessform.getSessionList()
        checked = ""
        if self._filterCrit.getField(self._sessionFilterName).getShowNoValue():
            checked = " checked"
        res = [i18nformat("""<input value="--none--" name="sessionShowNoValue" type="checkbox"> --_("not specified")--""")%checked]
        for sess in sesstypes:
            checked = ""
            if sess.getId() in self._filterCrit.getField(self._sessionFilterName).getValues():
                checked = " checked"
            res.append("""<input value="%s%s" name="session" type="checkbox">%s""" % (quoteattr(str(sess.getId())), checked, self.htmlText(sess.getTitle())))
        if sessform.getType() == "2priorities":
            checked = ""
            if self._sessionFilterName == "sessionfirstpriority":
                checked = " checked"
            res.append(i18nformat("""<b>------</b><br><input value="firstChoice" name="firstChoice" type="checkbox"><i> _("Only by first choice") </i>""") % checked)
        return "<br>".join(res)
github indico / indico / indico / MaKaC / webinterface / pages / registrants.py View on Github external
def _getSessionsHTML(self):
        regForm = self._conf.getRegistrationForm()
        sessions = self._registrant.getSessionList()
        if regForm.getSessionsForm().isEnabled():
            if regForm.getSessionsForm().getType() == "2priorities":
                session1 =  i18nformat("""<font color="\&quot;red\&quot;">--  _("not selected") --</font>""")
                session2 =  i18nformat("""--  _("not selected") --""")
                if len(sessions) &gt; 0:
                    session1 = sessions[0].getTitle()
                    if sessions[0].isCancelled():
                        session1 =  i18nformat("""%s <font color="\&quot;red\&quot;">( _("cancelled") )""")%session1
                if len(sessions) &gt; 1:
                    session2 = sessions[1].getTitle()
                    if sessions[1].isCancelled():
                        session2 =  i18nformat("""%s <font color="\&quot;red\&quot;"> ( _("cancelled") )""")%session2
                text=  i18nformat("""
                        <table>
                          <tbody><tr>
                            <td align="right"><b> _("First Priority"):</b></td>
                            <td align="left">%s</td>
                          </tr>
                          <tr>
                            <td align="right"><b> _("Other option"):</b></td>
                            <td align="left">%s</td>
                          </tr>
                        </tbody></table>
                        """)%(session1, session2)</font></font>
github indico / indico / indico / MaKaC / webinterface / pages / abstracts.py View on Github external
html,
                quoteattr(str(url)),
                self.htmlText(original.getId()),
                self.htmlText(original.getTitle()),
                respPerson,
                getAdjustedDate(status.getDate(), tz=tz).strftime("%d %B %Y %H:%M")
            )
            if status.getComments() != "":
                html = """%s<br><font size="-1"><i>%s</i></font>""" % (
                    html,
                    status.getComments()
                )
        elif status.__class__ == review.AbstractStatusMerged:
            target = status.getTargetAbstract()
            url = urlHandlers.UHAbstractManagment.getURL(target)
            html = i18nformat("""<font color="black"><b>%s</b></font> (<a href="%s">%s-<i>%s</i></a>) <font size="-1">%s _("on") %s</font>""") % (
                html,
                quoteattr(str(url)),
                self.htmlText(target.getId()),
                self.htmlText(target.getTitle()),
                respPerson,
                getAdjustedDate(status.getDate(), tz=tz).strftime("%d %B %Y %H:%M")
            )
            if status.getComments() != "":
                html = """%s<br><font size="-1"><i>%s</i></font>""" % (
                    html,
                    status.getComments()
                )
        return html
github indico / indico / indico / MaKaC / webinterface / pages / sessions.py View on Github external
def _getTypeItemsHTML(self):
        checked=""
        if self._filterCrit.getField("type").getShowNoValue():
            checked=" checked"
        res=[ i18nformat("""<input value="--none--" name="typeShowNoValue" type="checkbox">--_("not specified")--""")%checked]
        for t in self._conf.getContribTypeList():
            checked=""
            if t.getId() in self._filterCrit.getField("type").getValues():
                checked=" checked"
            res.append("""<input value="%s%s" name="types" type="checkbox"> %s"""%(quoteattr(str(t.getId())),checked,self.htmlText(t.getName())))
        return "<br>".join(res)