コード例 #1
0
        public static List <TranslatedTypeSummary> TranslationInstancesStatus()
        {
            var cultures = TranslationLogic.CurrentCultureInfos(DefaultCulture);

            return((from type in TranslateableRoutes.Keys
                    from ci in cultures
                    select new TranslatedTypeSummary
            {
                Type = type,
                CultureInfo = ci,
                State = ci.IsNeutralCulture && ci.Name != DefaultCulture.Name ? GetState(type, ci) : null,
            }).ToList());
        }
コード例 #2
0
        public static TypeInstancesChanges GetTypeInstanceChangesTranslated(ITranslator translator, Type type, CultureInfo targetCulture, out int totalInstances)
        {
            var cultures = TranslationLogic.CurrentCultureInfos(TranslatedInstanceLogic.DefaultCulture);

            cultures.Remove(targetCulture);

            var instances = TranslatedInstanceLogic.GetInstanceChanges(type, targetCulture, cultures);

            totalInstances = instances.Count;
            if (instances.Sum(a => a.TotalOriginalLength()) > MaxTotalSyncCharacters)
            {
                instances = instances.GroupsOf(a => a.TotalOriginalLength(), MaxTotalSyncCharacters).First().ToList();
            }

            return(TranslateInstances(translator, type, targetCulture, instances));
        }