Xamarin Forms: Cannot add RESX for globalization

南楼画角 提交于 2019-12-07 13:25:44

问题


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.

My Visual Studio is version 15.1 community version.

Steps I took:

  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

Anyone has this issue?


回答1:


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

  1. Create the .resx file in File Explorer
  2. In Visual Studio add existing file and choose the file you created
  3. Visual Studio detects the file as resx and creates .designer.cs file automatically

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. 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.



来源:https://stackoverflow.com/questions/44505696/xamarin-forms-cannot-add-resx-for-globalization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!