svn commit: r1567849 [17/17] - in /bloodhound/vendor/trac: 1.0-stable/ current/ current/contrib/ current/contrib/cgi-bin/ current/contrib/workflow/ current/doc/ current/doc/utils/ current/sample-plugi

2014-02-12 Thread rjollos
Modified: 
bloodhound/vendor/trac/current/tracopt/versioncontrol/svn/tests/svn_fs.py
URL: 
http://svn.apache.org/viewvc/bloodhound/vendor/trac/current/tracopt/versioncontrol/svn/tests/svn_fs.py?rev=1567849&r1=1567848&r2=1567849&view=diff
==
--- bloodhound/vendor/trac/current/tracopt/versioncontrol/svn/tests/svn_fs.py 
(original)
+++ bloodhound/vendor/trac/current/tracopt/versioncontrol/svn/tests/svn_fs.py 
Thu Feb 13 05:08:02 2014
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C)2005-2009 Edgewall Software
+# Copyright (C) 2005-2013 Edgewall Software
 # Copyright (C) 2005 Christopher Lenz 
 # All rights reserved.
 #
@@ -31,6 +31,7 @@ except ImportError:
 has_svn = False
 
 from trac.test import EnvironmentStub, TestSetup
+from trac.tests import compat
 from trac.core import TracError
 from trac.resource import Resource, resource_exists
 from trac.util.concurrency import get_thread_id
@@ -41,9 +42,12 @@ from tracopt.versioncontrol.svn import s
 
 REPOS_PATH = os.path.join(tempfile.gettempdir(), 'trac-svnrepos')
 REPOS_NAME = 'repo'
+URL = 'svn://test'
 
-HEAD = 22
-TETE = 21
+HEAD = 28
+TETE = 26
+
+NATIVE_EOL = '\r\n' if os.name == 'nt' else '\n'
 
 
 class SubversionRepositoryTestSetup(TestSetup):
@@ -85,14 +89,14 @@ class NormalTests(object):
 
 def test_resource_exists(self):
 repos = Resource('repository', REPOS_NAME)
-self.assertEqual(True, resource_exists(self.env, repos))
-self.assertEqual(False, resource_exists(self.env, repos(id='xxx')))
+self.assertTrue(resource_exists(self.env, repos))
+self.assertFalse(resource_exists(self.env, repos(id='xxx')))
 node = repos.child('source', u'tête')
-self.assertEqual(True, resource_exists(self.env, node))
-self.assertEqual(False, resource_exists(self.env, node(id='xxx')))
+self.assertTrue(resource_exists(self.env, node))
+self.assertFalse(resource_exists(self.env, node(id='xxx')))
 cset = repos.child('changeset', HEAD)
-self.assertEqual(True, resource_exists(self.env, cset))
-self.assertEqual(False, resource_exists(self.env, cset(id=123456)))
+self.assertTrue(resource_exists(self.env, cset))
+self.assertFalse(resource_exists(self.env, cset(id=123456)))
 
 def test_repos_normalize_path(self):
 self.assertEqual('/', self.repos.normalize_path('/'))
@@ -115,33 +119,32 @@ class NormalTests(object):
 
 def test_rev_navigation(self):
 self.assertEqual(1, self.repos.oldest_rev)
-self.assertEqual(None, self.repos.previous_rev(0))
-self.assertEqual(None, self.repos.previous_rev(1))
+self.assertIsNone(self.repos.previous_rev(0))
+self.assertIsNone(self.repos.previous_rev(1))
 self.assertEqual(HEAD, self.repos.youngest_rev)
 self.assertEqual(6, self.repos.next_rev(5))
 self.assertEqual(7, self.repos.next_rev(6))
 # ...
-self.assertEqual(None, self.repos.next_rev(HEAD))
+self.assertIsNone(self.repos.next_rev(HEAD))
 self.assertRaises(NoSuchChangeset, self.repos.normalize_rev, HEAD + 1)
 
 def test_rev_path_navigation(self):
 self.assertEqual(1, self.repos.oldest_rev)
