Exemplo n.º 1
0
        private TranslatedSummaryState CalculateStatus(Assembly a, CultureInfo ci)
        {
            var fileName = LocalizedAssembly.TranslationFileName(a, ci);

            if (!System.IO.File.Exists(fileName))
            {
                return(TranslatedSummaryState.None);
            }

            var target = DescriptionManager.GetLocalizedAssembly(a, ci) !;

            CultureInfo defaultCulture = CultureInfo.GetCultureInfo(a.GetCustomAttribute <DefaultAssemblyCultureAttribute>().DefaultCulture);
            var         master         = DescriptionManager.GetLocalizedAssembly(a, defaultCulture) !;

            var result = TranslationSynchronizer.GetMergeChanges(target, master, new List <LocalizedAssembly>());

            if (result.Any())
            {
                return(TranslatedSummaryState.Pending);
            }

            return(TranslatedSummaryState.Completed);
        }
Exemplo n.º 2
0
        public TranslatedSummaryState Status(Lite <RoleEntity> role)
        {
            if (!System.IO.File.Exists(FileName))
            {
                return(TranslatedSummaryState.None);
            }

            var target = DescriptionManager.GetLocalizedAssembly(Assembly, CultureInfo);

            CultureInfo defaultCulture = CultureInfo.GetCultureInfo(Assembly.GetCustomAttribute <DefaultAssemblyCultureAttribute>().DefaultCulture);
            var         master         = DescriptionManager.GetLocalizedAssembly(Assembly, defaultCulture);

            var result = TranslationSynchronizer.GetMergeChanges(target, master, new List <LocalizedAssembly>());


            if (result.Any(r => role == null || TranslationLogic.GetCountNotLocalizedMemebers(role, CultureInfo, r.Type.Type) > 0))
            {
                return(TranslatedSummaryState.Pending);
            }


            return(TranslatedSummaryState.Completed);
        }