Forum Xamarin.iOS

I18N strings resource doesn't work well on Mac Cocoa App.

simeon_Msimeon_M USMember ✭✭

I made I18N strings resource by ResX file.
But, it doesn't works well on only Xamarin.Mac cocoa app.
On Mac Console app, it works well.

My test code is here.
https://github.com/simeon052/I18NSample

Do anyone have a good idea?

Best Answer

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai
    Accepted Answer

    Xamarin.Mac's msbuild logic currently does not support resx files, so the ja-JP folder in your example is not being copied into your app bundle. If you, for example, copy it into i18NSample.Mac.app/Contents/MonoBundle then your sample will work.

    I would suggest using this sample: https://developer.xamarin.com/samples/mac/UseMSBuildToCopyFilesToBundleExample/

    to add logic to copy the files you need into the bundle. By doing it here instead of manually, you shouldn't need to resign your bundle when you add code signing.

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai
    Accepted Answer

    Xamarin.Mac's msbuild logic currently does not support resx files, so the ja-JP folder in your example is not being copied into your app bundle. If you, for example, copy it into i18NSample.Mac.app/Contents/MonoBundle then your sample will work.

    I would suggest using this sample: https://developer.xamarin.com/samples/mac/UseMSBuildToCopyFilesToBundleExample/

    to add logic to copy the files you need into the bundle. By doing it here instead of manually, you shouldn't need to resign your bundle when you add code signing.

  • simeon_Msimeon_M USMember ✭✭

    Thank you for your quick response.
    My sample app works well with your suggestion.

Sign In or Register to comment.