Forum Discussion

Montreux's avatar
Montreux
New Contributor III
3 days ago

Substitution Variables with Desc and User Culture

Hi,

It doesn't look like the cube view ":name" override using substitution variables respects the user's culture setting.  The substitution variable goes instead to the default description.

My example, I have account descriptions in German and English.  

My user ID is culture English.  My cube view render the proper description when I don't use the override ":name()".  

I use the override, :name(|MFaccountDesc| growth %), and get this,

I would expect the substitution variables to respect the user's culture.

1 Reply

  • JackLacava's avatar
    JackLacava
    Icon for OneStream Employee rankOneStream Employee

    Yeah, that's just how it works for all "Desc" variables (MF, CV, POV). You're not wrong that it would likely be more elegant to translate them as necessary - although it would introduce a slight inconsistency, since other variables are not affected by Culture.

    You can submit an Ideastream post and see where it goes. In the meantime, the workaround (as it's often the case) is to use an XFBR rule:

    If args.FunctionName.XFEqualsIgnoreCase("i18n") Then
    	' get our dimension type
    	Dim dimTypeStr = args.NameValuePairs.XFGetValue("dimtype", "A")
    	Dim myDimType = DimType.GetItemFromAbbreviation(dimTypeStr, False, False, False)
    	' set option to get our translated strings
    	Dim memOpt As New MemberDisplayOptions() With {
    		.IncludeAllDescriptions = True
    	}
    	' retrieve member info
    	Dim memInfo = brapi.Finance.Members.GetMemberInfo(si, myDimType.id, DimConstants.Unknown, 
    		args.NameValuePairs.XFGetValue("name", "Root"), False, Nothing, memOpt)
    	' look up the translated description using the user's culture and return it.
     	' If not present, use default description.
    	Return memInfo.Descriptions.XFGetValue(si.Culture, New MemberDescription()).Description
    End If
    

    You'd then specify it in your Cube View like this: