'将List转换成MAP
public Sub ListToMap(decList As List) As Map
Dim tmpMap As Map
tmpMap.Initialize
For Each s As String In decList
If s.Contains("=") Then
Dim MapSplit() As String=Regex.Split("\=",s)
If MapSplit.Length=1 Then
tmpMap.Put(MapSplit(0),"")
Else
tmpMap.Put(MapSplit(0),MapSplit(1))
End If
End If
Next
Return tmpMap
End Sub
'直接使用ReadMap会导致乱码
public Sub InitLanguage(Path As String,LanguageName As String) as Map
Dim LanguageFile As String=$"${LanguageName}.txt"$
Dim LangList As List
If File.Exists(Path,LanguageFile) Then
LangList=File.ReadList(Path,LanguageFile)
Return ListToMap(LangList)
End If
End Sub