public String standardizeCode(String code) {
    // The default action is just to return the first 2 characters, converted to lower
    // case. We only need to special-case the ones where the native or anglicized version
    // of the name does not begin with the two code letters.
    String c = code.toLowerCase();
    
    if (c.length()==2) return c; // for efficiency
    
    if (c.equals("german")) return "de";
    if (c.equals("greek")) return "el";
    if (c.equals("spanish")) return "es";
    if (c.equals("dutch")) return "nl";
    if (c.equals("chinese")) return "zh";
    if (c.startsWith("por")) return "pt";
    if (c.startsWith("swe")) return "sv";
    if (c.startsWith("tur")) return "tr";

    return c.substring(0,1);
  }