Register | Login
Thursday, February 09, 2012
  Search
 Discussion Forums at Locopon's Minimize
 
Forum / ForosForum / ForosModules/ModulosModules/ModulosDSLocalizatorDSLocalizatorHow to get Localized tab name?How to get Localized tab name?
Previous Previous
 
Next Next
New Post
 7/19/2010 3:35 PM
 
How to get Localized tab name?  (United States)
 Modified By jbook  on 7/19/2010 2:21:14 PM

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
 7/19/2010 5:17 PM
 

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

Previous Previous
 
Next Next
Forum / ForosForum / ForosModules/ModulosModules/ModulosDSLocalizatorDSLocalizatorHow to get Localized tab name?How to get Localized tab name?