javascript - Create filter to translate

I have been trying for a while to translate strings(%s message, %s messages), but it is not possible to do it with PO editor, Loco translate, etc. because it just corrupts output, and the counter is not working properly.
So I found where that code is placed. By editing it manually I could see the results and it is working but, on the update, all changes will disappear so I have to create a filter.
Here is code that I have been trying to create filter for:
message_unread_count_text' => sprintf( _n( '%s message', '%s messages', $mgs_unread_count, 'front-end-pm' ), number_format_i18n( $mgs_unread_count ) )
I guess these few lines does not mean a lot to you, so I will link the whole code down here: https://www.codepile.net/pile/aVejNaLA
I would really appreciate your help!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: string literal contains an unescaped line break
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.