fire-eggs / FamilyLines

A free, open-source genealogy application to track, organize, and share your family history.
13 stars 1 forks source link

Statistics code builds strings on-the-fly #68

Open fire-eggs opened 7 years ago

fire-eggs commented 7 years ago

notonyournelly[CodePlex]
Two routines in Statistics.xaml.cs build strings on-the-fly using string concatenation.

The routines in question are DisplayStats() and Print().

Doing so is a Localization issue. Instead of string concatenation, a format string should be created in the string resource file and used via string.Format().

E.g. the line: Photos.Text = Properties.Resources.Photos + quot: quot + photos; should be replaced by: Photos.Text = string.Format(Properties.Resources.PhotosFormat, photos); where the string resource Properties.Resources.PhotosFormat would be (in English): quotPhotos: {0}quot.

This is a low-priority issue as any problem is unlikely to manifest in Western European languages. Should Family Lines be translated to a non-Western-European language, this issue will be more important.

fire-eggs commented 7 years ago

notonyournelly[CodePlex]
Alternatively, the label and value should be separated, e.g. the text Photos goes in one control and the number of photos goes in another control. Such a solution would be preferable if we were to actually create locale-specific XAML files for control/window layout.