Esempio n. 1
0
        private static bool areTranslationsMissing(Project project, DataRow row,
                                                   CommentVisibilityScope commentVisibilityScope)
        {
            var hasEmpty    = false;
            var hasNonEmpty = false;

            // AJ CHANGE
            // Don't check the comments column
            // Column 0=FileGroup checksum, column 1=Tag name.
            for (var i = 2; i < row.Table.Columns.Count -
                 (DataProcessing.CommentsAreVisible(project, row, commentVisibilityScope) ? 1 : 0); ++i)
            {
                var s = ConvertHelper.ToString(row[i], string.Empty);

                if (string.IsNullOrEmpty(s))
                {
                    hasEmpty = true;
                }
                else
                {
                    hasNonEmpty = true;
                }
            }

            return(hasEmpty && hasNonEmpty);
        }
Esempio n. 2
0
        // AJ CHANGE
        private static bool doesAutomaticTranslationsExist(
            Project project,
            DataRow row,
            CommentVisibilityScope commentVisibilityScope)
        {
            // Column 0=FileGroup checksum, column 1=Tag name.
            for (var i = 2; i < row.Table.Columns.Count -
                 (DataProcessing.CommentsAreVisible(project, row, commentVisibilityScope) ? 1 : 0); ++i)
            {
                var s = ConvertHelper.ToString(row[i], string.Empty);
                if (s.StartsWith(DefaultTranslatedPrefix))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 3
0
        private static bool hasPlaceholderMismatch(
            Project project,
            DataRow row,
            CommentVisibilityScope commentVisibilityScope)
        {
            // 2011-11-17, Uwe Keim.
            var neutralCode        = project == null ? @"en-US" : project.NeutralLanguageCode;
            var neutralColumnIndex = findColumnIndex(row.Table, neutralCode, 2);

            var columnCount = row.Table.Columns.Count;

            var s0 =
                columnCount > 0
                // Column 0=FileGroup checksum, column 1=Tag name.
                    ? ConvertHelper.ToString(row[neutralColumnIndex], string.Empty)
                    : string.Empty;
            var firstPlaceholderCount = ExtractPlaceholders(s0);

            // AJ CHANGE, skip the comments column
            // Column 0=FileGroup checksum, column 1=Tag name.
            for (var i = 2; i < columnCount -
                 (DataProcessing.CommentsAreVisible(project, row, commentVisibilityScope) ? 1 : 0); ++i)
            {
                if (i != neutralColumnIndex)
                {
                    var s = ConvertHelper.ToString(row[i], string.Empty);

                    // 2011-11-16, Uwe Keim: Only check if non-empty, non-default-language.
                    if (!string.IsNullOrEmpty(s))
                    {
                        var other = ExtractPlaceholders(s);

                        if (other != firstPlaceholderCount)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }