Community
Participate
Working Groups
In a few places within PDE (like EnvironmentSection and the target platform preference page), we have to fetch the available locales. We have boilerplate code like this: private static String[] getLocales() { Locale[] locales = Locale.getAvailableLocales(); String[] result = new String[locales.length]; for (int i = 0; i < locales.length; i++) { Locale locale = locales[i]; StringBuffer buffer = new StringBuffer(); buffer.append(locale.toString()); buffer.append(" - "); //$NON-NLS-1$ buffer.append(locale.getDisplayName()); result[i] = buffer.toString(); } return result; } We should create a utility method somewhere for this.
Created attachment 92093 [details] Patch I need my daily patch, Chris :p
Thanks!!
Thanks for the patch Ben, nice and elegant ;) It's good to have the code in PDE be cleaned up here and there.