-self.assertEqual(None, self.repos.previous_rev(0, u'tête'))
-self.assertEqual(None, self.repos.previous_rev(1, u'tête'))
+self.assertIsNone(self.repos.previous_rev(0, u'tête'))
+self.assertIsNone(self.repos.previous_rev(1, u'tête'))
 self.assertEqual(HEAD, self.repos.youngest_rev)
 self.assertEqual(6, self.repos.next_rev(5, u'tête'))
 self.assertEqual(13, self.repos.next_rev(6, u'tête'))
 # ...
-self.assertEqual(None, self.repos.next_rev(HEAD, u'tête'))
+self.assertIsNone(self.repos.next_rev(HEAD, u'tête'))
 # test accentuated characters
-self.assertEqual(None,
- self.repos.previous_rev(17, 
u'tête/R\xe9sum\xe9.txt'))
+self.assertIsNone(self.repos.previous_rev(17, 
u'tête/R\xe9sum\xe9.txt'))
 self.assertEqual(17, self.repos.next_rev(16, 
u'tête/R\xe9sum\xe9.txt'))
 
 def test_has_node(self):
-self.assertEqual(False, self.repos.has_node(u'/tête/dir1', 3))
-self.assertEqual(True, self.repos.has_node(u'/tête/dir1', 4))
-self.assertEqual(True, self.repos.has_node(u'/tête/dir1'))
+self.assertFalse(self.repos.has_node(u'/tête/dir1', 3))
+self.assertTrue(self.repos.has_node(u'/tête/dir1', 4))
+self.assertTrue(self.repos.has_node(u'/tête/dir1'))
 
 def test_get_node(self):
 node = self.repos.get_node(u'/tête')
@@ -150,7 +153,7 @@ class NormalTests(object):
 self.assertEqual(Node.DIRECTORY, node.kind)
 self.assertEqual(HEAD, node.rev)
 self.assertEqual(TETE, node.created_rev)
-self.assertEqual(datetime(2007, 4, 30, 17, 45, 26, 234375, utc)

[Apache Bloodhound] #756: Unhelpful errors from product-scoped commands in console admin

2014-02-12 Thread Apache Bloodhound
#756: Unhelpful errors from product-scoped commands in console admin
---+
 Reporter:  rjollos|  Owner:  nobody
 Type:  defect | Status:  new
 Priority:  major  |  Milestone:
Component:  multiproduct   |Version:
 Keywords:  console admin  |
---+
 For example, omitting the //owner// argument (which is currently required,
 but not after trac:#11344):
 {{{#!sh
 $ trac-admin $env product admin prod5 component add component5
 Error: Invalid arguments

 product admin  

 Execute admin (sub-)command upon product resources
 }}}

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 > > If translation consistency is important in the mainnav, we can remove
 the browser.label and tickets.label from the generated base.ini (and
 replace 'Browse Source' by 'Source' in the code if you think it is a
 better label).
 > >
 >
 > IMO that'd be nice .
 >

 Hum ok but it requires to manually add the 'Source' in the Trac catalog
 (currently only 'Browse Source' is there):
 - If the repo is connected/configured, it will look in bloodhound_theme
 catalog
 - If the repo is not connected/configured, it will look in Trac catalog

 I am a bit reluctant to modify Trac code or Trac catalog manually.
 So it seems that either we have a consistent mainnav translation with
 'Browse Source' or we keep 'Source' and it will be only translated when
 repo is connected/configured.

 Not very easy as it involves Trac...

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 Ah ah, I managed to reproduce the bug with a simple test case.

 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:
 {{{
 http://www.w3.org/1999/xhtml";
   xmlns:py="http://genshi.edgewall.org/";
   xmlns:i18n="http://genshi.edgewall.org/i18n";>
   
  
   No events reported
   
 for resource
   
   in the last daysback days since
   fromdate.
   This may happen if system is not configured correctly.
   Please contact your administrator if you think this is the case.
   
   
 
 }}}

 result:
 {{{
 http://www.w3.org/1999/xhtml";>
   
  No events reported
 for
   
 }}}

 Do you think that the problem is in Genshi or in Trac ?

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by olemis):

 Replying to [comment:74 SaintGermain]:
 > Ok then I see your point with the user-defined translation catalog.
 > But it becomes quite complex for this patch.
 >

 agreed ! that's why it's OT

 > Forcing the translation make only sense if the user is able to give its
 own user catalog, so I'd prefer to keep this code for later.
 >

 sure

 > As of now the 'Tickets' mainnav label is an anomaly because it is only
 by chance (because we use the same label as the default one)

 The default is View Tickets , btw . It's been shrunk in BH to make these
 feet in mobile UI

 [...]
 > So I'd propose to keep things as they are and plan the complete user-
 defined label translation for another patch instead of implementing only
 half the solution.
 >

 we could work on that direction for let's say [milestone:"Release 9"] ...

 > If translation consistency is important in the mainnav, we can remove
 the browser.label and tickets.label from the generated base.ini (and
 replace 'Browse Source' by 'Source' in the code if you think it is a
 better label).
 >

 IMO that'd be nice .

 [...]

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 Ok then I see your point with the user-defined translation catalog.
 But it becomes quite complex for this patch.

 Forcing the translation make only sense if the user is able to give its
 own user catalog, so I'd prefer to keep this code for later.

 As of now the 'Tickets' mainnav label is an anomaly because it is only by
 chance (because we use the same label as the default one) that it is
 translated (it's not a bug it's a feature ! ;-) ).
 So I'd propose to keep things as they are and plan the complete user-
 defined label translation for another patch instead of implementing only
 half the solution.

 If translation consistency is important in the mainnav, we can remove the
 browser.label and tickets.label from the generated base.ini (and replace
 'Browse Source' by 'Source' in the code if you think it is a better
 label).

 Would that be acceptable ?

 Thanks,

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


