String transformToLocaleCode(String input) { // Replace spaces with underscores and convert to uppercase return input.replaceAll(' ', '_').toUpperCase(); }