Created
May 20, 2014 14:04
-
-
Save johdah/a40b5e10cd78d2ab172a to your computer and use it in GitHub Desktop.
I18n helper - Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils; | |
/** | |
* Created by JohanD on 2014-05-20. | |
*/ | |
public class I18nHelper { | |
public static String getCollateSQL(String language) { | |
switch (language) { | |
case "cs": | |
return "COLLATE utf8_czech_ci"; | |
case "da": | |
case "no": | |
return "COLLATE utf8_danish_ci"; | |
case "eo": | |
return "COLLATE utf8_esperanto_ci"; | |
case "es": | |
return "COLLATE utf8_spanish2_ci"; | |
case "et": | |
return "COLLATE utf8_estonian_ci"; | |
case "fa": // Farsi/Persian | |
return "COLLATE utf8_persian_ci"; | |
case "hu": | |
return "COLLATE utf8_hungarian_ci"; | |
case "is": | |
return "COLLATE utf8_icelandic_ci"; | |
case "la": | |
return "COLLATE utf8_latvian_ci"; | |
case "lt": | |
return "COLLATE utf8_lithuanian_ci"; | |
case "pl": | |
return "COLLATE utf8_polish_ci"; | |
case "ro": | |
return "COLLATE utf8_romanian_ci"; | |
case "sk": | |
return "COLLATE utf8_slovak_ci"; | |
case "sl": | |
return "COLLATE utf8_slovenian_ci"; | |
case "sv": | |
case "fi": | |
return "COLLATE utf8_swedish_ci"; | |
case "tr": | |
return "COLLATE utf8_turkish_ci"; | |
default: | |
return "COLLATE utf8_general_ci"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment