Permanently storing your language setting
In the last chapter, we added a language switcher to our tutorial application, allowing you to switch to the desired language. While that’s great, any reasonable program will store your language setting so that you have to select the language only once at the very first use of the program. In the next lesson, we will implement this behavior for our application, too. Once we are finished, our browser application will store your language setting in its local storage and will recall these setting on each startup.
Preparing data storage on the device
-
From the gallery templates window (Alt+1) with folder Chora opened (key C), drag an instance of the Annotation Group to the component’s canvas. Place the element on the canvas and rename the property Caption of the element to Device interface using the inspector window. Resize the note group so that it will cover the two existing elements on the canvas. Move the two elements DeviceClass and Device down so that they don’t hide the caption any more.
-
Drag another instance of the Annotation Group to the component’s canvas. Place the element underneath the previously inserted note group and rename the property Caption of the newly inserted element to Enumerations using the inspector window.
-
From the gallery templates window to the left (Alt+1), drag the element Enum inside the Chora folder over to the canvas and place it inside the recently inserted note group Enumerations. Rename the enumeration to Language.
-
Double click on the newly inserted enumeration:icons/EnumIcon.png[enum icon]. Inside the composer window, a new tab Device::Language appears which shows the three items of the enumeration.