Other source language in .po file

Hi all, 
I am working on an IT-EN .po file. The client now needs the text translated into German too and I would like to translate from EN (which is target language in the source file). Is there a way to change the .po so that the previous target language becomes the source?

The structure of the .po is:
#: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:50
msgid "Codice di verifica non corretto"
msgstr ""

#: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:51
msgid "Inserire il codice di verifica"
msgstr ""

#: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:52
msgid "Genera nuovo codice"
msgstr ""

#: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:67
msgid "La UserID è obbligatoria."
msgstr ""

 

Basically, I would like msgstr to go on the first row and be recognized as source.
Any chance this can be done?

 Thanks a lot in advance, 
Sandra

Parents
  • Hi Sandra,

    If it's really as simple a format as your post suggest then yes.

    First save the translated PO file from Studio. This gives you something like this I guess:

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:50
    msgid "Codice di verifica non corretto"
    msgstr "Incorrect verification code"

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:51
    msgid "Inserire il codice di verifica"
    msgstr "Enter the verification code"

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:52
    msgid "Genera nuovo codice"
    msgstr "Generate new code"

    Now use regex with a decent text editor to replace this (for example):

    msgid "Genera nuovo codice"
    msgstr "Generate new code"

    With this:

    msgid "Generate new code"
    msgstr ""

    So something like search for this:

    msgid\s".+?"\r\nmsgstr\s"(.+?)"

    Replace with this:

    msgid "$1"
    msgstr ""

    You may have to sort out the line breaks as I may have different ones to you with the copy paste stuff, but this worked in my editor.

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply
  • Hi Sandra,

    If it's really as simple a format as your post suggest then yes.

    First save the translated PO file from Studio. This gives you something like this I guess:

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:50
    msgid "Codice di verifica non corretto"
    msgstr "Incorrect verification code"

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:51
    msgid "Inserire il codice di verifica"
    msgstr "Enter the verification code"

    #: C:\MediaPro\Svil2015\web\SitoBet_INT\SitoBet\recpassword.aspx.cs:52
    msgid "Genera nuovo codice"
    msgstr "Generate new code"

    Now use regex with a decent text editor to replace this (for example):

    msgid "Genera nuovo codice"
    msgstr "Generate new code"

    With this:

    msgid "Generate new code"
    msgstr ""

    So something like search for this:

    msgid\s".+?"\r\nmsgstr\s"(.+?)"

    Replace with this:

    msgid "$1"
    msgstr ""

    You may have to sort out the line breaks as I may have different ones to you with the copy paste stuff, but this worked in my editor.

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Children