-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This script was used to import translation files from the old Subversion | ||
# repository on Google Code. | ||
# | ||
# http://tarski.googlecode.com/svn/translations/ | ||
# | ||
# Subversion repository layout: | ||
# | ||
# /translations/ | ||
# /translations/releases/{1.4...2.4} | ||
# /translations/trunk/ | ||
|
||
require 'pathname' | ||
require 'find' | ||
require 'fileutils' | ||
|
||
SVN_PATH = "http://tarski.googlecode.com/svn/translations/" | ||
|
||
THIS_DIR = Pathname.new(File.dirname(__FILE__)) | ||
|
||
TMP_DIR = THIS_DIR + "tmp" | ||
BIN_DIR = THIS_DIR + "bin" | ||
SRC_DIR = THIS_DIR + "src" | ||
|
||
# Check out the translation files from the Subversion repository | ||
`svn co #{SVN_PATH}releases tmp` | ||
`svn cp #{SVN_PATH}/trunk tmp/2.5` | ||
|
||
# Copy the files from the temporary directory to the correct location in the | ||
# new repository. It is assumed that the new directory structure already | ||
# exists, e.g. that there are bin/ and src/ directories with correctly numbered | ||
# version directories. | ||
Find.find(TMP_DIR) do |path| | ||
if FileTest.directory?(path) | ||
if File.basename(path)[0] == ?. | ||
Find.prune | ||
else | ||
next | ||
end | ||
else | ||
version = File.dirname(path).split("/").last | ||
ext = File.extname(path) | ||
name = File.basename(path) | ||
|
||
if ext == ".mo" | ||
FileUtils.cp(path, BIN_DIR + version + name) | ||
elsif ext == ".po" | ||
FileUtils.cp(path, SRC_DIR + version + name) | ||
end | ||
end | ||
end |