You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2014/02/15 22:48:31 UTC
[Apache Bloodhound] #758: Part of message not displayed after
translation
#758: Part of message not displayed after translation
--------------------------+----------------------
Reporter: SaintGermain | Owner: nobody
Type: defect | Status: new
Priority: minor | Milestone:
Component: dashboard | Version: 0.8.0dev
Keywords: i18n |
--------------------------+----------------------
Following translation scaffolding of ticket #694.
In file
bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
the usual translation scaffolding doesn't work.
Before translation scaffolding:
{{{#!python
<py:def function="timeline_empty()">
No events reported
<py:if test="context.resource.id">
for <em>${summary_of(context.resource)}</em>
</py:if>
in the last <em>$daysback</em> days since
<span class="date">${format_date(fromdate)}</span>.
This may happen if system is not configured correctly.
Please contact your administrator if you think this is the case.
</py:def>
}}}
After translation scaffolding:
{{{#!python
<py:def function="timeline_empty()">
<i18n:msg params="resource,daysback,fromdate">
No events reported
<py:if test="context.resource.id">
for <em>${summary_of(context.resource)}</em>
</py:if>
in the last <em>$daysback</em> days since
<span class="date">${format_date(fromdate)}</span>.
This may happen if system is not configured correctly.
Please contact your administrator if you think this is the case.
</i18n:msg>
</py:def>
}}}
Instead of the following message after translation:
{{{
No events reported for $resource in the last $daysback days since $date.
This may happen if system is not configured correctly. Please contact your
administrator if you think this is the case.
}}}
We got the truncated:
{{{
No events reported for
}}}
I managed to reproduce the bug with a simple test case.
Create the following files test.py and bug.html in the same directory and
execute test.py
test.py:
{{{#!python
from genshi.template import TemplateLoader, MarkupTemplate
from genshi.filters import Translator
from trac.util import translation
loader = TemplateLoader('.', callback=lambda template:
Translator(translation.get_translations()).setup(template))
template = loader.load('bug.html')
print(template.generate())
}}}
bug.html:
{{{
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n">
<p>
<i18n:msg params="resource,daysback,fromdate">
No events reported
<py:if test="1">
for <em>resource</em>
</py:if>
in the last <em>daysback</em> days since
<span class="date">fromdate</span>.
This may happen if system is not configured correctly.
Please contact your administrator if you think this is the case.
</i18n:msg>
</p>
</html>
}}}
result:
{{{
<html xmlns="http://www.w3.org/1999/xhtml">
<p>
No events reported
for
</p>
}}}
The problem is probably in Genshi, Babel or Trac.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/758>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #758: Part of message not displayed after
translation
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#758: Part of message not displayed after translation
---------------------------+----------------------
Reporter: SaintGermain | Owner: nobody
Type: defect | Status: new
Priority: minor | Milestone:
Component: dashboard | Version: 0.8.0dev
Resolution: | Keywords: i18n
---------------------------+----------------------
Comment (by rjollos):
It seems to have been a problem with my virtual environment.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/758#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #758: Part of message not displayed after
translation
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#758: Part of message not displayed after translation
---------------------------+----------------------
Reporter: SaintGermain | Owner: nobody
Type: defect | Status: new
Priority: minor | Milestone: next 0.x
Component: trac core | Version: 0.8.0dev
Resolution: | Keywords: i18n
---------------------------+----------------------
Changes (by rjollos):
* component: dashboard => trac core
* milestone: => next 0.x
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/758#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #758: Part of message not displayed after
translation
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#758: Part of message not displayed after translation
---------------------------+----------------------
Reporter: SaintGermain | Owner: nobody
Type: defect | Status: new
Priority: minor | Milestone:
Component: dashboard | Version: 0.8.0dev
Resolution: | Keywords: i18n
---------------------------+----------------------
Comment (by olemis):
Replying to [comment:2 rjollos]:
> It seems to have been a problem with my virtual environment.
good to know , I was looking for something wrong and honestly fund nothing
, except possibly some issue related to `babel` .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/758#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #758: Part of message not displayed after
translation
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#758: Part of message not displayed after translation
---------------------------+----------------------
Reporter: SaintGermain | Owner: nobody
Type: defect | Status: new
Priority: minor | Milestone:
Component: dashboard | Version: 0.8.0dev
Resolution: | Keywords: i18n
---------------------------+----------------------
Comment (by rjollos):
When I execute `extract_messages` in the `bloodhound_dashboard` project,
the messages from the templates are not extracted. Any idea why this is?
{{{#!pycon
user@ubuntu:~/Workspace/bhdev/bloodhound.git/bloodhound_dashboard$ python
setup.py extract_messages
running extract_messages
extracting messages from bhdashboard/__init__.py
extracting messages from bhdashboard/_json.py
extracting messages from bhdashboard/admin.py
extracting messages from bhdashboard/api.py
extracting messages from bhdashboard/macros.py
extracting messages from bhdashboard/model.py
extracting messages from bhdashboard/web_ui.py
extracting messages from bhdashboard/wiki.py
extracting messages from bhdashboard/layouts/__init__.py
extracting messages from bhdashboard/layouts/bootstrap.py
extracting messages from bhdashboard/tests/__init__.py
extracting messages from bhdashboard/tests/test_report.py
extracting messages from bhdashboard/tests/test_webui.py
extracting messages from bhdashboard/tests/widgets/__init__.py
extracting messages from bhdashboard/tests/widgets/timeline.py
extracting messages from bhdashboard/util/__init__.py
extracting messages from bhdashboard/util/translation.py
extracting messages from bhdashboard/util/widgets.py
extracting messages from bhdashboard/widgets/__init__.py
extracting messages from bhdashboard/widgets/containers.py
extracting messages from bhdashboard/widgets/product.py
extracting messages from bhdashboard/widgets/query.py
extracting messages from bhdashboard/widgets/report.py
extracting messages from bhdashboard/widgets/ticket.py
extracting messages from bhdashboard/widgets/timeline.py
writing PO template file to bhdashboard/locale/messages.pot
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/758#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker