Storyboard Localization not working

CollindeWittCollindeWitt USMember ✭✭
edited February 2018 in Xamarin.iOS

Hi

Has anyone experienced issues with localization for storyboards. (I see lots of issues online people having problems with this)
I have followed the official documentation, I have tried many things from other people issues that worked for them.
I can not figure out why it does not work.

I have this in my info.plist

<key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleLocalizations</key>
    <array>
        <string>zh-Hans</string>
    </array>
<key>CFBundleName</key>

In my Resources folder I have a Base.lproj that contains
Main.strings
Then another folder zh-Hans.lproj
inside that I have Main.strings with the following content
"196117.text" = "点击\“+ \”添加一张新卡";
"263697.text" = "演示卡";
"263698.text"= "禁用应用";

These are labels so that is why i have the text property and the number is my Localization ID found in storyboard.

I have tried making files Main~ipad and Main~iphone.strings in the language folders.
I have tried moving the Main.storyboard into Base.lproj or backs into the project root.

Nothing has worked.
Does anyone have any other advice please.

Thank you

Best Answer

  • CollindeWittCollindeWitt US ✭✭
    edited February 2018 Accepted Answer

    So I have this working now, I moved my Base.Iproj out of resources with the storyboard file in Base.
    Also a silly mistake I made was mixing up the i and the L. I copied the name of the file Base.lproj from Xamarin site and renamed my folder with what I copied.
    I believe I might have got the name wrong, as the capital letter 'i' also looks like a lower case L as in . i = I and L = l.

    All my localization is now working :smile:

Answers

  • CollindeWittCollindeWitt USMember ✭✭
    edited February 2018 Accepted Answer

    So I have this working now, I moved my Base.Iproj out of resources with the storyboard file in Base.
    Also a silly mistake I made was mixing up the i and the L. I copied the name of the file Base.lproj from Xamarin site and renamed my folder with what I copied.
    I believe I might have got the name wrong, as the capital letter 'i' also looks like a lower case L as in . i = I and L = l.

    All my localization is now working :smile:

Sign In or Register to comment.