mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-09-26 11:29:07 +02:00
Let's change it to GetType instead
This commit is contained in:
parent
c552434935
commit
074f702a0e
@ -92,11 +92,17 @@ Public Class Localization
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Public Shared Function Translate(ByVal s As String, Optional ByVal DefaultValue As String = "") As String
|
||||
Public Shared Function Translate(ByVal s As String, Optional ByVal type As Type = Nothing, Optional ByVal DefaultValue As String = "") As String
|
||||
Dim resultToken As Token = Nothing
|
||||
Dim CurrentScreen As String = GetCurrentScreen()
|
||||
s = s.ToLower().Replace(" ", "_").Replace("'", "").Replace("p3d.", "").Replace("._", "_") ' Lets format the string before finding it
|
||||
Dim NewTokenName As String = CurrentScreen & "." & s
|
||||
Dim prefix As String = ""
|
||||
If type Is Nothing Then
|
||||
prefix = CurrentScreen
|
||||
Else
|
||||
prefix = type.Name.ToString.ToLower
|
||||
End If
|
||||
Dim NewTokenName As String = prefix & "." & s
|
||||
If s.Contains(".") = False Then
|
||||
'Logger.Debug("Localization.vb: s.Contains: " & s)
|
||||
s = NewTokenName
|
||||
|
Loading…
x
Reference in New Issue
Block a user