I think I found a cause for the "#~" comments (in local files). Note that this is only an explaination of what might cause them to be inserted into files by gettext tools, not a reason they are showing up on Rosetta.

One cause seems to be if msgid strings are removed. In my local files I have just removed one translated string. When I ran the gettext tools to update the .po files, I find that the removed string (along with the translation) is now commented out at the bottom of the file, eg:

When we do the export, our code was removing the white space from the end of the multiline msgid:

Original:

msgid ""
"Please select a key size in bits. The cipher you have chosen\n"
"supports sizes from %i to %i bits in increments of %i bits.\n"
"For example: "

Our version:

msgid ""
"Please select a key size in bits. The cipher you have chosen\n"
"supports sizes from %i to %i bits in increments of %i bits.\n"
"For example:"

If you look at the last line, the "For example:" is missing a white space at the end. That caused that the process that does the merge with the template thought that it was a different msgid that does not exists inside the template and thus it marked it that way, as obsolete.