Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name="Credits pour MLP Subtitles"
- script_description="Rajoute les crédits à la fin des sous-titres"
- script_author = "Max le Fou, fix by Siapran"
- script_version = "1.0"
- function macro_function(subtitle, selected)
- dialog_config=
- {
- {
- class="dropdown", name="lang",
- x=0, y=0, width=1, height=1,
- items={"English", "French"},
- value="Langage"
- },
- {
- class="stringedit", name="transcript",
- x=0, y=1, width=1, height=1,
- value="entrer noms ici"
- },
- {
- class="stringedit", name="traduc",
- x=0, y=2, width=1, height=1,
- value="entrer noms ici"
- },
- {
- class="stringedit", name="sync",
- x=0, y=3, width=1, height=1,
- value="entrer noms ici"
- },
- {
- class="stringedit", name="misc",
- x=0, y=4, width=1, height=1,
- value="GoFish, Shujaa"
- },
- {
- class="floatedit", name="temps",
- x=0, y=5, width=1, height=1,
- value=0
- }
- }
- local meta, styles = karaskel.collect_head(subtitles, false)
- local num_lines = #subtitles
- pressed, results = aegisub.dialog.display(dialog_config)
- if pressed=="Cancel" then
- aegisub.cancel()
- end
- if lang=="English" then
- begintitle = "Subtitled by MLPSubtitles"
- transtitle = "Transcript:"
- tradtitle = "Translation:"
- synctitle = "Synchronization:"
- misctitle = "Misc:"
- else
- begintitle = "Sous-titré par MLPSubtitles"
- transtitle = "Transcription :"
- tradtitle = "Traduction :"
- synctitle = "Synchronisation :"
- misctitle = "Autres :"
- end
- lineText = {
- begintitle,
- "http://www.mlpsubtitles.com/",
- transtitle .. " " .. results["transcript"],
- tradtitle .. " " .. results["traduc"],
- synctitle .. " " .. results["sync"],
- misctitle .. " " .. results["misc"]
- }
- local line
- for i=1, #lineText do
- karaskel.preproc_line(subtitles, meta, styles, line)
- line.start_time = results["temps"] + (i-1)*2000
- line.end_time = results["temps"] + i*2000-100
- line.text = lineText[i]
- subtitles.append(line)
- end
- aegisub.set_undo_point(credits_MLP)
- return selected
- end
- aegisub.register_macro(script_name, script_description, macro_function)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement