← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1583757] Re: multiline blocktrans in django templates should use 'trimmed' option

 

Reviewed:  https://review.openstack.org/318896
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=926a4513ea2cd3243567bf7f0e265f92a092e61e
Submitter: Jenkins
Branch:    master

commit 926a4513ea2cd3243567bf7f0e265f92a092e61e
Author: Akihiro Motoki <amotoki@xxxxxxxxx>
Date:   Fri May 20 04:27:35 2016 +0900

    Use 'trimmed' for blocktrans with multi-line contents
    
    blocktrans trimmed option removes newlines from contents of blocktrans
    and replaces any whitespace at the beginning and end of a line into
    a single space. This makes translator life easier.
    More detail is described in the bug report.
    
    Closes-Bug: #1583757
    Depends-On: I534895be0d5f4bf0429b1511ee5421991386c873
    Change-Id: Idb451b7688fd5533a8315399de13bac8b8078a67


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1583757

Title:
  multiline blocktrans in django templates should use 'trimmed' option

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  Django templates support 'trimmed' option [1]. remove newline
  characters from the beginning and the end of the content of the {%
  blocktrans %} tag, replace any whitespace at the beginning and end of
  a line and merge all lines into one using a space character to
  separate them.

  Without 'trimmed' option, translators will get source strings with
  meaningless newlines and whitespaces like below. Zanata (translation
  check site) checks the number of newlines, so translators need to
  insert newlines to silent Zanata validations. It is really annoying
  and meaningless.

    #: openstack_dashboard/dashboards/admin/volumes/templates/volumes/snapshots/_update_status.html:10
    msgid ""
    "\n"
    "    The status of a volume snapshot is normally managed automatically.  "
    "In some circumstances\n"
    "    an administrator may need to explicitly update the status value. This"
    " is equivalent to\n"
    "    the <tt>cinder snapshot-reset-state</tt> command.\n"
    "    "
    msgstr ""

  By using 'trimmed' option in Django templates, we can get rid of meaningless newlines in extracted message strings.
  The recent released version of django-bebal supports 'trimmed' option [2] and now we can move the situation forward.

  [1] https://docs.djangoproject.com/ja/1.9/topics/i18n/translation/#blocktrans-template-tag
  [2] https://github.com/python-babel/django-babel/commit/88b389381c0e269605311ae07029555b65a86bc5

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1583757/+subscriptions


References