def crop(text, width=_DEFAULT_WIDTH, suffix="[...]"):

    utext = to_unicode(text)
    ltext = len(utext)
    if ltext <= width:
        return text
    else:
        lsuffix = len(suffix)
        utext = utext[:width] if lsuffix >= width else "%s%s" % (utext[:width - lsuffix], suffix)
        return to_str(utext)
Update an existing translation in the DB with changes from VCS.
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/crop--crossover with--dataset/ETHPy150Open mozilla/pontoon/pontoon/sync/tests/test_changeset.py/ChangeSetTests.test_update_db_existing_translation