Skip to content

DiffineStrings

The words both views put on the screen. DiffineCommonStrings, which the two tables under it extend.Flutter keeps one table, and this is the part of it both widgets read.

KeyEnglish default
beforeBefore
afterAfter
emptyNothing to compare yet.
identicalThe two are the same.
previousChangePrevious change
nextChangeNext change
changePositionChange {position} of {total}

What the document comparison adds. DiffineTextStrings, which is what TextDiff takes.Read by TextDiff.

KeyEnglish default
placeholderType or paste a document here.
addedAdded
removedRemoved
changedChanged
folded{lines} unchanged lines
expandShow {lines} unchanged lines
applyChangeTake this change into {label}
format{before} → {after}
mixedEndingsmixed
noFinalNewlineno final newline
languageSyntax highlighting
summary{changes} changes, {inserted} lines added, {deleted} lines removed
documentSize{label}: {characters} characters, {size}
searchFind
searchInFind in {label}
searchPreviousPrevious match
searchNextNext match
searchCloseClose find
searchPositionMatch {position} of {total}
searchEmptyNo matches
matchCaseMatch case
wholeWordWhole word
regexRegular expression
replaceReplace
replaceWithReplace with
replaceAllReplace all

What the picture comparison adds. DiffineImageStrings, which is what ImageDiff takes. DiffineStrings is the two together, for an application that keeps one table for both.Read by ImageDiff.

KeyEnglish default
imageSize{label}: {width} × {height}, {size}
imageSummary{regions} changed areas, {percent}% of the picture
chooseChoose an image
chooseInChoose an image for {label}
unsupportedThat file is not an image.
loadingOpening the picture
zoomOutZoom out
zoomInZoom in
zoomFitFit to the pane
zoomLevel{percent}%
fadeFade between the two
wipeDrag to wipe between the two
atAt
loupeMoveDrag to move the magnified pixels
loupeSizeDrag to show more pixels

added, removed, changed, summary, documentSize, changePosition, searchPosition, searchEmpty and imageSummary are read by a screen reader rather than shown. language names the editor's menu of languages to one.

The placeholders are filled in as follows. searchIn and chooseIn fill {label} with the name of the side the button belongs to, so two of the same button on one componentwidget are told apart. summary fills {changes}, {inserted} and {deleted} with the counts. documentSize fills {label} with the name of a side and {characters} and {size} with numbers already written in the reader's own language, and imageSize fills {width}, {height} and {size} the same way. imageSummary takes {regions} and {percent}, and zoomLevel takes {percent}. at is what goes before the coordinates under the magnified pixels, and loupeMove and loupeSize name the handle that moves that panel and the corner that shows more pixels in it. placeholder is what an empty field in the editor says.

strings is a partial table, so an application changing one word passes one word — Partial<DiffineTextStrings> on TextDiff and Partial<DiffineImageStrings> on ImageDiff.

strings is a whole DiffineStrings rather than a partial one, because Dart has no partial. Start from the locale's own and replace what you mean to change:

dart
TextDiff(
  before: saved,
  after: draft,
  strings: baseStringsFor(DiffineLocale.en).copyWith(before: 'Saved', after: 'Draft'),
);

Released under the MIT License