Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Locale; public class Main { /** * Get locale pairs. * @param source * @param target * @return In the pattern like, "ENUS-DEDE" */ public static String getLocalePairs(Locale source, Locale target) { String part1 = source.getLanguage() + source.getCountry(); String part2 = target.getLanguage() + target.getCountry(); return part1 + "-" + part2; } }