Skip to content

Instantly share code, notes, and snippets.

@filipebarcos
Created February 5, 2016 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipebarcos/e3dbf5d4f961876a8830 to your computer and use it in GitHub Desktop.
Save filipebarcos/e3dbf5d4f961876a8830 to your computer and use it in GitHub Desktop.
Localize SRT files (pt-br). Rename all SRT files in nested folders to add `pt-br` in the end.
#!/usr/bin/env ruby
Dir.glob("#{Dir.pwd}/**/*.srt").each do |file|
newfile_name = file.sub(/\.srt$/, ".pt-br.srt")
File.rename(file, newfile_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment