| 1 | # -*- coding: utf8 -*- |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | def escape(s): |
|---|
| 5 | return s.replace("\\","\\\\") # test! |
|---|
| 6 | |
|---|
| 7 | lng = open(r"C:\Documents and Settings\Mariano\Escritorio\pg\oneclickinstaller\en.lng.wri") |
|---|
| 8 | |
|---|
| 9 | f = open(r"C:\Documents and Settings\Mariano\Escritorio\pg\oneclickinstaller\es.po","wb") |
|---|
| 10 | |
|---|
| 11 | for line in lng: |
|---|
| 12 | #import pdb; pdb.set_trace() |
|---|
| 13 | msg = line.split("=") |
|---|
| 14 | if len(msg)==2: |
|---|
| 15 | original = escape(msg[1]).encode("utf8").strip() |
|---|
| 16 | print original |
|---|
| 17 | translation = "" |
|---|
| 18 | f.write('msgid "%s"\n' % original ) |
|---|
| 19 | f.write('msgstr "%s"\n\n' % translation) |
|---|
| 20 | |
|---|
| 21 | f.close() |
|---|
| 22 | |
|---|