Translation:One says that German is an ugly language.
I think the "ke" indicates that there is a sub-sentence (here: conjunction or subjuction). I'm not sure if there is a strict rule for this in Esperanto, but in some other languages you would make a little pause where the comma is. My mother tongue is German. Unlike English it uses a lot of commas and it just "feels comfortable" where it is.
Anyway, the comma before "but" is right, isn't it? This is also a conjuction.
Perhaps it is a good idea to simply remember "ke" as a signal word for a good place to use a comma.