本文介绍了需要帮助本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力进行本地化。似乎我读的越多,我就越困惑。我从这个文件中的一个资源文件strings.resx开始,我做了我的英文字符串分配。



从VS2012内部,我无法添加另一个字符串资源文件并让它以我期望的方式出现在编辑器中(换句话说,我无法为新语言添加字符串常量)。



因此,从文件系统中,我复制了原始resx以创建2个新的字符串资源文件。 strings.fr.resx和strings.es.resx。然后我将这两个文件添加到我的解决方案中并添加了相应的翻译字符串以匹配默认资源文件。



我在每个文件上设置了访问修饰符 内部并生成了designer.cs文件。



我在解决方案资源管理器中看到的一件事是我创建的第一个有资源管理器的字符串类,文化和枚举的字符串常量。其他人没有。



一切都编译得很好,但是当我将strings.resourceCulture设置为法语时,我仍然得到返回的英文字符串值。



我假设我的方法是复制和重命名资源文件可能是我出错的地方。请帮我回到正确的课程。

I'm struggling with localization. It seems the more I read the more confused I get. I started with a single resource file "strings.resx" in this file, I made my English string assignments.

From inside of VS2012, I couldn't add another string resource file and have it appear in the editor the way I was expecting (in other words, I couldn't add the string constants for the new language).

So, from the filesystem, I copied the original resx to create 2 new string resource files. "strings.fr.resx" and "strings.es.resx". I then added these 2 files to my solution and added the appropriate translation strings to match up to the default resource file.

I set the "Access Modifier" on each to "Internal" and generated the designer.cs files.

One thing that I see different in solution explorer is that the first one I created has a strings class with resource manager, culture and the string constants enumerated. The others do not.

Everything compiles fine, but when I set the strings.resourceCulture to French, I still get the English string value returned.

I'm assuming my approach to copying and renaming the resource file was probably where I went wrong. Please help me get back on the right course.

推荐答案



这篇关于需要帮助本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 03:27