Localization resx

Posts   
 
    
Dja
User
Posts: 29
Joined: 22-Jul-2010
# Posted on: 07-Mar-2011 12:04:53   

Hi. I would like to generate some items in localization resx file, which is xml. That is not a problem. But what I would also like to achieve is possibility to have user regions for developers to add their own translations. I don't know how to generate user regions in resx (xml) file. Is this possible?

Tnx.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 07-Mar-2011 18:05:19   

yes.

Use: (if you use .lpt) <%=DotNetTemplateEngine.GetUserCodeRegion("UserRegionName", "<!--", "-->", string.Empty, false)%>

TDL doesn't support xml comment based user regions.

Frans Bouma | Lead developer LLBLGen Pro
Dja
User
Posts: 29
Joined: 22-Jul-2010
# Posted on: 08-Mar-2011 12:22:23   

Thanks for the answer. I wrote the .lpt, but when I run it I get: "No overload for method 'GetUserCodeRegion' takes '5' arguments". Do you know what might be the problem?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 08-Mar-2011 14:49:16   

You do use v3.1? or v2.6? not supported in v2.6

Frans Bouma | Lead developer LLBLGen Pro
Dja
User
Posts: 29
Joined: 22-Jul-2010
# Posted on: 08-Mar-2011 14:53:25   

I use 3.0.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 08-Mar-2011 22:09:59   

That's a bit odd, the docs definitly say that there is an overload with 5 params ! Can you try

<%=DotNetTemplateEngine.GetUserCodeRegion("UserRegionName", "//")%>

to see if that works please ?

Matt

Dja
User
Posts: 29
Joined: 22-Jul-2010
# Posted on: 09-Mar-2011 09:40:56   

Yes, that works, but i still need the method with 5 params. I agree this is strange. Could the problem be that I have installed versions 1.1, 2.6 and 3.0 on my computer?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Mar-2011 09:48:00   

Could you try v.3.1 on a fresh machine ?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 09-Mar-2011 10:48:37   

v3.0 DotNetTemplateEngine:

/// <summary>
/// Gets the user code region with the name specified. If no region is found, a new one with simply a start and an end marker is created.
/// </summary>
/// <param name="name">Name.</param>
/// <param name="commentToken">Comment token.</param>
/// <param name="endCommentToken">The end comment token. Empty string by default, but can be used for enclosing comment markers, like within XML/HTML</param>
/// <param name="initialRegionContents">The initial region contents, added to the region when the region isn't found (so a new one is created).</param>
/// <param name="emitTrailingCrLf">if set to <c>true</c> a trailing CRLF is emitted in the output after the end marker. Default is true.</param>
/// <returns>
/// the contents of the region with the name specified in the original file contents, if present, otherwise a new region, with the
/// initialREgionContents added as the initial region contents.
/// </returns>
public static string GetUserCodeRegion(string name, string commentToken, string endCommentToken, string initialRegionContents, bool emitTrailingCrLf)
{

...

so it is available in the v3.0 engine. Could you indeed try 3.1 or at least the latest 3.0 build?

Frans Bouma | Lead developer LLBLGen Pro
Dja
User
Posts: 29
Joined: 22-Jul-2010
# Posted on: 09-Mar-2011 12:24:36   

Yes, I did see that, and also was confused. It's clear that it should work. Anyhow, I installed v3.1 and now it works fine.

Tnx. simple_smile