Internationalization - Do you make sure your language follows the user's regional settings?
Updated by Tiago Araújo [SSW] 5 months ago. See history
123
Developers too often change the 'Language' settings on reports in order to make it look ok for how they want to see it. Without realizing that they are now not supporting multiple cultures. To do this, you need to set the 'Language' to **"=User!Language"**. Then the report will recognize user client's culture settings, e.g. IE's languages settings. Now you can specify this on either the culture sensitive controls or the whole report. Generally, is better specify this property on the whole report. <imageEmbed alt="Image" size="large" showBorder={false} figureEmbed={{ preset: "badExample", figure: 'Bad example - \'Language\' setting is set to a specific culture', shouldDisplay: true }} src="/uploads/rules/ensure-language-follows-user-regional-settings/RSRulesLanguage4.jpg" /> <imageEmbed alt="Image" size="large" showBorder={false} figureEmbed={{ preset: "goodExample", figure: 'Good example - \'Language\' setting is set to \'=User!Language\' to detect user\'s culture automatically', shouldDisplay: true }} src="/uploads/rules/ensure-language-follows-user-regional-settings/RSRulesLanguage3.jpg" /> <imageEmbed alt="Image" size="large" showBorder={false} figureEmbed={{ preset: "goodExample", figure: 'Good example - The data respects user\'s Language preference of IE in this case English (Australia)', shouldDisplay: true }} src="/uploads/rules/ensure-language-follows-user-regional-settings/RSRulesLanguage1.jpg" /> <imageEmbed alt="Image" size="large" showBorder={false} figureEmbed={{ preset: "goodExample", figure: 'Good example - Likewise the data also respects user\'s Language preference of IE in this case Chinese (China)', shouldDisplay: true }} src="/uploads/rules/ensure-language-follows-user-regional-settings/RSRulesLanguage2.jpg" /> <asideEmbed variant="info" body={<> **Warning: Adding the 'User' who printed the report, stops all data-driven subscriptions** When you try to add the 'User' your data-driven subscriptions fail with the following error: > 'The '/GroupHealth' report has user profile dependencies and cannot be run unattended. (rsHasUserProfileDependencies)'. The reason is the report doesn't know which language to choose. The workaround is to add a user function to fallback the error to a default language, like: "en-AU" </>} figureEmbed={{ preset: "default", figure: 'XXX', shouldDisplay: false }} /> ``` js Public Function Language() Try Return Report.User!Language Catch Return "en-AU" End Try End Function ``` <figureEmbed figureEmbed={{ preset: "goodExample", figure: 'Good example - Use above function to replace your reference to "Report.User!Language"/. It allows the subscription to work correctly', shouldDisplay: true } } />