Xamarin表单:无法添加RESX进行全球化 [英] Xamarin Forms: Cannot add RESX for globalization

查看:57
本文介绍了Xamarin表单:无法添加RESX进行全球化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照指南尝试在Xamarin上使用全球化功能,但是在对话框中找不到Misc类别或Resource File选项.

Trying to use the globalization feature on Xamarin by following the guide, however can't find the Misc category nor the Resource File option in the dialog.

我的Visual Studio是15.1版社区版本.

My Visual Studio is version 15.1 community version.

我采取的步骤:

  1. 右键单击通用项目
  2. 选择添加->新项目
  3. 在对话框中,左面板显示Visual C#,其中包含4个子类别:代码,数据,常规和跨平台.杂项不是其中之一.
  4. 在搜索栏中尝试键入Resource,没有结果
  1. Right click on the common project
  2. Choose Add -> New Item
  3. On the dialog, left panel is showing Visual C# with 4 sub-categories: Code, Data, General and Cross Platform. Misc is not one of them.
  4. Tried type Resource in the search bar, no result

有人遇到这个问题吗?

推荐答案

通过执行以下操作,我可以将.resx文件手动添加到Visual Studio 2017 Community Edition中的项目中:

I was able to add .resx files manually to the project in Visual Studio 2017 Community Edition by doing the following:

  1. 在文件资源管理器中创建.resx文件
  2. 在Visual Studio中添加现有文件,然后选择您创建的文件
  3. Visual Studio将文件检测为resx并自动创建.designer.cs文件

通过执行此操作,我可以按照上面提到的指南并查看示例项目来在我的项目中进行本地化工作.

By doing this I was able to get localization working in my project by following the guide mentioned above and looking through the sample projects.

PS.在VS 2017中,我注意到如果您使用资源编辑器编辑文件,某些特殊字符将无法正常工作.我建议使用文本编辑器来编辑resx文件.

PS. In VS 2017 I noticed that if you edit the file with the resource editor some special characters did not work correctly. I would suggest using text editor to edit the resx files.

这篇关于Xamarin表单:无法添加RESX进行全球化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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