custom localization with ExpressionBuilder

K

kelmen

Greeting,

I'm attempting to write customize expression-builder . As to
replace\enhance the build-in Resources exp-builder.

It work in a way. However, somehow the resources I retrieved using
GetGlobalResourceObject() always getting me the default culture.

I hardcoded the culture setting at session_onstart, to test Chinese
text. They all worked fine with the built-in Resources.

However, if I switch to my own stuff, always return the default (eng)
text.

when using my own custom stuff, only need the resource-item-key, at
initial testing stage.
<%$ ResourceEx: SomeText %>

my coding of the exp-builder:

public override CodeExpression GetCodeExpression(
BoundPropertyEntry entry
, object parsedData
, ExpressionBuilderContext context
)
{
StringBuilder objStr = new StringBuilder();

objStr.Append( HttpContext.GetGlobalResourceObject("Text",
entry.Expression.Trim()).ToString() );

return new CodePrimitiveExpression(objStr.ToString());
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,269
Latest member
vinaykumar_nevatia23

Latest Threads

Top