~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/doc/pofile.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-06 03:51:37 UTC
  • mfrom: (9893.10.5 trivial)
  • Revision ID: launchpad@pqm.canonical.com-20111006035137-j54bd2r1t41cnhjs
[r=sinzui][no-qa] Don't kill -9 the postmaster

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
We need a helper method to better display test results.
75
75
 
76
 
    >>> def print_potmsgsets(potmsgsets, pofile):
 
76
    >>> def print_potmsgsets(potmsgsets, pofile=None):
77
77
    ...     for potmsgset in potmsgsets:
78
78
    ...         singular = plural = None
79
79
    ...         translation = ""
86
86
    ...             if len(plural) > 20:
87
87
    ...                plural = plural[:17] + "..."
88
88
    ...         if pofile is not None:
89
 
    ...             message = potmsgset.getCurrentTranslation(
 
89
    ...             translation = potmsgset.getCurrentTranslation(
90
90
    ...                 pofile.potemplate, pofile.language,
91
 
    ...                 pofile.potemplate.translation_side)
92
 
    ...             if message is not None:
93
 
    ...                translation = message.translations[0]
 
91
    ...                 pofile.potemplate.translation_side).translations[0]
94
92
    ...             if len(translation) > 20:
95
93
    ...                 translation = translation[:17] + "..."
96
94
    ...         print "%2d. %-20s   %-20s   %-20s" % (
97
 
    ...             potmsgset.getSequence(pofile.potemplate),
98
 
    ...             singular, plural, translation)
 
95
    ...             potmsgset.sequence, singular, plural, translation)
99
96
 
100
97
 
101
98
getFullLanguageCode
134
131
    >>> found_potmsgsets.count()
135
132
    4
136
133
 
137
 
    >>> print_potmsgsets(found_potmsgsets, dummy_pofile)
 
134
    >>> print_potmsgsets(found_potmsgsets)
138
135
     7. contact's header:      None
139
136
    14. The location and ...   None
140
137
    15. %d contact             %d contacts
147
144
    >>> found_potmsgsets.count()
148
145
    4
149
146
 
150
 
    >>> print_potmsgsets(found_potmsgsets, dummy_pofile)
 
147
    >>> print_potmsgsets(found_potmsgsets)
151
148
     7. contact's header:      None
152
149
    14. The location and ...   None
153
150
    15. %d contact             %d contacts
160
157
    >>> found_potmsgsets.count()
161
158
    2
162
159
 
163
 
    >>> print_potmsgsets(found_potmsgsets, dummy_pofile)
 
160
    >>> print_potmsgsets(found_potmsgsets)
164
161
    15. %d contact             %d contacts
165
162
    16. Opening %d contac...   Opening %d contac...
166
163