/**
 * Copyright (C) 2021 SIL International. All rights reserved.
 */

package com.tavultesoft.kmea;

import android.content.Context;

public class DisplayLanguages {
  private static final String TAG = "DisplayLanguages";
  public static final String displayLanguageKey = "DisplayLanguage";
  public static final String unspecifiedLocale = ""; // empty string for app to use device's default locale

  public static class DisplayLanguageType {
    String languageTag;
    String languageName;

    public DisplayLanguageType(String languageTag, String languageName) {
      this.languageTag = languageTag;
      this.languageName = languageName;
    }

    public String getLanguageTag() {
      return this.languageTag;
    }

    public String getLanguageName() {
      return this.languageName;
    }
  }

  // Display Language types (as named in translate.keyman.com)
  // Order doesn't matter since we're storing BCP-47 tags in the settings preference
  // Additional notes:
  // Java uses deprecated two-letter code "in" for Indonesian
  public static final DisplayLanguageType[] getDisplayLanguages(Context context) {
    DisplayLanguageType[] languages = {
      new DisplayLanguageType(unspecifiedLocale, context.getString(R.string.default_locale)),
      new DisplayLanguageType("am-ET", "አማርኛ (Amharic)"),
      new DisplayLanguageType("az-AZ", "Azərbaycanca (Azəricə)"),
      new DisplayLanguageType("en", "English"),
      new DisplayLanguageType("fr-FR", "French"),
      new DisplayLanguageType("in-ID", "Indonesian"),
      new DisplayLanguageType("de-DE", "German"),
      new DisplayLanguageType("km-KH", "Khmer"),
      new DisplayLanguageType("ann", "Obolo"),
      new DisplayLanguageType("ff-ZA", "Pulaar-Fulfulde") // or Fulah
    };
    return languages;
  }
}

@@ -1036,16 +1036,192 @@
 onesian%0A
+  //%0A  // Spanish (Latin America) folder is b+es+419 but the locale uses es-419%0A  // Reference: https://developer.android.com/guide/topics/resources/multilingual-support#postN%0A
   public
@@ -1597,24 +1597,102 @@
 %22English%22),%0A
+      new DisplayLanguageType(%22es-419%22, %22Espa%C3%B1ol (Spanish - Latin America)%22),%0A
       new Di

Add Spanish - Latin America