0

Not able to get localization work. Not sure what is missing. Project directory in Visual Studio

So I have the story board in Base.lproj and created .string files through Xcode in resources/lang.lproj folders. First I tried without ~iphone or ~ipad extensions. When I change the language of the app in settings to fi or sv or es, it does't change the language at all. So I tried duplicating the files with ~iphone and ~ipad, but that didn't work either. What could be wrong here.

Gith
  • 3
  • 3
  • And this is from Info.plist `CFBundleDevelopmentRegion en CFBundleLocalizations en fi sv es ` – Gith Aug 21 '23 at 16:38
  • Do you mean the language of text is always English? Have you tried cleaning the project and delete the bin/obj folder and build again? I cannot reproduce this issue – Liqun Shen-MSFT Aug 22 '23 at 07:34
  • Here is the official documentation : [Localization in Xamarin.iOS](https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/localization/#localization-basics-in-ios) and [sample code](https://github.com/conceptdev/xamarin-samples/tree/master/TaskyL10nStoryboard).It worked well. You even don't have to duplicate the files for ipad and iphone. – Liqun Shen-MSFT Aug 22 '23 at 07:37
  • May I know if this question has been solved? – Liqun Shen-MSFT Aug 24 '23 at 02:20
  • Yes, cleaning and build again worked. Thanks. Now I am trying to figure out how to change the language without restarting the app. PLease let me know if you have an answer for that. I am seeing solutions in swift and others and am trying to change it to C# but not sure how to do it. (https://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language) Thanks. – Gith Aug 24 '23 at 09:20
  • Thanks for response. But Changing your app’s localisation on the fly is not recommended. Please see this [thread](https://developer.apple.com/forums/thread/28323). – Liqun Shen-MSFT Aug 24 '23 at 09:42
  • Yeah, I understand that. But I have the situation that the main view is a webview and when the user changes the language, the webview is downloaded again. But we had to do some extension only for the mobile app and the localisation would be affected then. I will still try to see if the requirements can be changed. Thanks. – Gith Aug 24 '23 at 11:15
  • I suggest you could open a new thread on SO. Let more people see and help. – Liqun Shen-MSFT Aug 25 '23 at 02:35

0 Answers0