How to make the Slice change Language

In the annualloadbook app the Language Change is working great except in one of the Reference  View. The data comes from the table {Expenses}, Slice {Expense HQ} The column that it uses from the slice is the Expense Column.

In the view for expenses the expense names do change language when the app user changes it. But not the names in the chart for the expense names.

The app view doesn’t changeThe app view doesn’t changeThe Ref viewThe Ref viewThe ref viewThe ref viewExpenses SliceExpenses SliceThe filter conditionThe filter conditionExpenses category totalsExpenses category totals

Solved Solved
1 11 306
2 ACCEPTED SOLUTIONS

You will need to make a nested switch statement in a virtual column that is used for the chart instead of expense. This will switch back and forth for your languages providing the correct label.

SWITCH(USERSETTINGS("language"),
"Spanish", SWITCH([expense], "tax", "impuesto", "lodge", "alojamiento", ""),
"Chinese", SWITCH([expense], "tax", "税收", "lodge", "住宿", ""),   ""  ),
"French", SWITCH([expense], "tax", "impôts", "lodge", "hébergement", ""),   ""  )

Hope this helps!

View solution in original post

Don't know if you are willing to try that switch statement I ran it and it changed properly for the table. As Steve stated it might come down to that appsheets graphs choose the original name before language filters to display no matter user setting.

 

View solution in original post

11 REPLIES 11

The chart is showing entered data values - not column display values.   Are you applying some kind of conversion logic to the raw data as well?  If so, how?

Otherwise, why wouldn't the values have been entered in Spanish instead of English?


The Categories are from originate from an enum list for [Expenses] I use a referenced table that changes the language from usersettings. The chart gets the information from a slice on the expense table call Expenses_HQ and it uses the Column [Expeses].

The Expense Table has two columns for expenses

[Expense Type] enum type that ref table ExpenseType_ENUM has has a valid_if statement to month_enum Table column [Expense_Type].  This changes the language from the enum list to whatever the user setting are set to.

[Expense]  This is the same.

My question is if the chart pulls from a slice from the expense table column [Expense] what is stopping it from changing also?

This is what the chart looks like and the DATA changes with the language selection but the chart doesn’t change.

I have to use the slice to pull information from the Filter table so the user can set the perimeters for the dynamic analytics filters by the unit selected or the driver selected. 

IMG_0546.jpegIMG_0547.jpeg

I seem to recall looking at this issue some time ago and finding that the chart always uses the literal value and won't dereference it to get the label.

You will need to make a nested switch statement in a virtual column that is used for the chart instead of expense. This will switch back and forth for your languages providing the correct label.

SWITCH(USERSETTINGS("language"),
"Spanish", SWITCH([expense], "tax", "impuesto", "lodge", "alojamiento", ""),
"Chinese", SWITCH([expense], "tax", "税收", "lodge", "住宿", ""),   ""  ),
"French", SWITCH([expense], "tax", "impôts", "lodge", "hébergement", ""),   ""  )

Hope this helps!

I use a switch statement for the table Expense 

Switch(
Index(Split(usersettings(Language),Translations, Language,),1),
"Russian", [Russian],
"Ukrainian", [Ukrainian],
"Turkish", [Turkish],
"Albanian", [Albanian],
"German", [German],
"Spanish", [Spanish],
"French", [French],
"Portuguese", [Portuguese],
"Indonesian", [Indonesian],
"Sundanese", [Sundanese],
"Basque", [Basque],
"Serbian", [Serbian],
[ENUM_EXPENSES])

 

This works great for the expense enum, and is from the table that the slice for the chart comes from However it also has to use the Valid_if statement for the enum list of expenses in table Month_enum

OK i under stand. I made the switch statement Like you did above. It works to change the expense names to the language setting. But now I cannot pull the total expenses for the expense categories based on the user settings in the dynamic analytics view. 

Here the user can run reports from both the DATA table and the Expense table through the table filter and reports based on 

Driver, Truck, fleet or any combination of the three choices for any dates 

Switch(
Index(Split(usersettings(Language),
"Spanish", SWITCH([expense], "Bank Fee's", "Tarifas bancarias", "Fuel", "Combustable", ""),
"German", SWITCH([expense], "Bank Fee's", "Bankgebühren", "Fuel", "Kraftstoff",""),
"French", SWITCH([expense], "Bank Fee's", "Frais bancaires", "Fuel", "Carburant", ""), "" )

Wanted to check back in on this thread and see if you were able to find a solution?

No not yet I'm still working on it
I made a copy of the app and am trying to figure it out.
I have to use the slice to pull the information that the app user needs.
I just don't understand how to make the expense categories reference the
change language that the expense enum does.

I would have to add an expression in the slice but it crashes error each
time I try so far
Jack Bates

Don't know if you are willing to try that switch statement I ran it and it changed properly for the table. As Steve stated it might come down to that appsheets graphs choose the original name before language filters to display no matter user setting.

 

Using the switch statement changes the language on the overlay but not the chart catagories

IMG_0548.png

Top Labels in this Space