Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(161)  |  Call(161)  |  Derive(0)  |  Import(0)
Add or update the message with the specified ID.

>>> catalog = Catalog()
>>> catalog.add(u'foo')
<Message ...>
>>> catalog[u'foo']
<Message u'foo' (flags: [])>

This method simply constructs a `Message` object with the given
arguments and invokes `__setitem__` with that object.(more...)

src/a/n/android2po-1.2.0/android2po/convert.py   android2po(Download)
 
                ctx = "%s:%d" % (name, index)
                catalog.add(item.text, item_trans, auto_comments=item.comments,
                            flags=flags, context=ctx)
 
            if formatted:
                flags.append('c-format')
            catalog.add(msgid, tuple(msgstr), flags=flags,
                        auto_comments=comments, context=name)
 
                flags.append('c-format')
 
            catalog.add(org_value.text, trans_value.text if trans_value else u'',
                        flags=flags, auto_comments=org_value.comments, context=name)
 

src/a/n/android2po-HEAD/android2po/convert.py   android2po(Download)
 
                ctx = "%s:%d" % (name, index)
                catalog.add(item.text, item_trans, auto_comments=item.comments,
                            flags=flags, context=ctx)
 
            if formatted:
                flags.append('c-format')
            catalog.add(msgid, tuple(msgstr), flags=flags,
                        auto_comments=comments, context=name)
 
                flags.append('c-format')
 
            catalog.add(org_value.text, trans_value.text if trans_value else u'',
                        flags=flags, auto_comments=org_value.comments, context=name)
 

src/o/p/openlibrary-HEAD/openlibrary/i18n/__init__.py   openlibrary(Download)
        extracted = extract_from_dir(d, METHODS, comment_tags=COMMENT_TAGS, strip_comment_tags=True)
        for filename, lineno, message, comments in extracted:
            catalog.add(message, None, [(filename, lineno)], auto_comments=comments)
 
    path = os.path.join(root, 'messages.pot')

src/f/i/FireCheckIn-HEAD/kay/management/extract_messages.py   FireCheckIn(Download)
 
  for filename, lineno, message, comments in extracted:
    catalog.add(message, None, [(strip_path(filename, root), lineno)],
                auto_comments=comments)
  if not i18n_dir:

src/k/a/kay-HEAD/kay/management/extract_messages.py   kay(Download)
 
  for filename, lineno, message, comments in extracted:
    catalog.add(message, None, [(strip_path(filename, root), lineno)],
                auto_comments=comments)
  if not i18n_dir:

src/a/n/android2po-1.2.0/tests/test_options.py   android2po(Download)
    def test(self):
        p = self.setup_project()
        c = Catalog(locale='de')
        c.add('en1', 'de1', flags=('fuzzy',), context='foo')
        c.add('en2', 'de2', context='bar')
    def test(self):
        p = self.setup_project()
 
        c = Catalog(locale='de')
        c.add('translated', 'value', context='translated')
        c.add('missing1', context='missing1')
        c.add('missing2', context='missing2')

src/a/n/android2po-HEAD/tests/test_options.py   android2po(Download)
    def test(self):
        p = self.setup_project()
        c = Catalog(locale='de')
        c.add('en1', 'de1', flags=('fuzzy',), context='foo')
        c.add('en2', 'de2', context='bar')
    def test(self):
        p = self.setup_project()
 
        c = Catalog(locale='de')
        c.add('translated', 'value', context='translated')
        c.add('missing1', context='missing1')
        c.add('missing2', context='missing2')

src/a/n/android2po-1.2.0/tests/convert/test_special.py   android2po(Download)
def test_invalid_xhtml():
    """Ensure we can deal with broken XML in messages.
    """
    c = Catalog()
    c.add('Foo', '<i>Tag is not closed', context="foo")
    """
    catalog = Catalog()
    catalog.add('green', context='color1')
    catalog.add('red', 'rot', context='color2')
    assert po2xml(catalog) == {'color2': 'rot'}

src/a/n/android2po-HEAD/tests/convert/test_special.py   android2po(Download)
def test_invalid_xhtml():
    """Ensure we can deal with broken XML in messages.
    """
    c = Catalog()
    c.add('Foo', '<i>Tag is not closed', context="foo")
    """
    catalog = Catalog()
    catalog.add('green', context='color1')
    catalog.add('red', 'rot', context='color2')
    assert po2xml(catalog) == {'color2': 'rot'}

src/a/n/android2po-1.2.0/tests/convert/test_text.py   android2po(Download)
        key = 'test'
        catalog = Catalog()
        catalog.add(po, po, context=key)
        warnfunc = TestWarnFunc()
        dom = write_xml(po2xml(catalog, warnfunc=warnfunc), warnfunc=warnfunc)

  1 | 2 | 3 | 4  Next