Developer forums (C::B DEVELOPMENT STRICTLY!) > Compiler Framework Redesign

XML based compilers

<< < (39/41) > >>

gd_on:
Before the introduction of xml based compilers, it was possible to obtain localized strings for each compiler options. Now, with xml compilers, they only appear in english, even if I force the correct chain and it's translation to be in the .po (and .mo) file. May be the "name" parameter in the xml file should be treated somewhere with a _(...) and not with a _T(...) (or wxT(...)).
Is it possible to reintroduce this localization possibility?
Thanks

gd_on

Alpha:
Does this patch enable translation?

--- Code: ---Index: src/plugins/compilergcc/compilerXML.cpp
===================================================================
--- src/plugins/compilergcc/compilerXML.cpp (revision 9423)
+++ src/plugins/compilergcc/compilerXML.cpp (working copy)
@@ -15,7 +15,7 @@
 #include "compilerXML.h"
 
 CompilerXML::CompilerXML(const wxString& name, const wxString& ID, const wxString& file)
-    : Compiler(name, ID), m_fileName(file)
+    : Compiler(_(name), ID), m_fileName(file)
 {
     wxXmlDocument compiler;
     compiler.Load(m_fileName);

--- End code ---

gd_on:
I tried your patch but I obtain a compilation error :

--- Quote ---||=== Build: Compiler in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\compilergcc\compilerXML.cpp||In constructor 'CompilerXML::CompilerXML(const wxString&, const wxString&, const wxString&)':|
C:\wxWidgets-2.8.12\include\wx\wxchar.h|235|error: 'Lname' was not declared in this scope|
C:\wxWidgets-2.8.12\include\wx\cpp.h|17|note: in definition of macro 'wxCONCAT_HELPER'|
C:\wxWidgets-2.8.12\include\wx\intl.h|48|note: in expansion of macro 'wxT'|
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\compilergcc\compilerXML.cpp|18|note: in expansion of macro '_'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 4 second(s)) ===|

--- End quote ---

error at line 235 in wchar.h :

--- Code: ---233 #if wxUSE_UNICODE
234      /* use wxCONCAT_HELPER so that x could be expanded if it's a macro */
235     #define wxT(x) wxCONCAT_HELPER(L, x)
236 #else /* !Unicode */
237     #define wxT(x) x
238 #endif /* Unicode/!Unicode */

--- End code ---

maybe a missing header.

gd_on

osdt:

--- Quote from: gd_on on October 28, 2013, 10:39:07 am ---I tried your patch but I obtain a compilation error :

--- Quote ---...
C:\wxWidgets-2.8.12\include\wx\wxchar.h|235|error: 'Lname' was not declared in this scope|
...
--- End quote ---

--- End quote ---

The macro '_(name)' expands to 'Lname' for unicode builds. It's designed for quoted strings ("translate me") only.

@gd_on: do you really want to translate compiler names like 'GCC' ?

- osdt

gd_on:

--- Quote ---do you really want to translate compiler names like 'GCC' ?
--- End quote ---
No, I don't.
I simply want to translate options as they appear in compiler options, and more precisely in window "Global compiler settings", Compiler settings, Compiler flags tabs.
For example:
the string: Produce debugging symbols (displayed as Produce debugging symbols [-g])
will become in french: Produire des symboles de débogage (displayed as Produire des symboles de débogage [-g])

gd_on

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version