Code::Blocks
July 29, 2010, 05:54:03 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Code::Blocks Logo Elections closed! And the winner is... otaco!
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: 1 ... 7 8 [9] 10
  Send this topic  |  Print  
Author Topic: Code::Blocks' translation  (Read 74681 times)
gd_on
Advanced newcomer
*
Posts: 118


« Reply #120 on: January 27, 2009, 09:42:05 am »

You are certainly right. These setting must not be translated here.

In the code, I think its in src/plugins/contrib/wxSmith/wxwidgets/wxsnewwindowdlg.cpp at lines 210, 212 or 214, they are initialized with the macro _, which means they can be translated, which is normal if it's used only to identify a button or something else to be displayed in the graphic user interface. Obviously, it's also used to generate code, and of course, it must not be translated. The author of this plugin should probably use here the macro _T and not _.
In the next French version, I will correct this (in fact do a workaround), simply by duplicating the English words in the French translation.

Thanks for having pointed this problem.

gd_on
Logged
MortenMacFly
Administrator
Lives here!
*****
Posts: 4593



WWW
« Reply #121 on: January 27, 2009, 11:06:39 am »

I think its in src/plugins/contrib/wxSmith/wxwidgets/wxsnewwindowdlg.cpp at lines 210, 212 or 214
This is not it. This code is in no way releated to the class wizard. Nevertheless - the line of code you are referring to is here:
classwizarddlg.cpp, line 321:
Code:
    m_AncestorScope    = XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->GetValue();
classwizarddlg.cpp, line 435-438:
Code:
    if (m_Inherits)
    {
        buffer << _T(" : ") << m_AncestorScope << _T(" ") << m_Ancestor;
    }
As you see: The name is obtained via XRC. In fact I have no idea why it gets translated...?!

BTW: I realised that the class wizard features certain dialogs (message boxes) without translation - but that's another story... Wink
Logged

Logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
Compiling help
Debugging help
Portable C::B
jens
Global Moderator
Lives here!
*****
Posts: 2975



WWW
« Reply #122 on: January 27, 2009, 11:43:24 am »

As you see: The name is obtained via XRC. In fact I have no idea why it gets translated...?!

Because the .xrc have been scanned  with wxrc to find textes to translate and they got translated.

The same happened for other keywords:

Quote
#: plugins_xrc.cpp:63
msgid "private"
msgstr "privé"

Quote
#: plugins_xrc.cpp:62
msgid "protected"
msgstr "protégé"

Quote
#: plugins_xrc.cpp:61
msgid "public"
msgstr "publique"

In the next French version, I will correct this (in fact do a workaround), simply by duplicating the English words in the French translation.

If I remember right, it should be enough to leave the translated part (msgstr) empty.

By the way, this one is much more dangerous, because it breaks layout saving and/or loading:
Quote
#: ../src/main.cpp:1238
#: ../src/main.cpp:1257
msgid "state=%d"
msgstr "État = %d"
Logged

Regards

Jens

debian - nightlies and wxWidgets (msw-)cross-build libs for "i386" and "amd64" : http://apt.jenslody.de/
C::B changelog: http://apt.jenslody.de/ChangeLog
MortenMacFly
Administrator
Lives here!
*****
Posts: 4593



WWW
« Reply #123 on: January 27, 2009, 11:51:41 am »

Because the .xrc have been scanned  with wxrc to find textes to translate and they got translated.
WTF... And I guess there is no way in a XRC file to exclude strings from translation, right?! Or can I use the _() and _T() macros there, too?!

In any ways: If I use e.g. xrced I don't see an option accordingly - so in practice it would mean hand crafted manipulation. Sad
Logged

Logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
Compiling help
Debugging help
Portable C::B
stahta01
Lives here!
****
Posts: 2379


WWW
« Reply #124 on: January 27, 2009, 02:04:55 pm »

Because the .xrc have been scanned  with wxrc to find textes to translate and they got translated.
WTF... And I guess there is no way in a XRC file to exclude strings from translation, right?! Or can I use the _() and _T() macros there, too?!

In any ways: If I use e.g. xrced I don't see an option accordingly - so in practice it would mean hand crafted manipulation. Sad

From http://biolpc22.york.ac.uk/wx/docs/html/faqcmn.htm#xrclocale
Quote
translate="0" attribute in XRC files
Turns it off for whole xrc file which might work sometime. But, most likely not all the time.
Tim S
Logged

C Programmer working to learn more about C++.
OS: Win 6.1 AKA Win7
Compiler: mingw gcc 4.4 API 3.13 Runtime 3.15.2
IDE: Code::Blocks SVN + patches
wxMSW: SVN 2.9 Trunk & SVN 2.8 branch
SVN: 1.6.x
gd_on
Advanced newcomer
*
Posts: 118


