Asp.net MVC 2 开发中的本地化问题

发布于 2024-09-16 13:13:45 字数 245 浏览 4 评论 0原文

我从事一个多元文化网络项目。我使用本地化和全局资源(resx)作为多语言技术。
我与 2 名开发人员一起工作。我们如何共享 .resx 。当我的队友给我 2 个文件( myfile.resx 和 myfile.Designer.cs)并且我将其包含在我的项目中时,我无法在文件中添加一些新字符串。新字符串似乎没有复制到 myfile.Designer.cs 中......
我想念这里的一些东西。

我使用Asp.net MVC 2

I work on a multi culture web project. I use Localize and Global Ressources(resx) as multilang technology.
I work in team with 2 developer. How can we share .resx . When my teammate give me the 2 Files ( myfile.resx and myfile.Designer.cs) and I include it in my project, there is no way i can add some new string in the file. The new string seem to not be copy in the myfile.Designer.cs ...

I Miss something here.

I Use Asp.net MVC 2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耶耶耶 2024-09-23 13:13:47

如果您只是手动将现有的 RESX 及其设计器文件添加到您的项目中,那么您可能必须手动将它们连接在一起,以便 VS 知道它们是相关的。您必须手动编辑 .csproj 文件。以下是如何连接两者的示例:

<ItemGroup>
  <Compile Include="Resources\MyResources.Designer.cs">
    <AutoGen>True</AutoGen>
    <DesignTime>True</DesignTime>
    <DependentUpon>MyResources.resx</DependentUpon>
  </Compile>
</ItemGroup>
<ItemGroup>
  <EmbeddedResource Include="Resources\MyResources.resx">
    <Generator>ResXFileCodeGenerator</Generator>
    <LastGenOutput>MyResources.Designer.cs</LastGenOutput>
    <SubType>Designer</SubType>
  </EmbeddedResource>
</ItemGroup>

If you are just manually adding an existing RESX and its designer file to your project then you might have to manually connect them together so that VS knows they are related. You will have to manually edit your .csproj file. Here's an example of how to connect the two:

<ItemGroup>
  <Compile Include="Resources\MyResources.Designer.cs">
    <AutoGen>True</AutoGen>
    <DesignTime>True</DesignTime>
    <DependentUpon>MyResources.resx</DependentUpon>
  </Compile>
</ItemGroup>
<ItemGroup>
  <EmbeddedResource Include="Resources\MyResources.resx">
    <Generator>ResXFileCodeGenerator</Generator>
    <LastGenOutput>MyResources.Designer.cs</LastGenOutput>
    <SubType>Designer</SubType>
  </EmbeddedResource>
</ItemGroup>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文