getLanguageCode function

dynamic getLanguageCode(
  1. dynamic platformID,
  2. dynamic languageID,
  3. dynamic ltag
)

Implementation

getLanguageCode(platformID, languageID, ltag) {
    switch (platformID) {
        case 0:  // Unicode
            if (languageID == 0xFFFF) {
              return 'und';
            } else if (ltag != null) {
              return ltag[languageID];
            }

            break;

        case 1:  // Macintosh
            return macLanguages[languageID];

        case 3:  // Windows
            return windowsLanguages[languageID];
    }

    return null;
}