iOS Question Select language for app

John Woodsmall

Active Member
Licensed User
Longtime User
here is a zip for my app that only allows the selection of a language(english---en.map).
 

Attachments

  • test_trans.zip
    472.6 KB · Views: 186

John Woodsmall

Active Member
Licensed User
Longtime User
ok...thanks. by the way it needs to be run in debug to see the log file (I sure you know this)

I did convert the en.map to utf8 as instructed, but it does not find the label text:
B4X:
   For Each v As View In Page1.RootPanel.GetAllViewsRecursive
      Log("--" & v & v.Tag)
     If v Is Label And v.Tag <> Null And m.ContainsKey(v.Tag) Then
       Dim lbl As Label = v
       lbl.Text = m.Get(v.Tag)
      Log("Lable text=" & lbl.Text)
     End If

on the label line the log shows:
B4X:
--<B4IViewWrapper: <UILabel: 0x16ee3410; frame = (6.59911 171.577; 103.7 28.2819); text = 'Person 1 >>'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x16ee3390>>>

but does not print "Label text=" & lbl.text as expected to the log file and
therefore does not change the text on the label to what is on the v.tag from the en.map file above?

when this is run (after a language is selected) it should change the label on the app to a new name.

it does not do this???
what am i missing here?
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
Yes,
No matter what i do i still get in the log file some thing:
-<B4IViewWrapper: <UILabel: 0x16ee3410; frame = (6.59911171.577; 103.728.2819); text = 'Person 1 >>'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x16ee3390>>>
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
ok,
so i fixed the map files so they have the tags corrrect
and i saved them as utc8 encodeing.

i still get the string above -<84I ...
and the program does not update the labels
 

Attachments

  • test2_trans.zip
    472.2 KB · Views: 182
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
ok

I have tried to load it as list:
B4X:
' Dim TheList As List, item As String, item_name As String,item_tag As String,x1 As Int
 '    TheList = File.ReadList (File.DirAssets, MapFileName)  
'    For i = 0 To TheList.Size -1
'        'Log(TheList.Get(i))
'        item = TheList.Get(i)
'        x1 = item.IndexOf("=") : item_name= item.subString2(0,x1):item_tag = item.substring2(x1+1,item.Length)
'        Log ("Item=" & item_name & "Tag=" & item_tag)
'        'item_name.text = item_tag
'        If item_name="Lable1" Then
'            Dim lbl As Label = item_name
'            lbl.Text = item_tag
'        End If
'   
'    Next
that does not work also.

So I know that I have the String: Button1=Clear in the en.map file. I thought the tag part was: "Clear"
but the log output shows that the tag part is null (as you said). So what gives with all of this?

is it not possible to change the labels to another language?
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
oh, no i have not.
(but i will)
is the idea here that we use the fake tag in the our file to change the text value?
(i will try right away).
 
Upvote 0
Top