Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created December 19, 2014 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dulichan/ef99784e5a6e5332e5c1 to your computer and use it in GitHub Desktop.
Save dulichan/ef99784e5a6e5332e5c1 to your computer and use it in GitHub Desktop.
Proposal idea for a localization manager
/*
The objective of this class is to manage localization options in CDM.
2 types Use cases:-
1) Localize the product based on a configuration
2) Localize components based on user preference.
Use case 2:- Localize the license file
*/
public class LocalizationManagerUtil {
private static final Log log = LogFactory.getLog(LocalizationManagerUtil.class);
private static Locale globalLocale = new Locale.Builder().setLanguage("en").setRegion("US").build();
/*
Get the localized file from the registry based on the fileName and locale. If locale is not passed
global locale will be used
*/
public static void getLocalizedFile(String fileName, Locale locale){
}
/*
Get the localized string based on a namespace (a product name?) , key and locale. If locale is not passed
global locale will be used
*/
public static void getLocalizedString(String namespace, String key, Locale locale){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment