Skip to content

Build tool for Visual Studo that allows for automatic conversion of .resx resources from PCL to native Windows Runtime 8.1 .resw resources on each build.

License

Notifications You must be signed in to change notification settings

konradbartecki/ResxHell

Repository files navigation

ResxHell

Middle-build tool for Visual Studo that allows for automatic conversion of .resx resources from PCL to native Windows Runtime 8.1 .resw resources every build.

##Why ResxHell?

In case you are wondering how to make shared localization library with Xamarin that works on iOS, Android and Windows Phone 8.1 - you could make an shared PCL and place .resx resources there, but it won't really work in WP8.1. By using this tool you can automatically convert .resx to native WP8.1 format .resw and move them to WP project every build, so you don't have to copy it manually to every project everytime PCL with .resx was updated.

###Features

  • Convert string-only .resx to .resw
  • Sync .resx from PCL to native .resw in WinRT project on build

##How to use

  1. Check your project build order and make sure that PCL that contains .resx builds before WinRT project
  2. Create default localization folder structure in your WinRT project for example:
  • Strings
    • ar
    • en
  1. Make a "ResxHell" folder in your solution's root directory and place a ResxHell.exe there .
  2. Go to your PCL project > Properties > Build Events > and in Post-Build event enter

"$(SolutionDir)\ResxHell\ResxHell.exe" -import "$(ProjectDir)\"
  1. Go to your WinRT project > Properties > Build Events > and in Pre-Build event enter

"$(SolutionDir)\ResxHell\ResxHell.exe" -export "$(ProjectDir)\"
  1. Build your WinRT project - it can fail when building for the first time
  2. On solution explorer click "Show all files" button and select all new files > Include in project You will have to do this every time a new .resx is added in a Portable Class Library

8. Rebuild again and now you can reach your imported .resw from C# code

Troubleshooting

Resource map not found

Create dummy "Resource.resw" file in every /Strings/language folder

I am still getting MdilXapCompile.exe failed with error code 1004

Remove reference to your localization PCL, but ensure it builds earlier than your Windows Runtime project

Resources won't work when I am creating the app package

Build your app package with "Make app bundle" set to "Never"

About

Build tool for Visual Studo that allows for automatic conversion of .resx resources from PCL to native Windows Runtime 8.1 .resw resources on each build.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages