private static string LocaleToAppleString(TranslationLocale loc)
        {
            switch (loc)
            {
            // Apple uses Hans and Hant, rather than Cn and TW
            case TranslationLocale.zh_CN:
                return("zh-Hans");

            case TranslationLocale.zh_TW:
                return("zh-Hant");

            // Application Loader (and iTunes Connect) prefer these
            // languages to have a two-letter code
            // Discovered here:
            // http://kitefaster.com/2016/03/09/itunes-connect-api-app-store-and-corresponding-xcode-language-codes/
            case TranslationLocale.ko_KR:
            case TranslationLocale.da_DK:
            case TranslationLocale.th_TH:
            case TranslationLocale.ms_MY:
            case TranslationLocale.fi_FI:
            case TranslationLocale.sv_SE:
            case TranslationLocale.it_IT:
            case TranslationLocale.vi_VN:
            case TranslationLocale.tr_TR:
            case TranslationLocale.ja_JP:
            case TranslationLocale.el_GR:
            case TranslationLocale.id_ID:
            case TranslationLocale.no_NO:
                return(loc.ToString().Split('_')[0]);

            default:
                return(loc.ToString().Replace('_', '-'));
            }
        }
Exemplo n.º 2
0
        public LocalizedProductDescription AddDescription(TranslationLocale locale)
        {
            RemoveDescription(locale);
            var newDesc = new LocalizedProductDescription();

            newDesc.googleLocale = locale;
            descriptions.Add(newDesc);
            return(newDesc);
        }
Exemplo n.º 3
0
 public void RemoveDescription(TranslationLocale locale)
 {
     descriptions.RemoveAll((obj) => obj.googleLocale == locale);
 }
Exemplo n.º 4
0
 public LocalizedProductDescription GetOrCreateDescription(TranslationLocale locale)
 {
     return(GetDescription(locale) ?? AddDescription(locale));
 }
Exemplo n.º 5
0
 public LocalizedProductDescription GetDescription(TranslationLocale locale)
 {
     return(descriptions.Find((obj) => obj.googleLocale == locale));
 }
Exemplo n.º 6
0
 public static bool SupportedOnGoogle(this TranslationLocale locale)
 {
     return(GoogleLocales.Contains(locale));
 }