问题
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:
- Right click on the common project
- Choose Add -> New Item
- 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. - 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:
- Create the .resx file in File Explorer
- In Visual Studio add existing file and choose the file you created
- 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