[MonoDevelop] MonoDevelop Gettext support

Michael Hutchinson m.j.hutchinson at gmail.com
Sun May 11 18:34:20 EDT 2008


2008/5/11 Ivan Vucica <ivucica at gmail.com>:
> Hi all,
>
>  I'm attempting to translate the C++ project using MonoDevelop's
>  translation GUI. However, it does not detect any strings within my
>  .cpp files. It has successfully detected C# strings surrounded with
>  GettextCatalog.GetString(), but not C[++] strings surrounded by
>  gettext().
>
>  I have lines such as these in gm_mainmenu.cpp:
>
>  m_mainmenu.addItem(gettext("New Standard Game"), standardGame);
>  m_mainmenu.addItem(gettext("New Singularity Game"), singularityGame);
>
>
>  Does MonoDevelop's Gettext Translation Addin support C++ projects? If
>  not, are there any plans to add such support? When will it happen?

It should be pretty easy to add, as the scanner will be near-identical
to the C# one, which is based on regexes. Take a look at the end of
http://anonsvn.mono-project.com/viewcvs/trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml?view=markup

The escaping is another thing that might have to be tweaked, and that's in
http://anonsvn.mono-project.com/viewcvs/trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs?view=markup

>  Is there a way to force some strings into the translation GUI without
>  using the built-in project scanner?

As a workaround, add a .cs file in a "dummy" project with the
equivalent gettext calls, and set it not to compile (so it doesn't
even have to be valid C#) but *do* set it to be scanned.

It'd make sense to have a file containing extra strings for situations
like this. Could you file a feature request in our bugzilla?


-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list