I currently use an EnumList data type to help me filter my database. I’d also like my app to be in 2 languages. I’ve got another table that i want to use to help translate showing each item in both languages. I’m having difficulty handling EnumList fields. This is what i have in mind:
Field is in english with only english options. Create a virtual column with formulas to convert these into my 2nd language using the table. Then, depending on the user’s language setting, they’d see one or the other table. What i’m struggling with is the formula in the virtual column which essentially needs to be able to translate multiple items at the same time. Any ideas? If another approach is best, please let me know.
Here’s how I’d start: Make a table with a row for each value and a data source column for each language. Make a virtual column that equals the language column that corresponds to the user’s selected language (e.g., in User Settings). Designate that virtual column as the table’s label column. In your enumlist column, enter an expression in the Valid if column that returns the rows from the translations table.
I want someone in English to be able to select Category_eng1 and filter so they only see item 1 and 2. Similarly, someone in French should be able to select Category_fr1 to filter the same. With your solution, the user is able to select from the eng list or from the fr list depending on their chosen language. However, it now means the number of options in my category is doubled, How should i go about setting the filter?
The way i see it, I need a virtual table in my data table which will translate the category column into the chosen language. I’m not sure how to translate multiple items (since it’s an enumlst) in a single formula,
How so? In your Translation table, add a virtual column that returns the value from the row’s other column that corresponds to the user’s selected language. Make that column the table’s label column. In the Data table, ensure that the Category column uses a base type of Ref and references the Translation table.
The community includes many posts about localization, including a sample app that illustrates the techniques. I don’t find it in a quick search, but if you dig you’ll get to it.
Ok, I was not properly setting up the EnumList of type Ref. I didn’t realize I needed to select rows from the referenced table as options in the enumList. After doing this, field seems to be working but i got an error when trying to use this method: “Unable to update row in table ‘Filter’. → Invalid request provided to AppSheet database”. After googling, it seems that using AppSheet database for my data is may not be the correct choice for now as AppSheet database is still in preview.
I converted my app to only use Google Sheets.
I have a virtual column in my Translation table which creates a virtual column that correctly shows the values in the user’s language. This column is set as the label.
In my Filter table, i have a Category field which is set as an enumlist of Ref type. The Ref type refers to my Translation table. I also set the valid if parameter to be the Category field of the Translation Table. I correctly see my enumlist options in the user’s language.
I’ve set the “Cagetory_En” field from the Translation table as a Key field.
If i set my language to french, use the quick edit settings of the filter table, select category_fr1 from the options, what is populated in the Filter Table is category_fr1, even though i set the key to be Category_En.
I would expect it to populate category_eng1
Filter Table:
User
Filter
Category
useremail
Category
Category_fr1
Data:
Title
Category
item 1
Category_eng1, Category_eng3
item 2
Category_eng1
item 3
Category_eng3
Translation table
Category_En (Key Field)
Category_Fr
Category (virtual) (Label Field)
Category_eng1
Category_fr1
(formula)
Category_eng2
Category_fr2
(formula)
Category_eng3
Category_fr3
(formula)
(documentation from my searching)
I’ve found this sample app with 100 languages, but it does not feature any enumlist: Multilingual Starter App (appsheet.com).
I’ve found this previous blog post that link to a community support app which is used to showcase this Multilanguage in action. I found that everything in this app is translated, except for the EnumList: if I create a request, the services offered are in English even if I change the language.
A Ref type column’s values must be from the referenced table’s key column. In the Valid if property, use the Category_En column, not the Category column. While the Ref column’s values in the data source will be from the Category_En key column, the values displayed to the user will be from the Category label column.