« Reply #125 on: January 27, 2009, 08:02:44 pm »

Quote
Quote
In the next French version, I will correct this (in fact do a workaround), simply by duplicating the English words in the French translation.

If I remember right, it should be enough to leave the translated part (msgstr) empty.

True, but I prefer to duplicate English words to be sure that these words have been intentionally put here (and intentionally not translated), and it's not something forgotten or a sentence I don't totally understand.

Quote
By the way, this one is much more dangerous, because it breaks layout saving and/or loading:
Quote
#: ../src/main.cpp:1238
#: ../src/main.cpp:1257
msgid "state=%d"
msgstr "État = %d"
I don't understand the exact problem. In /src/main the author make a difference between "state=" and "state=%d", using the macro _T for the first case and the macro _ for the second one. So I suppose he wants the second one to be translatable !

Also, it's true that when using wxrc to scan for translatable characters chains in xrc files, I find many many strings. A lot of them have to be translated, but a few ones don't need to. More, it could be an error to do so, as shown by this reported problem. But, how can I do ? Not obvious  Sad Sad

gd_on
Logged
gd_on
Advanced newcomer
*
Posts: 118


« Reply #126 on: January 28, 2009, 07:16:42 pm »

A few updates to the .pot file extracted from svn 5421 are here.
Translation in French, also updated from svn 5421 in the .po and .mo file is here.
Problems mentioned above about words "public, private, protected" are corrected (intentionally not translated).
No changes to the extracting tools. See previous posts here particularly or/and here.

gd_on
Logged
Xaviou
Almost regular
**
Posts: 183


WWW
« Reply #127 on: January 31, 2009, 10:51:16 am »

Hi

Problems mentioned above about words "public, private, protected" are corrected (intentionally not translated).
Works fine : thanks Wink

Nothing about the "Start here" page ?

Regards
Xav'
Logged

The french wxWidgets site : www.wxdev.fr
Xaviou
Almost regular
**
Posts: 183


WWW
« Reply #128 on: February 03, 2009, 11:26:47 pm »

@gd_on : Hey ! I've tested your extracting tool (extract.cmd) : it works fine !  Goog job !