svn commit: r1567798 - in /bloodhound/vendor/trac/1.0-stable: ./ .tx/ contrib/ contrib/cgi-bin/ contrib/rpm/ contrib/workflow/ doc/ doc/api/ doc/dev/ doc/images/ doc/utils/ sample-plugins/ sample-plug

2014-02-12 Thread rjollos
Author: rjollos
Date: Wed Feb 12 23:24:56 2014
New Revision: 1567798

URL: http://svn.apache.org/r1567798
Log:
Code drop of trac 1.0-stable at r12502.


[This commit notification would consist of 143 parts, 
which exceeds the limit of 50 ones, so it was shortened to the summary.]


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by olemis):

 Replying to [comment:72 SaintGermain]:
 > Replying to [comment:71 olemis]:
 [...]
 > >
 > > {{{#!sh
 > >
 > > $ grep -nr "RepositoryAdmin" bloodhound_theme
 > > bloodhound_theme/bhtheme/theme.py:512:
 href=req.href.wiki('TracRepositoryAdmin')))
 > >
 > > }}}
 > >
 > > This is the line that's replacing mainnav item when repository is not
 activated . The issue I mention actually happens when repository is not
 configured and that link is displayed , so ... my point is let's translate
 the caption as `Source` rather than `Browse Source` , this will create an
 entry in bhtheme translations catalog for that string and we could prepare
 other parts so as to ensure label will be translated . Notice that
 translations are applied if repos is connected / configured .
 > >
 >
 > Just to be clear: replacing 'Browse Source' by 'Source' will not be
 enough to make it work.

 If you replace repos doc mainnav item caption with Source why bother
 adding it in trac.ini ?

 [...]
 > But one thing I don't get: why don't we just remove the browser.label
 and tickets.label from the generated base.ini (or at least make them as
 comment) ?
 >

 In the short term we could . In the long term we should be thinking about
 providing site-specific translations (like /templates and /htdocs) ...

 > I don't really see the point of using the exact same label as the
 default one, and forcing the translation.
 > Probablity is that if the use wants to override the label, he won't use
 the default one, so they won't be translated anyway.
 >
 
 ... but the user could compile their own translations include them in (...
 say ...) /path/to/trac/env/locale/fr/... and activate translations (...
 with an extra option for i18n in mainnav label)
 

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


svn commit: r1567795 - in /bloodhound/trunk/trac: contrib/ doc/utils/ sample-plugins/ sample-plugins/permissions/ trac/ trac/db/ trac/db/tests/ trac/search/ trac/tests/ trac/tests/functional/ trac/tic

2014-02-12 Thread rjollos
Author: rjollos
Date: Wed Feb 12 23:17:59 2014
New Revision: 1567795

URL: http://svn.apache.org/r1567795
Log:
0.8dev: Reverse merge [1566948] in `trac` directory. Equivalent changes were 
made in the Trac core and we want to avoid merge conflicts.

