使用卫星资源集合的Asp.net本地化 [英] Asp.net localization using satellite resource assemblies

查看:92
本文介绍了使用卫星资源集合的Asp.net本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个普通的ASP.NET Web应用程序,我需要进行全球化/本地化。我可以使用.resx文件和我的.aspx文件中的显式本地化来成功完成此操作。我想以附属程序集的形式而不是.resx或.resources文件分发我的本地化字符串。



使用附属程序集时,我可以轻松访问来自代码隐藏的资源字符串,但在获取.aspx文件中的显式本地化表达式以访问来自附属程序集的资源方面却没有成功。



我有还没有找到任何通过卫星装配直接说明明确定位的例子或指导,并且已经在我的头上敲了一下大约两个星期。



我的问题很简单 - 是否可以在aspx页面中使用带有显式本地化表达式的附属程序集?如果有,有人能指出我的工作实例吗?



I have a plain-vanilla ASP.NET web application that I need to globalize/localize. I can successfully do this using .resx file and explicit localization in my .aspx files. I would like to distribute my localized strings in the form of satellite assemblies rather than as .resx or .resources files.

When using satellite assemblies, I can easily access the resource strings from the code-behind, but have been unsuccessful in getting the explicit localization expressions in the .aspx files to access the resources from the satellite assemblies.

I have yet to find any examples or guidance which speak directly to explicit localization via satellite assemblies, and have been banging my head against the wall on this one for about two weeks.

My question is a simple one - is it possible to use satellite assemblies with explicit localization expressions in an aspx page such as this? If yes, can someone point me towards a working example?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="twa.aspx.cs" Inherits="twa.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
        <asp:Label ID="Label1" runat="server" Text="<%$ Resources:twa, Label1Text %>"></asp:Label>
        <br />
        <asp:Button ID="Button1" runat="server" Text="<%$ Resources:twa, Button1Text %>" />
        <br />
        <asp:TextBox ID="TextBox1" runat="server" Text="<%$ Resources:twa, TextBox1Text %>"></asp:TextBox>
    </form>
</body>
</html>





我尝试过:



只是寻找这种方法可行性的答案。



What I have tried:

Just looking for an answer as to the feasibility of this approach.

推荐答案

资源:twa,Label1Text%>> ;< / asp:标签>
< br />
< asp:按钮ID =Button1runat =serverText =<%
Resources:twa, Label1Text %>"></asp:Label> <br /> <asp:Button ID="Button1" runat="server" Text="<%


资源:twa,Button1Text%>/>
< br />
< asp:TextBox ID =TextBox1runat =serverText =< %
Resources:twa, Button1Text %>" /> <br /> <asp:TextBox ID="TextBox1" runat="server" Text="<%


资源:twa,TextBox1Text%>>< / asp:TextBox>
< / form>
< / body>
< / html>
Resources:twa, TextBox1Text %>"></asp:TextBox> </form> </body> </html>





我尝试过:



只是在寻找这种方法可行性的答案。



What I have tried:

Just looking for an answer as to the feasibility of this approach.


这篇关于使用卫星资源集合的Asp.net本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