Am Dienstag, 16. Februar 2016, 18:27:23 schrieb Christian Dávid:

Hi,

> I noticed that in KMyMoney the filter strings for file dialogs are
> created "by hand", e.g. i18n("C++ sources (*.cpp *.cxx *.c++);;All
> files (*)"). So each of them must be translated. Alternatively
> something like
> 
> QMimeDatabase db;
> db.mimeTypeForName("text/x-c++src").filterString()

Just a guess but many application might not succeed in finding their 
MIME type in the db. They could provide an XML file for that, but this 
is quite a hassle compared to just writing a few characters. Also how 
can several mime types be represented? Like your example "C++ 
sources;;Allfiles".

>From the docs: "If the MIME type database cannot be found on the 
system, as is the case on most Windows, OS X, and iOS systems, Qt will 
use its own copy of it."
While this does not sound too bad, it at least gives the impression of 
a not too well working process.


> could be used to create these string lowering the burden on the
> translators and resulting in consistent translations for all
> mimetypes.

Thank you for thinking about the translators. :)

I did not know about QMimeDatabase until now. On my system I have 930 
MIME types in the db. Just for you to compare with yours.

To me this looks like a nice way to have unified strings for file 
types and I would also like to know if there are things speaking 
against using it.

Regards,
Frederik

Reply via email to