Modified:
bloodhound/trunk/trac/contrib/bugzilla2trac.py
bloodhound/trunk/trac/contrib/checkwiki.py
bloodhound/trunk/trac/contrib/sourceforge2trac.py
bloodhound/trunk/trac/doc/utils/runepydoc.py
bloodhound/trunk/trac/sample-plugins/permissions/public_wiki_policy.py
bloodhound/trunk/trac/sample-plugins/revision_links.py
bloodhound/trunk/trac/trac/attachment.py
bloodhound/trunk/trac/trac/db/pool.py
bloodhound/trunk/trac/trac/db/postgres_backend.py
bloodhound/trunk/trac/trac/db/tests/__init__.py
bloodhound/trunk/trac/trac/db/tests/functional.py
bloodhound/trunk/trac/trac/env.py
bloodhound/trunk/trac/trac/hooks.py
bloodhound/trunk/trac/trac/perm.py
bloodhound/trunk/trac/trac/resource.py
bloodhound/trunk/trac/trac/search/__init__.py
bloodhound/trunk/trac/trac/tests/core.py
bloodhound/trunk/trac/trac/tests/functional/compat.py
bloodhound/trunk/trac/trac/tests/functional/svntestenv.py
bloodhound/trunk/trac/trac/tests/resource.py
bloodhound/trunk/trac/trac/tests/wikisyntax.py
bloodhound/trunk/trac/trac/ticket/api.py
bloodhound/trunk/trac/trac/ticket/model.py
bloodhound/trunk/trac/trac/ticket/report.py
bloodhound/trunk/trac/trac/ticket/tests/batch.py
bloodhound/trunk/trac/trac/ticket/tests/wikisyntax.py
bloodhound/trunk/trac/trac/ticket/web_ui.py
bloodhound/trunk/trac/trac/timeline/api.py
bloodhound/trunk/trac/trac/upgrades/db18.py
bloodhound/trunk/trac/trac/upgrades/db6.py
bloodhound/trunk/trac/trac/util/dist.py
bloodhound/trunk/trac/trac/versioncontrol/tests/svn_authz.py
bloodhound/trunk/trac/trac/web/chrome.py
bloodhound/trunk/trac/trac/web/main.py
bloodhound/trunk/trac/trac/wiki/tests/wikisyntax.py
bloodhound/trunk/trac/tracopt/versioncontrol/svn/svn_fs.py

Modified: bloodhound/trunk/trac/contrib/bugzilla2trac.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/trac/contrib/bugzilla2trac.py?rev=1567795&r1=1567794&r2=1567795&view=diff
==
--- bloodhound/trunk/trac/contrib/bugzilla2trac.py (original)
+++ bloodhound/trunk/trac/contrib/bugzilla2trac.py Wed Feb 12 23:17:59 2014
@@ -243,7 +243,7 @@ class TracDatabase(object):
 self.loginNameCache = {}
 self.fieldNameCache = {}
 from trac.db.api import DatabaseManager
-self.using_postgres = \
+   self.using_postgres = \
 
DatabaseManager(self.env).connection_uri.startswith("postgres:")
 
 def hasTickets(self):
@@ -377,7 +377,7 @@ class TracDatabase(object):
 comment = value
 
 if PREFORMAT_COMMENTS:
-comment = '{{{\n%s\n}}}' % comment
+  comment = '{{{\n%s\n}}}' % comment
 
 if REPLACE_BUG_NO:
 if BUG_NO_RE.search(comment):
