public void saveLocaleInPreferences ( final String preferencesPath , final String preferenceName ) { if ( Strings . isEmpty ( preferencesPath ) || Strings . isEmpty ( preferenceName ) ) { throw new GdxRuntimeException ( "Preference path and name cannot be empty! These are set automatically if you annotate a path to preference with @I18nBundle and pass a corrent path to the preferences." ) ; } final Preferences preferences = ApplicationPreferences . getPreferences ( preferencesPath ) ; preferences . putString ( preferenceName , fromLocale ( currentLocale . get ( ) ) ) ; preferences . flush ( ) ; }
Saves current locale in the selected preferences .