[KPhotoAlbum] Localization of category names

Tobias Leupold tobias.leupold at web.de
Sat Jun 28 11:40:18 BST 2014


Hi list!

I think I found a bug in the localization of standard category names.

DB::Category::standardCategories() represents a set of translated names for 
standard categories that can be used by DB::Category::text() so that "If one 
person from say Denmark sends a database to a person from say germany, then 
the title of People, Places, and Events will still be translated correct, when 
this function is used".

When creating a new database, this mechanism seems to be short-circuited by 
XMLDB::FileReader::readConfigFile(), as the default category names are 
translated and then stored, cf. lines 385ff:

	str = str.replace( QString::fromLatin1( "People" ), i18n( "People" ) );
	str = str.replace( QString::fromLatin1( "Places" ), i18n( "Places" ) );
	str = str.replace( QString::fromLatin1( "Events" ), i18n( "Events" ) );

Creating e. g. a new database with the locale set to German, I get a database 
containing the translated category names:

	<Category name="Ereignisse" ...
	<Category name="Orte" ...
	<Category name="Personen" ...

With these tree lines commented out, I get the un-translated category names in 
the database:

	<Category name="People" ...
	<Category name="Folder" ...
	<Category name="Tokens" ...

but still the translated ones in the GUI. So I think we should leave out those 
three lines, cf. 
https://github.com/l3u/kphotoalbum/commit/d726c08197709785c07d0c51916e0b1afe32d312

Tobias



More information about the Kphotoalbum mailing list