@cb devs : I found a few "_T" to "_" macros replacements to improve Code::Blocks translations.
Do I have to :
  • put the correponding informations here (as a files and lines list) ?
  • submit a patch (I'm not used with that, but I think I'll find how to Wink ) ?
  • fill a bug report ? (I don't think this is a bug, but why not) ?

Regards
Xav'
Logged

The french wxWidgets site : www.wxdev.fr
MortenMacFly
Administrator
Lives here!
*****
Posts: 4593



WWW
« Reply #129 on: February 04, 2009, 08:44:41 am »

  • submit a patch (I'm not used with that, but I think I'll find how to Wink ) ?
That would be fine.
Logged

Logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
Compiling help
Debugging help
Portable C::B
Xaviou
Almost regular
**
Posts: 183


WWW
« Reply #130 on: February 05, 2009, 11:14:59 pm »

So, here is a first one : wasn't so hard to do as I thought Smile

A lot of things in this patch concern the ThreadSearch Plugin. It seems that the interface code whas been auto-generated by wxGlade, it's why it contains a lot of "wxT" instead of "_". I'm afraid that next update of this plugin will replace the corrected macros by the _T one.

Regards

Xav'

[attachment deleted by admin]
Logged

The french wxWidgets site : www.wxdev.fr
dje
Lives here!
****
Posts: 683


« Reply #131 on: February 05, 2009, 11:51:23 pm »

A lot of things in this patch concern the ThreadSearch Plugin. It seems that the interface code whas been auto-generated by wxGlade, it's why it contains a lot of "wxT" instead of "_". I'm afraid that next update of this plugin will replace the corrected macros by the _T one.
I'll see  Smile
I will apply a patch to spare place for small screen.
But my approach is to generate files in a temporary directory and then merge the graphical stuff so my code is not modified. That's why I think it should work, unless you propose a patch for this tool  Wink

Dje
Logged
Xaviou
Almost regular
**
Posts: 183


WWW
« Reply #132 on: March 05, 2009, 11:52:03 pm »

Hi.

Here is a patch for the translation of the "Start here" page.
Not sure it is the best way to do this, but it works...
Code:
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (révision 5480)
+++ src/src/main.cpp (copie de travail)
@@ -1861,7 +1861,7 @@
     wxString buf = event.GetString();
     wxString links;
 
-    links << _T("<b>Recent projects</b><br>\n");
+    links << _("<b>Recent projects</b><br>\n");
     if (m_pProjectsHistory->GetCount())
     {
         links << _T("<ul>");
@@ -1877,7 +1877,7 @@
     else
         links << _T("&nbsp;&nbsp;&nbsp;&nbsp;No recent projects<br>\n");
 
-    links << _T("<br><b>Recent files</b><br>\n");
+    links << _("<br><b>Recent files</b><br>\n");
     if (m_pFilesHistory->GetCount())
     {
         links << _T("<ul>");
@@ -1896,6 +1896,11 @@
 
     // update page
     buf.Replace(_T("CB_VAR_RECENT_FILES_AND_PROJECTS"), links);
+ buf.Replace(_T("CB_TXT_NEW_PROJECT"), _("Create a new project"));
+ buf.Replace(_T("CB_TXT_OPEN_PROJECT"), _("Open an existing project"));
+ buf.Replace(_T("CB_TXT_VISIT_FORUMS"), _("Visit the Code::Blocks forums"));
+ buf.Replace(_T("CB_TXT_REPORT_BUG"), _("Report a bug"));
+ buf.Replace(_T("CB_TXT_REQ_NEW_FEATURE"), _("Request a new feature"));
     ((StartHerePage*)sh)->SetPageContent(buf);
 }
 
Index: src/src/resources/start_here/start_here.html
===================================================================
--- src/src/resources/start_here/start_here.html (révision 5480)
+++ src/src/resources/start_here/start_here.html (copie de travail)
@@ -27,29 +27,27 @@
 <tr>
 <td><a href="CB_CMD_NEW_PROJECT"><img style=
 "width: 47px; height: 42px;" alt="" src="new.png"></a></td>
-<td><a href="CB_CMD_NEW_PROJECT">Create a new project</a></td>
+<td><a href="CB_CMD_NEW_PROJECT">CB_TXT_NEW_PROJECT</a></td>
 </tr>
 <tr>
 <td><a href="CB_CMD_OPEN_PROJECT"><img style=
 "width: 47px; height: 47px;" alt="" src="open.png"></a></td>
-<td><a href="CB_CMD_OPEN_PROJECT">Open an existing project</a></td>
+<td><a href="CB_CMD_OPEN_PROJECT">CB_TXT_OPEN_PROJECT</a></td>
 </tr>
 <tr>
 <td width="56" rowspan="4"><img alt="" src="www.png"></td>
 </tr>
 <tr>
-<td><a href="http://forums.codeblocks.org/">Visit the Code::Blocks
-forums</a></td>
+<td><a href="http://forums.codeblocks.org/">CB_TXT_VISIT_FORUMS</a></td>
 </tr>
 <tr>
 <td><a href=
-"http://developer.berlios.de/bugs/?func=addbug&amp;group_id=5358">Report
-a bug</a></td>
+"http://developer.berlios.de/bugs/?func=addbug&amp;group_id=5358">CB_TXT_REPORT_BUG</a></td>
 </tr>
 <tr>
 <td><a href=
 "http://developer.berlios.de/feature/?func=addfeature&amp;group_id=5358">
-Request a new feature</a></td>
+CB_TXT_REQ_NEW_FEATURE</a></td>
 </tr>
 </table>
 </td>

And here is a link to an archive containing the modified revision 5480 including the french language file (if someone is interested for testing) :
CB_20090304_rev5480_win32_fr.7z

Regards

Xav'

[attachment deleted by admin]
« Last Edit: March 06, 2009, 12:03:49 am by Xaviou » Logged

The french wxWidgets site : www.wxdev.fr
gd_on
Advanced newcomer
*
Posts: 118


« Reply #133 on: March 08, 2009, 06:54:50 pm »

A few updates to the .pot file extracted from svn 5481 are here.
Translation in French, also updated from svn 5481 in the .po and .mo file is here.
Works if Xaviou's patches for translation are installed (adding 2 missed items : file name and file path).
No changes to the extracting tools. See previous posts here particularly or/and here.

gd_on
« Last Edit: March 08, 2009, 06:57:12 pm by gd_on » Logged
GeO
Advanced newcomer
*
Posts: 40


« Reply #134 on: June 17, 2009, 05:51:11 pm »

Since the Class Wizard translation is still not fixed i wrote a little workaround that should work
with every language:
In src\plugins\classwizard\classwizarddlg.cpp on line 322 replace
Code:
m_AncestorScope    = XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->GetValue();
with this
Code:
int scope = XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->GetCurrentSelection();
switch (scope)
{
case 0:
    m_AncestorScope = _T("public");
    break;
case 1:
    m_AncestorScope = _T("protected");
    break;
case 2:
    m_AncestorScope = _T("private");
    break;

default:
    break;
}
Greets GeO
Logged
Pages: 1 ... 7 8 [9] 10
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!