@@ -720,7 +720,7 @@ def convert(_db, _host, _user, _password
 ignore = True
 
 if ignore:
-continue
+continue
 
 trac.addTicketComment(ticket=bugid,
 time = desc['bug_when'],
@@ -824,19 +824,19 @@ def convert(_db, _host, _user, _password
 
 # Bugzilla splits large summary changes into two records.
 for oldChange in ticketChanges:
-if (field_name == "summary"
-and oldChange['field'] == ticketChange['field']
-and oldChange['time'] == ticketChange['time']
-and oldChange['author'] == ticketChange['author']):
-oldChange['oldvalue'] += " " + ticketChange['oldvalue']
-oldChange['newvalue'] += " " + ticketChange['newvalue']
-break
-# cc and attachments.isobsolete sometime appear
-# in different activities with same time
-if ((field_name == "cc" or field_name == 
"attachments.isobsolete") \
-and oldChange['time'] == ticketChange['time']):
-oldChange['newvalue'] += ", " + ticketChange['newvalue']
-break
+  if (field_name == "summary"
+  and oldChange['field'] == ticketChange['field']
+  and oldChange['time'] == ticketChange['time']
+  and oldChange['author'] == ticketChange['author']):
+  oldChange['oldvalue'] += " " + ticketChange['oldvalue']
+  oldChange['newvalue'] += " " + ticketChange['newvalue']
+  break
+  # cc and attachments.isobsolete sometime appear
+  # in different activities with same time
+  if ((field_name == "cc" or field_name == 
"attachments.isobsolete") \
+   

Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 Replying to [comment:71 olemis]:
 > IMO , these should be translated as well .
 > @rjollos : what do you think ?
 >

 Problem is that this code is in Trac.

 > > If you want to have the same result for 'Source', we have also to
 duplicate that code for 'Source' (except that in our case we don't want to
 change the href, we just want to replace 'Source' by its translation).
 > >
 >
 > We already have
 >
 > {{{#!sh
 >
 > $ grep -nr "RepositoryAdmin" bloodhound_theme
 > bloodhound_theme/bhtheme/theme.py:512:
 href=req.href.wiki('TracRepositoryAdmin')))
 >
 > }}}
 >
 > This is the line that's replacing mainnav item when repository is not
 activated . The issue I mention actually happens when repository is not
 configured and that link is displayed , so ... my point is let's translate
 the caption as `Source` rather than `Browse Source` , this will create an
 entry in bhtheme translations catalog for that string and we could prepare
 other parts so as to ensure label will be translated . Notice that
 translations are applied if repos is connected / configured .
 >

 Just to be clear: replacing 'Browse Source' by 'Source' will not be enough
 to make it work. You can try by using 'Browse Source' in base.ini and it
 won't be translated. We need additional code which will trigger even if
 repository is not configured to force the translation.
 But one thing I don't get: why don't we just remove the browser.label and
 tickets.label from the generated base.ini (or at least make them as
 comment) ?

 I don't really see the point of using the exact same label as the default
 one, and forcing the translation.
 Probablity is that if the use wants to override the label, he won't use
 the default one, so they won't be translated anyway.

 Or maybe I have missed something ?

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by olemis):

 Replying to [comment:70 SaintGermain]:
 > Replying to [comment:68 olemis]:
 [...]
 > >
 > > What about if a translation for ''Source'' is provided in the same
 catalog where ''Tickets'' is been translated ?
 > >
 >
 > I am not 100% sure but I think this is not the problem.
 >
 > In trac/web/chrome.py (see comment 64), label are retrieved and
 translated except if there is an overriding label in base.ini (for
 instance 'Tickets' and 'Source').
 > Bloodhound take the data as it is ('Ticket' and 'Source')

 IMO , these should be translated as well .
 @rjollos : what do you think ?

 > except for "Tickets" which got a special treatment (replace the href)
 which has a side result of translating 'Ticket' because we force the
 translation

 I see now .

 > If you want to have the same result for 'Source', we have also to
 duplicate that code for 'Source' (except that in our case we don't want to
 change the href, we just want to replace 'Source' by its translation).
 >

 We already have

 {{{#!sh

 $ grep -nr "RepositoryAdmin" bloodhound_theme
 bloodhound_theme/bhtheme/theme.py:512:
 href=req.href.wiki('TracRepositoryAdmin')))

 }}}

 This is the line that's replacing mainnav item when repository is not
 activated . The issue I mention actually happens when repository is not
 configured and that link is displayed , so ... my point is let's translate
 the caption as `Source` rather than `Browse Source` , this will create an
 entry in bhtheme translations catalog for that string and we could prepare
 other parts so as to ensure label will be translated . Notice that
 translations are applied if repos is connected / configured .

 [...]

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 Replying to [comment:68 olemis]:
 > Replying to [comment:66 SaintGermain]:
 > > For the forced translation of the 'Source' tab in the mainnav.
 > > Basically I have the genshi.builder.Element:
 > > Source
 > >
 > > And I would like to replace the 'Source' with the translation.
 > >
 > > it seems that I can do something like:
 > > {{{#!python
 > > label = element.generate() |
 genshi.filters.transform.Transformer().select('a/text()')
 > > element.generate() |
 genshi.filters.transform.Transformer('a/text()').replace(gettext(label))
 > > }}}
 > >
 > > What do you think ?
 >
 > I do not recommend doing so . This is filtering the Genshi template
 stream and that has a substantial performance impact just to change a
 label that apparently should be translated somehow (e.g. see Tickets) .
 >
 > > It doesn't look very nice but I haven't found any other simpler way.
 > >
 >
 > What about if a translation for ''Source'' is provided in the same
 catalog where ''Tickets'' is been translated ?
 >

 I am not 100% sure but I think this is not the problem.

 In trac/web/chrome.py (see comment 64), label are retrieved and translated
 except if there is an overriding label in base.ini (for instance 'Tickets'
 and 'Source').
 Bloodhound take the data as it is ('Ticket' and 'Source') except for
 "Tickets" which got a special treatment (replace the href) which has a
 side result of translating 'Ticket' because we force the translation:
 {{{#!python
 if item['name'] == 'tickets':
 item['label'] = tag.a(_(self.mainnav_label),
 href=req.href.dashboard())
 }}}
 If you want to have the same result for 'Source', we have also to
 duplicate that code for 'Source' (except that in our case we don't want to
 change the href, we just want to replace 'Source' by its translation).

 It is my interpretation (I can be wrong). I can use a regexp to replace
 the 'Source' if you think it will be more efficient than genshi filters ?

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by SaintGermain):

 Replying to [comment:67 olemis]:
 > > There is some bug on my machine : my translation stops after "No
 events reported" (like your second pictures). However in your third
 picture, the end of the sentence appears !
 > > If I remove the "py:if" and the "em" inside the "i18n:msg", I can make
 part of the sentence appear and disappear.
 > > I am at complete lost on how to solve this ? Perhaps you remember what
 you have done on your third picture to make the whole sentence appear ?
 >
 > I did nothing special , except recompiling the catalogs maybe .

 The problem is either in Babel or Genshi (i.e. the missing part of the
 sentence does not appear in the generated HTML). Won't be easy to fix
 that. I'll try to build a small example to make it easier to debug.

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by olemis):

 Replying to [comment:66 SaintGermain]:
 > For the forced translation of the 'Source' tab in the mainnav.
 > Basically I have the genshi.builder.Element:
 > Source
 >
 > And I would like to replace the 'Source' with the translation.
 >
 > it seems that I can do something like:
 > {{{#!python
 > label = element.generate() |
 genshi.filters.transform.Transformer().select('a/text()')
 > element.generate() |
 genshi.filters.transform.Transformer('a/text()').replace(gettext(label))
 > }}}
 >
 > What do you think ?

 I do not recommend doing so . This is filtering the Genshi template stream
 and that has a substantial performance impact just to change a label that
 apparently should be translated somehow (e.g. see Tickets) .

 > It doesn't look very nice but I haven't found any other simpler way.
 >

 What about if a translation for ''Source'' is provided in the same catalog
 where ''Tickets'' is been translated ?

 > I am almost there to commit the patch ;-)

 ;)

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #694: Translations scaffolding

2014-02-12 Thread Apache Bloodhound
#694: Translations scaffolding
+--
  Reporter:  olemis |  Owner:  olemis
  Type:  task   | Status:  assigned
  Priority:  minor  |  Milestone:
 Component:  trac core  |Version:  0.7.0
Resolution: |   Keywords:  i18n
+--

Comment (by olemis):

 Replying to [comment:65 SaintGermain]:
 > Hello Olemis !
 >

 hi !

 [...]
 >
 > However the "Warning" at the end in the "py:with" is not translated and
 I don't know how to mark a variable like this to be translated.
 >

 I have tried a few things today without success .

 > There is some bug on my machine : my translation stops after "No events
 reported" (like your second pictures). However in your third picture, the
 end of the sentence appears !
 > If I remove the "py:if" and the "em" inside the "i18n:msg", I can make
 part of the sentence appear and disappear.
 > I am at complete lost on how to solve this ? Perhaps you remember what
 you have done on your third picture to make the whole sentence appear ?

 I did nothing special , except recompiling the catalogs .

-- 
Ticket URL: 
Apache Bloodhound 
The Apache Bloodhound issue tracker