[MonoDevelop] Translation question

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Nov 28 15:18:48 EST 2009


On Sat, Nov 28, 2009 at 5:30 AM, Cyrille Colin <colin at univ-metz.fr> wrote:
> hi all,
> i would like to use Catalog.GetString() in inline code in that way :
>
> <H1><%= Catalog.GetString("Test") %></H1>
> this works, but the scan done by the translation project doesn't find
> it.
>
> And in that other case I have an Exception for "code render is not
> allowed here" :
> <asp:RadioButtonList id="fileType" runat="server">
>  <asp:ListItem><%= Catalog.GetString("Test") %></asp:ListItem>
>
> Do i need to used only codebehind, if someone could explain what's the
> best way to do it.

MD's gettext scanner extracts strings from files using regexes. You
can see the regexes here:
http://anonsvn.mono-project.com/viewvc/trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml?view=markup

Unfortunately there are no scanning rules defined yet for aspx, though
they should be straightforward to add. As a workaround, you could
indeed use CodeBehind.

Long-term, I'd like to use reflection/cecil to extract all string that
are passed to GetString, directly from the compiled assemblies, so
that it would work for all compiled managed languages.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list