carlxaeron / django-rosetta

Automatically exported from code.google.com/p/django-rosetta
MIT License
0 stars 0 forks source link

Comments in PO files #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The PO file format supports three kinds of comments: reference, 
extracted-comments, and translator-comments. polib parses them, but Rosetta is 
currently only showing references (occurrences in polib).

According to the specification, the extracted-comment should be read-only, and 
translator-comment should be an editable field. For our purposes, we need at 
least extracted-comments to work, which could be as simple as this:

Index: pofile.html
===================================================================
--- pofile.html (revision 174006)
+++ pofile.html (working copy)
@@ -56,6 +56,7 @@
                         <th>{{ rosetta_i18n_lang_name }}</th>
                         <th class="c">{% trans "Fuzzy" %}</th>
                         <th>{% trans "Occurrences(s)" %}</th>
+                        <th>{% trans "Comments" %}</th>
                     </tr>
                 </thead>
                 <tbody>
@@ -93,6 +94,9 @@
                                     <a href="#">&hellip; ({% blocktrans count message.occurrences|length|minus:"3" as more_count %}{{more_count}} more{% plural %}{{more_count}} more{% endblocktrans %})</a>
                                 {% endif %}
                             </td>
+                            <td>
+                              {{ message.comment|linebreaks }}
+                            </td>
                     </tr>
                     {% endfor %}
                 </tbody>

Rick

Original issue reported on code.google.com by alass...@gmail.com on 16 Aug 2010 at 3:41

GoogleCodeExporter commented 8 years ago
Follow up: I noticed that you're using javascript to hide occurrences if there 
are more than 3. There is a small problem with the code: in your CSS you made 
<code> elements blocks. But jQuery's show() sets display to inline using an 
element style, so the line breaks between the <code> elements are lost when you 
show them.

Original comment by alass...@gmail.com on 23 Aug 2010 at 3:52