video file and two .srt files and language detection

Any questions? Need some help?
Post Reply
tempesta74
Posts: 1
Joined: 30 Oct 2015, 17:22

video file and two .srt files and language detection

Post by tempesta74 »

I've get lost searching in the forum, but nothing came up.
using the GUI, until the 4.2 version, FileBot recognised automatically the language of the .srt file (.eng or .ita)
then, it dropped the task.
That's ok, I'm still using the v4.2
but I'd like to update the version, so I searched for a solution for my very simple string

Code: Select all

{n.replaceTrailingBrackets()} - s{s.pad(2)}e{e.pad(2)} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')}{".$lang"}
the {".$lang"} part doesn't work.
I'm sure that the workaround it's just something related with "if condition", since I use english subtitles that contains the word "English" and italian subtitles with "ita" in it.
please, could someone point me in the right direction?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: video file and two .srt files

Post by rednoah »

You can check the current file name for certain patterns like so:

Code: Select all

{fn =~ /English/ ? '.eng' : '.ita'}
There's also the options of doing basic language detection, like counting occurrences of "The" in the subtitle text. There's some threads on how to do language detection in your format.
:idea: Please read the FAQ and How to Request Help.
Post Reply