iOS Question localization with Chinese

icefairy333

Active Member
Licensed User
Longtime User
follow this:https://www.b4x.com/android/forum/threads/tutorial-for-localization-of-app-name.69618/#post-441789

I add the zh-Hans.lproj into project\Special but get error:
The given key was not present in the dictionary.
111.jpg
 

Attachments

  • locfiles.zip
    7 KB · Views: 248
Last edited:

icefairy333

Active Member
Licensed User
Longtime User
Moved to the questions forum.

See the very short instructions: https://www.b4x.com/android/forum/threads/tutorial-for-localization-of-app-name.69618/#post-441789

The file name is incorrect.
excuese me,after this modify(filename ),the b4i have no error,but the thirdpart library cannot display the right string,I've done much testing on that,and find that:
if put this code in starter module
B4X:
Sub test 'the code below comm and tl =NSLog+toastmessageshow
    Dim jo As NativeObject
    jo=Me
    jo.RunMethod("octest",Null)
End Sub
#If OBJC
- (void) octest{
    [self._comm _tl:NSLocalizedStringFromTable(@"hold_to_talk_title",@"RongCloudKit", nil)];//this work with right string:"Hold to talk"
    [self._comm _tl:NSLocalizedString(@"hold_to_talk_title",  nil)];//this not work with right string but return the key directly:"hold_to_talk_title"
}
#end if
maybe the thirdpart library is using the API:NSLocalizedStringFromTable so,I have to make the file named "RongCloudKit.strings",but the b4i cannot compile,so I done by this:
1.remove them in b4i
2.compile in release mode
3.add them in xcode
4.compile with xcode
and in this way the app show right string,and "zh-Hans.lproj" is meaining Simple Chinese.
so b4i should not limit the filename of "strings" files,yes?
4.jpg
5.jpg

but the string is not follow the local setting(in system setting to China),when I delete the string file in en.lproj (remain only which in zh-Hans.lproj) it show Chinese:
6.jpg
 
Last edited:
Upvote 0
Top