Translation Preload before the Application Update
To proceed to the scenario described in this section, we need to complete the main scenario described earlier.
So now, according to the imaginary conditions of the main scenario, the system language is Russian, and we have downloaded the Russian translation for version 18.104.22.168 of Sample Program and switched to it.
Let us imagine that the new 22.214.171.124 version of the Sample Program has become available and ready for downloading. Let us assume that the translators have already done the work (when 126.96.36.199 was in the beta stage) and uploaded the translation for version 188.8.131.52 to the server.
We may ensure that the translation to 184.108.40.206 is available for Sample Program by visiting the demo account’s page: http://langshelper.com/DemoAccount:
Hoverer, if we will update Sample Program now, its interface translated to Russian will be changed back to English because we have only downloaded the translation for version 1, while version 2 is only on the server yet. To solve this problem, our library provides a handy way to preload the translation for the next version in the background when the program is showing to the user the window with the new version information.
Let us take a look at the Sample Program after completing the main scenario. The Russian translation is enabled, and we press the New version available button at the top right of the window.
While we are emulating the program’s behavior with the Russian translation enabled (and you will see the Russian interface if repeating this with the Sample Program demo application), on the screen shots below the English interface is shown instead just to avoid the need to translate each line on our screen shots:
After clicking the button, the New-version-is-available window will appear. At the same time, the translation for version 220.127.116.11 is downloaded to the translations folder:
Once the translation for version 18.104.22.168 is successfully downloaded, the Open the translation folder button will appear, and you will be able to make sure that the corresponding file is added to the folder. Now you may press the update button (it will do nothing in our demo application) and after the update, if this were a real situation, the application will still be in the Russian language.