Yetişkin filmleri genellikle oyunculuktan ziyade fiziksel eyleme odaklanır. Peki neden birisi bu filmlere altyazı ekleme ihtiyacı duysun? Bunun birkaç nedeni vardır:
po4a is a command‑line utility that extracts translatable strings from many formats, including SRT.
# Install po4a (Debian/Ubuntu)
sudo apt-get install po4a
# Convert example.srt → example.pot (template)
po4a-gettextize -f srt -m example.srt -p example.pot
The resulting example.pot contains entries like: turkce altyazili po
#: example.srt:3
msgid "00:00:12,000 --> 00:00:15,000"
msgstr ""
#: example.srt:4
msgid "Welcome to the show."
msgstr ""
Note: The timing line is stored as a separate msgid. Some teams keep it as a comment instead:
#. 00:00:12,000 --> 00:00:15,000
msgid "Welcome to the show."
msgstr ""
Arama motoru verilerine göre, "turkce altyazili po" ifadesi aylık binlerce yerel arama almaktadır. Bu aramaları yapan kullanıcı profili genellikle şu özellikleri taşır: The resulting example
Bu talep, resmî olmayan çeviri topluluklarının ve altyazı sitelerinin ortaya çıkmasına neden olmuştur. Ancak bu içeriklerin büyük çoğunluğu lisanssız ve yasa dışı yollarla dağıtılmaktadır.
#!/usr/bin/env python3
import polib, sys, re
def srt_from_po(po_path, src_srt, out_srt):
po = polib.pofile(po_path)
src = open(src_srt, encoding='utf-8').read().splitlines()
out = []
i = 0
while i < len(src):
line = src[i].strip()
# Capture index line
if line.isdigit():
out.append(line) # index
i += 1
out.append(src[i]) # timing line
i += 1
# Caption text (could be multiple lines until empty line)
caption = []
while i < len(src) and src[i].strip():
caption.append(src[i])
i += 1
# Build msgid from original caption (joined with '\n')
msgid = "\n".join(caption)
entry = po.find(msgid)
if entry and entry.msgstr:
out.append(entry.msgstr)
else:
out.append(msgid) # fallback to source
out.append("") # blank line
i += 1
open(out_srt, 'w', encoding='utf-8').write("\n".join(out))
if __name__ == '__main__':
srt_from_po(sys.argv[1], sys.argv[2], sys.argv[3])
Run:
python3 po2srt.py turkish.po episode01.srt episode01.tr.srt
The resulting episode01.tr.srt is a UTF‑8 Turkish‑subtitle file ready for packaging.