English 中文(简体)
单页使用2种语文
原标题:Use 2 languages on a single page

有可能在伙伴关系中进行。 NET MVC在单一网页上使用2种不同语言,每个网页都有自己的资源档案?

So for example I want the header of the page to be in english and the content in german. Now there should be two dropdowns to change the language, one for the header and one for the content. If I change the header language to french the content should still stay german and vice versa.

这是可能的吗?

最佳回答

Just an update if anyone is interested.

There is a way to solve this problem. In the example below the culture initially is set to german, then changed to english for the partial, and in the end, reset to german again.

这导致部分使用联合国语文,而其余部分则以相宜。

@{
    var culture = Resources.Resources.Culture;
    Resources.Resources.Culture = new System.Globalization.CultureInfo("en");
}
@Html.Partial("Control")
@{Resources.Resources.Culture = culture;}
@Resources.Resources.welcome

有了一种习俗帮助方法,这肯定会更看一看一线。

问题回答

暂无回答




相关问题
How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...

Explain the Need for Mutexes in Locales, Please

Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...

How does Vistalizer work

How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.

Localized exceptions (within a Struts2 app)

I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...

Rails Globalize plugin help

Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?

热门标签