Re: [pgadmin-hackers] Second l10n patch

2009-08-03 Thread Dave Page
2009/8/1 Marek Černocký ma...@manet.cz:
 Hi,

 I send patch. It solves translation for object type names in reports.

Should code like this use wxPLURAL?

int section = report-XmlCreateSection(wxString::Format(_(%s
dependents), object-GetTranslatedTypeName().c_str()));


-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Second l10n patch

2009-08-03 Thread Guillaume Lelarge
Le lundi 3 août 2009 à 12:33:56, Guillaume Lelarge a écrit :
 Le lundi 3 août 2009 à 11:57:02, Dave Page a écrit :
  2009/8/1 Marek Černocký ma...@manet.cz:
   Hi,
  
   I send patch. It solves translation for object type names in reports.
 
  Should code like this use wxPLURAL?
 
  int section = report-XmlCreateSection(wxString::Format(_(%s
  dependents), object-GetTranslatedTypeName().c_str()));

 No. We need wxPLURAL when we have a variable that tells us if it is plural
 or not. In this code, there's nothing that gives us a hint about it.

 Note that I didn't actually try this patch. Only read it.

Just tried it, and it works the way I think it should. I can commit it if you 
want.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Second l10n patch

2009-08-03 Thread Dave Page
2009/8/3 Guillaume Lelarge guilla...@lelarge.info:
 Le lundi 3 août 2009 à 12:33:56, Guillaume Lelarge a écrit :
 Le lundi 3 août 2009 à 11:57:02, Dave Page a écrit :
  2009/8/1 Marek Černocký ma...@manet.cz:
   Hi,
  
   I send patch. It solves translation for object type names in reports.
 
  Should code like this use wxPLURAL?
 
  int section = report-XmlCreateSection(wxString::Format(_(%s
  dependents), object-GetTranslatedTypeName().c_str()));

 No. We need wxPLURAL when we have a variable that tells us if it is plural
 or not. In this code, there's nothing that gives us a hint about it.

 Note that I didn't actually try this patch. Only read it.

 Just tried it, and it works the way I think it should. I can commit it if you
 want.

Sure - thanks.


-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Second l10n patch

2009-08-03 Thread Guillaume Lelarge
Le lundi 3 août 2009 à 11:57:02, Dave Page a écrit :
 2009/8/1 Marek Černocký ma...@manet.cz:
  Hi,
 
  I send patch. It solves translation for object type names in reports.

 Should code like this use wxPLURAL?

 int section = report-XmlCreateSection(wxString::Format(_(%s
 dependents), object-GetTranslatedTypeName().c_str()));

No. We need wxPLURAL when we have a variable that tells us if it is plural or 
not. In this code, there's nothing that gives us a hint about it.

Note that I didn't actually try this patch. Only read it.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Second l10n patch

2009-08-03 Thread Guillaume Lelarge
Le lundi 3 août 2009 à 13:04:34, Dave Page a écrit :
 2009/8/3 Guillaume Lelarge guilla...@lelarge.info:
  Le lundi 3 août 2009 à 12:33:56, Guillaume Lelarge a écrit :
  Le lundi 3 août 2009 à 11:57:02, Dave Page a écrit :
   2009/8/1 Marek Černocký ma...@manet.cz:
Hi,
   
I send patch. It solves translation for object type names in
reports.
  
   Should code like this use wxPLURAL?
  
   int section = report-XmlCreateSection(wxString::Format(_(%s
   dependents), object-GetTranslatedTypeName().c_str()));
 
  No. We need wxPLURAL when we have a variable that tells us if it is
  plural or not. In this code, there's nothing that gives us a hint about
  it.
 
  Note that I didn't actually try this patch. Only read it.
 
  Just tried it, and it works the way I think it should. I can commit it if
  you want.

 Sure - thanks.

Done. Sorry for the two commits, I forgot the CHANGELOG file.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Second l10n patch

2009-08-01 Thread Marek Černocký
Hi,

I send patch. It solves translation for object type names in reports.

Regards

Marek

diff --recursive -c pgadmin3.svn/pgadmin/frm/frmReport.cpp pgadmin3.new/pgadmin/frm/frmReport.cpp
*** pgadmin3.svn/pgadmin/frm/frmReport.cpp	2009-08-01 16:52:58.0 +0200
--- pgadmin3.new/pgadmin/frm/frmReport.cpp	2009-08-01 18:51:54.0 +0200
***
*** 1199,1208 
  void reportObjectPropertiesFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s properties report - %s), object-GetTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(object-GetTypeName() + _( properties));
  
  ctlListView *list = GetFrmMain()-GetProperties();
  object-ShowProperties();
--- 1199,1208 
  void reportObjectPropertiesFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s properties report - %s), object-GetTranslatedTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(wxString::Format(_(%s properties), object-GetTranslatedTypeName().c_str()));
  
  ctlListView *list = GetFrmMain()-GetProperties();
  object-ShowProperties();
***
*** 1236,1245 
  void reportObjectDdlFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s DDL report - %s), object-GetTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(object-GetTypeName() + _( DDL));
  
  report-XmlSetSectionSql(section, object-GetSql(NULL));
  }
--- 1236,1245 
  void reportObjectDdlFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s DDL report - %s), object-GetTranslatedTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(wxString::Format(_(%s DDL), object-GetTranslatedTypeName().c_str()));
  
  report-XmlSetSectionSql(section, object-GetSql(NULL));
  }
***
*** 1271,1277 
  pgTable *table = (pgTable *)object;
  
  wxString title;
! title.Printf(_(%s Data dictionary report - %s), object-GetTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
  // Columns
--- 1271,1277 
  pgTable *table = (pgTable *)object;
  
  wxString title;
! title.Printf(_(%s Data dictionary report - %s), object-GetTranslatedTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
  // Columns
***
*** 1416,1425 
  void reportObjectStatisticsFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s statistics report - %s), object-GetTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(object-GetTypeName() + _( statistics));
  
  ctlListView *list = GetFrmMain()-GetStatisticsCtl();
  object-ShowStatistics(GetFrmMain(), list);
--- 1416,1425 
  void reportObjectStatisticsFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s statistics report - %s), object-GetTranslatedTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(wxString::Format(_(%s statistics), object-GetTranslatedTypeName().c_str()));
  
  ctlListView *list = GetFrmMain()-GetStatisticsCtl();
  object-ShowStatistics(GetFrmMain(), list);
***
*** 1451,1460 
  void reportObjectDependenciesFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s dependencies report - %s), object-GetTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(object-GetTypeName() + _( dependencies));
  ctlListView *list = GetFrmMain()-GetDependenciesCtl();
  object-ShowDependencies(parent, list);
  
--- 1451,1461 
  void reportObjectDependenciesFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
! title.Printf(_(%s dependencies report - %s), object-GetTranslatedTypeName().c_str(), object-GetIdentifier().c_str());
  report-SetReportTitle(title);
  
! int section = report-XmlCreateSection(wxString::Format(_(%s dependencies), object-GetTranslatedTypeName().c_str()));
! 
  ctlListView *list = GetFrmMain()-GetDependenciesCtl();
  object-ShowDependencies(parent, list);
  
***
*** 1485,1494 
  void reportObjectDependentsFactory::GenerateReport(frmReport *report, pgObject *object)
  {
  wxString title;
!