Registrarse | Entrar
viernes, 10 de febrero de 2012
  Buscar
 Foros de discusión en Locopon's Minimizar
 
Forum / ForosForum / ForosModules/ModulosModules/ModulosDSLocalizatorDSLocalizatorHow to get Localized tab name?How to get Localized tab name?
Anterior Anterior
 
Siguiente Siguiente
New Post
 19/07/2010 03:35 p.m.
 
How to get Localized tab name?  (United States)
 Modificado por jbook  on 19/07/2010 02:21:14 p.m.

I have a custom menu I wrote in VB. I cannot seem to get the Localized tabname. The default (English) name is always returned. How do I get the Localized tab name programmatically? This is the code I'm using to test:

(The hack is installed and pages that use the default DNN nav work fine. Just my custom menu is stuck in English.)

Thanks!


Private Function getTabName(ByVal tabid as Integer) As String
        Dim ret as String = ""
        Dim ps as New PortalSettings
        ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings()
        Dim tab As DotNetNuke.Entities.Tabs.TabInfo = Nothing
        ' find the tab that matches the given tabid
            For intIndex As Integer = 0 To ps.DesktopTabs.Count - 1
                tab = CType(ps.DesktopTabs(intIndex), Entities.Tabs.TabInfo)
                If tab.TabID = tabid Then
                ret = tab.tabname  '--always returns English/default
            End if
            Next
        return ret
    End Function

New Post
 19/07/2010 05:17 p.m.
 

I got it! This works:

 

    Private Function getTabName(ByVal tabid as Integer) As String
        Dim ret as String = ""
              For i = 0 To PortalSettings.DesktopTabs.Count - 1
                Dim tab As DotNetNuke.Entities.Tabs.TabInfo = CType(PortalSettings.DesktopTabs(i),DotNetNuke.Entities.Tabs.TabInfo)
                If tab.TabID = tabid Then
                ret = tab.tabname

            End if
              Next

        return ret
    End Function

Anterior Anterior
 
Siguiente Siguiente
Forum / ForosForum / ForosModules/ModulosModules/ModulosDSLocalizatorDSLocalizatorHow to get Localized tab name?How to get Localized tab name?