gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
| 3 | * Copyright (c) 2008 Eclipse Foundation and others. |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Eclipse Foundation - Initial API and implementation |
droy | 133e746 | 2008-05-13 17:37:24 +0000 | [diff] [blame] | 11 | * Motoki MORT mori-m@mxa.nes.nec.co.jp - patch, bug 227366 |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 12 | * Kit Lo (IBM) - patch, bug 217339, generate pseudo translations language packs |
| 13 | * Kit Lo (IBM) - patch, bug 234430, need language packs by means of other than update site |
kitlo | 7f52267 | 2008-10-21 14:15:54 +0000 | [diff] [blame] | 14 | * Kit Lo (IBM) - patch, bug 251536, newline char missing after copyright comment on first line |
kitlo | 1173dbd | 2008-10-21 15:58:36 +0000 | [diff] [blame] | 15 | * Kit Lo (IBM) - patch, bug 238580, language packs should not include strings that are marked "non-translatable" |
kitlo | 5c9da71 | 2008-10-27 12:45:40 +0000 | [diff] [blame] | 16 | * Kit Lo (IBM) - patch, bug 252140, Illegal token characters in babel fragment names |
atoulme | dbda427 | 2009-01-20 06:04:22 +0000 | [diff] [blame] | 17 | * Antoine Toulme (Intalio, Inc) - patch, bug 256430, Fragments with no host jeopardize Eclipse installation |
kitlo | 47df0c6 | 2009-01-22 15:16:18 +0000 | [diff] [blame] | 18 | * Kit Lo (IBM) - patch, bug 261739, Inconsistent use of language names |
kitlo | 8d7c053 | 2009-03-14 23:57:49 +0000 | [diff] [blame] | 19 | * Sean Flanigan (Red Hat) - patch, bug 261584, wrong output folder |
kitlo | cc40503 | 2009-04-04 01:10:30 +0000 | [diff] [blame] | 20 | * Kit Lo (IBM) - patch, bug 270456, Unable to use Babel PTT to verify PDE in the eclipse SDK |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 21 | *******************************************************************************/ |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 22 | |
| 23 | /* |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 24 | * Documentation: http://wiki.eclipse.org/Babel_/_Server_Tool_Specification#Outputs |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 25 | */ |
atoulme | 3fa5f5c | 2009-01-20 21:26:16 +0000 | [diff] [blame] | 26 | define("METADATA_GENERATOR_LOCATION", "/home/genie/eclipse"); // you might want to read this value from a config file. Not sure yet. |
gobrien | b854dcb | 2008-01-30 18:50:45 +0000 | [diff] [blame] | 27 | |
droy | aa17250 | 2009-05-06 20:50:07 +0000 | [diff] [blame] | 28 | ini_set("memory_limit", "512M"); |
atoulme | 3ac5261 | 2009-02-02 13:14:39 +0000 | [diff] [blame] | 29 | require(dirname(__FILE__) . "/../system/backend_functions.php"); |
atoulme | 12882d5 | 2009-01-26 18:39:17 +0000 | [diff] [blame] | 30 | require(dirname(__FILE__) . "/../system/dbconnection.class.php"); |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 31 | |
| 32 | # There is no easy way to sort "galileo", "ganymede", and "europa" in the correct order we want without |
| 33 | # modifying the release_train_projects table. |
| 34 | # |
| 35 | # Here is a temporary fix to display train versions in most recent release order until we have a permanent solution. |
| 36 | $train_result = array("galileo" => "3.5.0", "ganymede" => "3.4.0", "europa" => "3.3.0"); |
| 37 | |
| 38 | # Command-line parameter for the release train |
| 39 | # bug 272958 |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 40 | # b: build id |
| 41 | # t: (optional: train id) |
| 42 | |
| 43 | $options = getopt("b:t:"); |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 44 | $argv_train = ""; |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 45 | if(isset($options['t'])) { |
| 46 | $argv_train = $options['t']; |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 47 | if(array_key_exists($argv_train, $train_result)) { |
| 48 | # Picked a valid train .. remove all others |
| 49 | foreach ($train_result as $train_id => $train_version) { |
| 50 | if($train_id != $argv_train) { |
| 51 | unset($train_result[$train_id]); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 57 | $buildid = ""; |
| 58 | if(!isset($options['b'])) { |
| 59 | usage(); |
| 60 | exit(); |
| 61 | } |
| 62 | else { |
| 63 | $buildid = $options['b']; |
| 64 | } |
| 65 | |
| 66 | |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 67 | |
kitlo | 399df20 | 2008-09-30 15:32:25 +0000 | [diff] [blame] | 68 | $dbc = new DBConnection(); |
droy | b6e25c7 | 2008-07-18 13:01:13 +0000 | [diff] [blame] | 69 | |
atoulme | 3ac5261 | 2009-02-02 13:14:39 +0000 | [diff] [blame] | 70 | $work_dir = $addon->callHook('babel_working'); |
atoulme | 12882d5 | 2009-01-26 18:39:17 +0000 | [diff] [blame] | 71 | |
atoulme | 3ac5261 | 2009-02-02 13:14:39 +0000 | [diff] [blame] | 72 | global $addon; |
| 73 | $context = $addon->callHook('context'); |
gobrien | b854dcb | 2008-01-30 18:50:45 +0000 | [diff] [blame] | 74 | |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 75 | $work_context_dir = $work_dir . $context . "/"; |
| 76 | $tmp_dir = $work_context_dir . "tmp/"; |
| 77 | $babel_language_packs_dir = $work_context_dir . "babel_language_packs/"; |
| 78 | $output_dir = $work_context_dir . "output/"; |
atoulme | 3ac5261 | 2009-02-02 13:14:39 +0000 | [diff] [blame] | 79 | $source_files_dir = dirname(__FILE__) . "/source_files_for_generate/"; |
gobrien | b854dcb | 2008-01-30 18:50:45 +0000 | [diff] [blame] | 80 | |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 81 | $leader = ". . "; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 82 | $timestamp = date("Ymdhis"); |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 83 | |
droy | d157aac | 2008-10-07 21:14:33 +0000 | [diff] [blame] | 84 | $rm_command = "rm -rf $work_dir" . "*"; |
| 85 | exec($rm_command); |
droy | 082976e | 2008-10-07 21:02:23 +0000 | [diff] [blame] | 86 | exec("mkdir -p $output_dir"); |
| 87 | |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 88 | |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 89 | echo "Requested builds: "; |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 90 | foreach ($train_result as $train_id => $train_version) { |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 91 | echo $train_id . " "; |
| 92 | } |
| 93 | echo "\n"; |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 94 | |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 95 | # Loop through the trains |
| 96 | foreach ($train_result as $train_id => $train_version) { |
| 97 | |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 98 | #$train_result = mysql_query("SELECT DISTINCT train_id FROM release_train_projects ORDER BY train_id DESC"); |
| 99 | #while (($train_row = mysql_fetch_assoc($train_result)) != null) { |
| 100 | # $train_id = $train_row['train_id']; |
| 101 | # $train_version = "3.5.0"; |
| 102 | # if (strcmp($train_id, "ganymede") == 0) { |
| 103 | # $train_version = "3.4.0"; |
| 104 | # } |
| 105 | # if (strcmp($train_id, "europa") == 0) { |
| 106 | # $train_version = "3.3.0"; |
| 107 | # } |
| 108 | |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 109 | echo "Generating update site for: $train_id\n"; |
| 110 | $dbh = $dbc->connect(); |
| 111 | |
| 112 | /* |
| 113 | * Create language pack links file |
| 114 | */ |
| 115 | exec("mkdir -p $babel_language_packs_dir"); |
| 116 | $language_pack_links_file = fopen("${babel_language_packs_dir}${train_id}.php", "w"); |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 117 | fwrite($language_pack_links_file, "<?php\n"); |
| 118 | # copy page_header.html here |
| 119 | $header = file_get_contents("${source_files_dir}page_header.html"); |
| 120 | fwrite($language_pack_links_file, $header); |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 121 | fwrite($language_pack_links_file, "\n\t<h1>Babel Language Packs for ${train_id}</h1>" . |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 122 | "\n\t<h2>Build ID: $buildid</h2>" . |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 123 | "\n\t<p>The following language packs are based on the community translations entered into the <a href='http://babel.eclipse.org/'>Babel Translation Tool</a>, and may not be complete or entirely accurate. If you find missing or incorrect translations, please use the <a href='http://babel.eclipse.org/'>Babel Translation Tool</a> to update them." . |
| 124 | "\n\tAll downloads are provided under the terms and conditions of the <a href='http://www.eclipse.org/legal/epl/notice.php'>Eclipse Foundation Software User Agreement</a> unless otherwise specified.</p>"); |
| 125 | |
| 126 | |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 127 | $train_version_timestamp = "$train_version.v$timestamp"; |
| 128 | $site_xml = ""; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 129 | |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 130 | $output_dir_for_train = $output_dir . $train_id . "/"; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 131 | exec("mkdir $output_dir_for_train"); |
| 132 | exec("mkdir ${output_dir_for_train}features/"); |
| 133 | exec("mkdir ${output_dir_for_train}plugins/"); |
| 134 | |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 135 | fwrite($language_pack_links_file, "\n\t<h3>Release Train: $train_id</h3>\n\t<ul>"); |
droy | 6886461 | 2009-04-14 15:44:05 +0000 | [diff] [blame] | 136 | |
| 137 | $sql = "SELECT language_id, iso_code, IF(locale <> '', CONCAT(CONCAT(CONCAT(name, ' ('), locale), ')'), name) as name, is_active, IF(language_id = 1,1,0) AS sorthack FROM languages ORDER BY sorthack, name ASC"; |
| 138 | $language_result = mysql_query($sql); |
droy | b3ff274 | 2009-04-08 19:28:32 +0000 | [diff] [blame] | 139 | if($language_result === FALSE) { |
| 140 | # we may have lost the database connection.with our shell-outs |
| 141 | # bug 271685 |
| 142 | $dbh = $dbc->connect(); |
droy | 6886461 | 2009-04-14 15:44:05 +0000 | [diff] [blame] | 143 | $language_result = mysql_query($sql); |
droy | b3ff274 | 2009-04-08 19:28:32 +0000 | [diff] [blame] | 144 | } |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 145 | while (($language_row = mysql_fetch_assoc($language_result)) != null) { |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 146 | $language_name = $language_row['name']; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 147 | $language_iso = $language_row['iso_code']; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 148 | $language_id = $language_row['language_id']; |
| 149 | if (strcmp($language_iso, "en") == 0) { |
| 150 | $language_iso = "en_AA"; |
| 151 | $language_name = "Pseudo Translations"; |
| 152 | } |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 153 | |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 154 | echo "${leader}Generating language pack for $train_id - $language_name ($language_iso) (language_id=" . $language_id . ")\n"; |
| 155 | |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 156 | /* |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 157 | * Determine which plug-ins need to be in this language pack. |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 158 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 159 | if (strcmp($language_iso, "en_AA") == 0) { |
| 160 | $file_result = mysql_query("SELECT DISTINCT f.project_id, f.version, f.file_id, f.name |
| 161 | FROM files AS f |
| 162 | INNER JOIN strings AS s ON f.file_id = s.file_id |
| 163 | INNER JOIN release_train_projects as v ON (f.project_id = v.project_id AND f.version = v.version) |
| 164 | WHERE f.is_active |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 165 | AND v.train_id = '" . $train_id . "'"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 166 | } else { |
| 167 | $file_result = mysql_query("SELECT DISTINCT f.project_id, f.version, f.file_id, f.name |
| 168 | FROM files AS f |
| 169 | INNER JOIN strings AS s ON f.file_id = s.file_id |
| 170 | INNER JOIN translations AS t ON (s.string_id = t.string_id AND t.is_active) |
| 171 | INNER JOIN release_train_projects as v ON (f.project_id = v.project_id AND f.version = v.version) |
| 172 | WHERE t.language_id = " . $language_id . " |
| 173 | AND f.is_active |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 174 | AND v.train_id = '" . $train_id . "'"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 175 | } |
| 176 | |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 177 | $plugins = array(); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 178 | $projects = array(); |
| 179 | $project_versions = array(); |
| 180 | $pseudo_translations_indexes = array(); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 181 | while (($file_row = mysql_fetch_assoc($file_result)) != null) { |
| 182 | # save original filename |
| 183 | $file_row['origname'] = $file_row['name']; |
| 184 | |
droy | 02c430a | 2008-06-02 19:42:08 +0000 | [diff] [blame] | 185 | # strip useless CVS structure before the plugin name (bug 221675 c14): |
| 186 | $pattern = '/^([a-zA-Z0-9\/_-])+\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)(.*)\.properties$/i'; |
| 187 | $replace = '${2}.${3}${4}.properties'; |
| 188 | $file_row['name'] = preg_replace($pattern, $replace, $file_row['name']); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 189 | |
droy | 02c430a | 2008-06-02 19:42:08 +0000 | [diff] [blame] | 190 | # strip source folder (bug 221675) (org.eclipse.plugin/source_folder/org/eclipse/plugin) |
kitlo | 8d7c053 | 2009-03-14 23:57:49 +0000 | [diff] [blame] | 191 | /* |
| 192 | $pattern = |
| 193 | '/^ |
| 194 | ([a-zA-Z0-9_-]+)\. # \1 org. |
| 195 | ([a-zA-Z0-9_-]+)\. # \2 eclipse. |
| 196 | ([a-zA-Z0-9\._-]+) # \3 datatools.connectivity |
| 197 | (.*)\/ # \4 \/plugins\/ |
| 198 | (\1) # \5 org |
| 199 | ([\.\/]) # \6 . |
| 200 | (\2) # \7 eclipse |
| 201 | ([\.\/]) # \8 . |
| 202 | (.*) # \9 datatools.connectivity.ui\/plugin |
| 203 | \.properties # .properties |
| 204 | $/ix |
| 205 | '; |
droy | 02c430a | 2008-06-02 19:42:08 +0000 | [diff] [blame] | 206 | $replace = '${1}.${2}.${3}/${5}${6}${7}${8}${9}.properties'; |
kitlo | 8d7c053 | 2009-03-14 23:57:49 +0000 | [diff] [blame] | 207 | */ |
| 208 | |
| 209 | # fix output folder (bug 261584) |
| 210 | $pattern = |
| 211 | '/^ |
| 212 | (.*\/)? # \1 optional outer directories |
| 213 | ([a-z]+) # \2 org|com|etc |
| 214 | [.] # dot |
| 215 | ([^\/]+) # \3 plugin id except org.|com. |
| 216 | \/ # slash |
| 217 | (.*?\/)? # \4 optional src\/, src\/main\/ etc |
| 218 | # \5 resource path (pathname inside resulting jar) |
| 219 | # (a) within a org|com directory, or |
| 220 | # (b) in plugin root dir. |
| 221 | (\2\/.*[.]properties| # org|com\/anything.properties |
| 222 | [^\/]+[.]properties) # eg plugin.properties |
| 223 | $/ix'; |
| 224 | $replace = '$2.$3/$5'; |
| 225 | |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 226 | $file_row['name'] = preg_replace($pattern, $replace, $file_row['name']); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 227 | |
| 228 | if (preg_match("/^([a-zA-Z0-9\.]+)\/(.*)$/", $file_row['name'], $matches)) { |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 229 | $file_row['subname'] = $matches[2]; |
| 230 | $plugins[$matches[1]][] = $file_row; |
| 231 | } else { |
| 232 | echo " WARNING: no plug-in name found in file " . $file_row['file_id'] . " \"" . $file_row['name'] . "\"\n"; |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 233 | } |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 234 | } |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 235 | |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 236 | /* |
| 237 | * Generate one plug-in fragment for each plug-in |
| 238 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 239 | foreach ($plugins as $plugin_name => $plugin_row) { |
| 240 | echo "${leader}${leader}Generating plug-in fragment $plugin_name\n"; |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 241 | /* |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 242 | * Clean and create the temporary directory |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 243 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 244 | if (file_exists($tmp_dir)) { |
| 245 | exec("rm -rf $tmp_dir; mkdir $tmp_dir"); |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 246 | } else { |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 247 | exec("mkdir $tmp_dir"); |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 248 | } |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 249 | /* |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 250 | * Generate each *.properties file |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 251 | */ |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 252 | foreach ($plugin_row as $properties_file) { |
| 253 | /* |
| 254 | * Convert the filename to *_lang.properties, e.g., foo_fr.properties |
| 255 | */ |
| 256 | $filename = $properties_file['subname']; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 257 | if (preg_match( "/^(.*)\.properties$/", $filename, $matches)) { |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 258 | $filename = $matches[1] . '_' . $language_iso . '.properties'; |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 259 | } |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 260 | echo "${leader}${leader}${leader}Generating properties file $filename (file_id=" . $properties_file['file_id'] . ")\n"; |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 261 | /* |
| 262 | * Create any needed sub-directories |
| 263 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 264 | $fullpath = $tmp_dir . $filename; |
| 265 | preg_match("/^((.*)\/)?(.+?)$/", $fullpath, $matches); |
| 266 | exec("mkdir -p \"" . $matches[1] . "\""); |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 267 | /* |
| 268 | * Start writing to the file |
| 269 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 270 | $outp = fopen($fullpath, "w"); |
kitlo | c42941d | 2008-11-20 15:33:00 +0000 | [diff] [blame] | 271 | fwrite($outp, "# Copyright by many contributors; see http://babel.eclipse.org/"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 272 | if (strcmp($language_iso, "en_AA") == 0) { |
| 273 | $sql = "SELECT string_id, name, value FROM strings WHERE file_id = " . $properties_file['file_id'] . |
| 274 | " AND is_active AND non_translatable = 0"; |
| 275 | $strings_result = mysql_query($sql); |
| 276 | while (($strings_row = mysql_fetch_assoc($strings_result)) != null) { |
kitlo | cc40503 | 2009-04-04 01:10:30 +0000 | [diff] [blame] | 277 | /* Check for value starting with form tag (bug 270456) */ |
| 278 | if (preg_match("/^(<form>)(.*)/i", $strings_row['value'], $matches)) { |
| 279 | $pattern = "/^(<form>)(.*)/i"; |
| 280 | $replace = "$1" . "<p>" . $properties_file['project_id'] . $strings_row['string_id'] . ":" . "</p>" . "$2"; |
| 281 | $strings_row['value'] = preg_replace($pattern, $replace, $strings_row['value']); |
| 282 | $outp_line = "\n" . $strings_row['name'] . "=" . $strings_row['value']; |
| 283 | } else { |
| 284 | $outp_line = "\n" . $strings_row['name'] . "=" . $properties_file['project_id'] . $strings_row['string_id'] . |
| 285 | ":" . $strings_row['value']; |
| 286 | } |
| 287 | fwrite($outp, $outp_line); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 288 | |
| 289 | $value = htmlspecialchars($strings_row['value']); |
| 290 | if (strlen($value) > 100) { |
| 291 | $value = substr($value, 0, 100) . " ..."; |
| 292 | } |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 293 | $pseudo_translations_indexes[$properties_file['project_id']][] = "\n\t\t<li><a href=\"http://babel.eclipse.org/babel/translate.php?project=" . |
| 294 | $properties_file['project_id'] . "&version=" . $properties_file['version'] . "&file=" . |
| 295 | $properties_file['origname'] . "&string=" . $strings_row['name'] . "\">" . |
| 296 | $properties_file['project_id'] . $strings_row['string_id'] . "</a> " . $value . "</li>"; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 297 | } |
| 298 | } else { |
| 299 | $sql = "SELECT |
| 300 | strings.name AS 'key', |
| 301 | strings.value AS orig, |
| 302 | translations.value AS trans |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 303 | FROM strings, translations |
| 304 | WHERE strings.string_id = translations.string_id |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 305 | AND strings.file_id = " . $properties_file['file_id'] . " |
kitlo | 1173dbd | 2008-10-21 15:58:36 +0000 | [diff] [blame] | 306 | AND strings.is_active |
| 307 | AND strings.non_translatable = 0 |
| 308 | AND translations.language_id = " . $language_id . " |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 309 | AND translations.is_active"; |
| 310 | $strings_result = mysql_query($sql); |
| 311 | while (($strings_row = mysql_fetch_assoc($strings_result)) != null) { |
kitlo | 7f52267 | 2008-10-21 14:15:54 +0000 | [diff] [blame] | 312 | fwrite($outp, "\n" . $strings_row['key'] . "="); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 313 | # echo "${leader1S}${leaderS}${leaderS}${leaderS}" . $strings_row['key'] . "="; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 314 | if ($strings_row['trans']) { |
| 315 | # json_encode returns the string with quotes fore and aft. Need to strip them. |
| 316 | # $tr_string = preg_replace('/^"(.*)"$/', '${1}', json_encode($strings_row['trans'])); |
| 317 | # $tr_string = str_replace('\\\\', '\\', $tr_string); |
| 318 | $tr_string = toescapedunicode($strings_row['trans']); |
| 319 | fwrite($outp, $tr_string); |
| 320 | # echo $strings_row['trans']; |
| 321 | } else { |
| 322 | fwrite($outp, $strings_row['orig']); |
| 323 | } |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 324 | } |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 325 | } |
| 326 | /* |
| 327 | * Finish the properties file |
| 328 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 329 | fclose($outp); |
| 330 | echo "${leader}${leader}${leader}Completed properties file $filename\n"; |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 331 | } |
| 332 | /* |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 333 | * Copy in the various legal files |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 334 | */ |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 335 | exec("cp ${source_files_dir}about.html $tmp_dir"); |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 336 | /* |
| 337 | * Generate the META-INF/MANIFEST.MF file |
| 338 | */ |
| 339 | $parent_plugin_id = $plugin_name; |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 340 | $project_id = $properties_file['project_id']; |
kitlo | 5c9da71 | 2008-10-27 12:45:40 +0000 | [diff] [blame] | 341 | $fragment_id = "$parent_plugin_id.nl_$language_iso"; |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 342 | $fragment_filename = "${fragment_id}_$train_version_timestamp.jar"; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 343 | |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 344 | $plugins[$plugin_name]['id'] = $fragment_id; |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 345 | $plugins[$plugin_name]['version'] = $train_version_timestamp; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 346 | |
| 347 | exec("mkdir $tmp_dir/META-INF" ); |
| 348 | $outp = fopen("$tmp_dir/META-INF/MANIFEST.MF", "w"); |
| 349 | fwrite($outp, "Manifest-Version: 1.0\n"); |
| 350 | fwrite($outp, "Bundle-Name: $parent_plugin_id $language_name NLS Support\n"); |
| 351 | fwrite($outp, "Bundle-SymbolicName: $fragment_id ;singleton=true\n"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 352 | fwrite($outp, "Bundle-Version: $train_version_timestamp\n"); |
| 353 | fwrite($outp, "Bundle-Vendor: Eclipse.org\n"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 354 | fwrite($outp, "Fragment-Host: $parent_plugin_id\n"); |
| 355 | fclose($outp); |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 356 | /* |
| 357 | * Jar up this directory as the fragment plug-in jar |
| 358 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 359 | system("cd $tmp_dir; jar cfM ${output_dir_for_train}plugins/$fragment_filename ."); |
| 360 | echo "${leader}${leader}Completed plug-in fragment $plugin_name\n"; |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 361 | |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 362 | $projects[$project_id][] = $fragment_id; |
| 363 | $project_versions[$project_id] = $properties_file['version']; |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 364 | } |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 365 | if (sizeof($projects) > 0) { |
| 366 | $site_xml .= "\n\t<category-def name=\"Babel Language Packs in $language_name\" label=\"Babel Language Packs in $language_name\">"; |
| 367 | $site_xml .= "\n\t\t<description>Babel Language Packs in $language_name</description>"; |
| 368 | $site_xml .= "\n\t</category-def>"; |
| 369 | |
| 370 | fwrite($language_pack_links_file, "\n\t\t<h4>Language: $language_name</h4>"); |
| 371 | } |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 372 | foreach ($projects as $project_id => $fragment_ids) { |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 373 | fwrite($language_pack_links_file, "\n\t\t<ul>"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 374 | /* |
| 375 | * Sort fragment names |
| 376 | */ |
| 377 | asort($fragment_ids); |
| 378 | /* |
| 379 | * Create ${babel_language_packs_dir}tmp |
| 380 | */ |
| 381 | exec("mkdir -p ${babel_language_packs_dir}tmp/eclipse/features"); |
| 382 | exec("mkdir -p ${babel_language_packs_dir}tmp/eclipse/plugins"); |
| 383 | /* |
| 384 | * Clean and create the temporary directory |
| 385 | */ |
| 386 | if (file_exists($tmp_dir)) { |
| 387 | exec("rm -rf $tmp_dir; mkdir $tmp_dir"); |
| 388 | } else { |
| 389 | exec("mkdir $tmp_dir"); |
| 390 | } |
| 391 | /* |
| 392 | * Create the feature.xml |
| 393 | * |
| 394 | * TODO <url><update label=... url=... and <url><discovery label=... url=... are not implemented |
| 395 | * |
| 396 | * <url> |
| 397 | * <update label="%updateSiteName" url="http://update.eclipse.org/updates/3.2" /> |
| 398 | * <discovery label="%updateSiteName" url="http://update.eclipse.org/updates/3.2" /> |
| 399 | * </url> |
| 400 | */ |
kitlo | 5c9da71 | 2008-10-27 12:45:40 +0000 | [diff] [blame] | 401 | $feature_id = "org.eclipse.babel.nls_${project_id}_$language_iso"; |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 402 | $feature_filename = "${feature_id}_$train_version_timestamp.jar"; |
| 403 | |
| 404 | $project_version = $project_versions[$project_id]; |
| 405 | $sql = "SELECT pct_complete |
| 406 | FROM project_progress |
| 407 | WHERE project_id = \"$project_id\" |
| 408 | AND version = \"$project_version\" |
| 409 | AND language_id = $language_id"; |
| 410 | $project_pct_complete_result = mysql_query($sql); |
| 411 | $project_pct_complete = mysql_result($project_pct_complete_result, 0); |
| 412 | if (strcmp($language_iso, "en_AA") == 0) { |
| 413 | $project_pct_complete = 100; |
| 414 | } |
| 415 | |
| 416 | $outp = fopen("$tmp_dir/feature.xml", "w"); |
| 417 | fwrite($outp, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" . |
| 418 | "\n<feature" . |
| 419 | "\n\tid=\"$feature_id\"" . |
| 420 | "\n\tlabel=\"Babel Language Pack for $project_id in $language_name ($project_pct_complete%)\"" . |
| 421 | "\n\timage=\"eclipse_update_120.jpg\"" . |
| 422 | "\n\tprovider-name=\"%providerName\"" . |
| 423 | "\n\tversion=\"$train_version_timestamp\">" . |
| 424 | "\n\t<copyright>\n\t\t%copyright\n\t</copyright>" . |
| 425 | "\n\t<license url=\"%licenseURL\">\n\t\t%license\n\t</license>" . |
| 426 | "\n\t<description>Babel Language Pack for $project_id in $language_name</description>" ); |
| 427 | foreach ($fragment_ids as $fragment_id) { |
| 428 | $jar_name = "${output_dir_for_train}plugins/${fragment_id}_$train_version_timestamp.jar"; |
| 429 | $size = filesize($jar_name); |
| 430 | fwrite($outp, "\n\t<plugin fragment=\"true\" id=\"$fragment_id\" unpack=\"false\" " . |
| 431 | "version=\"$train_version_timestamp\" download-size=\"$size\" install-size=\"$size\" />"); |
| 432 | /* |
| 433 | * Copy the plugin to ${babel_language_packs_dir}tmp |
| 434 | */ |
| 435 | exec("cp ${output_dir_for_train}plugins/${fragment_id}_$train_version_timestamp.jar ${babel_language_packs_dir}tmp/eclipse/plugins"); |
| 436 | } |
| 437 | fwrite($outp, "\n</feature>"); |
| 438 | fclose($outp); |
| 439 | /* |
| 440 | * Copy in the various legal files |
| 441 | */ |
| 442 | exec("cp ${source_files_dir}about.html $tmp_dir"); |
| 443 | exec("cp ${source_files_dir}eclipse_update_120.jpg $tmp_dir"); |
| 444 | exec("cp ${source_files_dir}epl-v10.html $tmp_dir"); |
| 445 | exec("cp ${source_files_dir}feature.properties $tmp_dir"); |
| 446 | exec("cp ${source_files_dir}license.html $tmp_dir"); |
| 447 | /* |
| 448 | * Copy in the Babel Pseudo Translations Index file |
| 449 | */ |
| 450 | if (strcmp($language_iso, "en_AA") == 0) { |
| 451 | $pseudo_translations_index_file = fopen("${output_dir}BabelPseudoTranslationsIndex-$project_id.html", "w"); |
| 452 | fwrite($pseudo_translations_index_file, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">" . |
| 453 | "\n<html>\n<head>\n<title>Babel Pseudo Translations Index for $project_id</title>" . |
| 454 | "\n<meta http-equiv=Content-Type content=\"text/html; charset=UTF-8\">\n</head>" . |
| 455 | "\n<body>\n\t<h1>Babel Pseudo Translations Index for $project_id</h1>" . |
| 456 | "\n\t<h2>Version: $train_version_timestamp</h2>\n\t<ul>"); |
| 457 | foreach ($pseudo_translations_indexes[$project_id] as $index) { |
| 458 | fwrite($pseudo_translations_index_file, $index); |
| 459 | } |
droy | 03d5c46 | 2008-11-10 21:07:01 +0000 | [diff] [blame] | 460 | fwrite($pseudo_translations_index_file, "\n\t</ul>\n</div></div></body>\n</html>"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 461 | fclose($pseudo_translations_index_file); |
| 462 | exec("cp ${output_dir}BabelPseudoTranslationsIndex-$project_id.html $tmp_dir"); |
| 463 | exec("rm ${output_dir}BabelPseudoTranslationsIndex-$project_id.html"); |
| 464 | } |
| 465 | /* |
| 466 | * Copy the feature to ${babel_language_packs_dir}tmp before jar'ing up |
| 467 | */ |
kitlo | c42941d | 2008-11-20 15:33:00 +0000 | [diff] [blame] | 468 | exec("mkdir -p ${babel_language_packs_dir}tmp/eclipse/features/${feature_id}_$train_version_timestamp"); |
| 469 | exec("cd $tmp_dir; cp * ${babel_language_packs_dir}tmp/eclipse/features/${feature_id}_$train_version_timestamp"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 470 | /* |
| 471 | * Zip up language pack |
| 472 | */ |
| 473 | $language_pack_name = "BabelLanguagePack-$project_id-${language_iso}_$train_version_timestamp.zip"; |
| 474 | exec("cd ${babel_language_packs_dir}tmp; zip -r $babel_language_packs_dir$language_pack_name eclipse"); |
| 475 | /* |
| 476 | * Clean up ${babel_language_packs_dir}tmp |
| 477 | */ |
| 478 | exec("rm -rf ${babel_language_packs_dir}tmp"); |
| 479 | /* |
| 480 | * Add project language pack link to language pack links file |
| 481 | */ |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 482 | fwrite($language_pack_links_file, "\n\t\t\t<li><a href=\"<?= \$language_pack_leader ?>${language_pack_name}\">$language_pack_name ($project_pct_complete%)</a></li>"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 483 | /* |
| 484 | * Jar up this directory as the feature jar |
| 485 | */ |
| 486 | system("cd $tmp_dir; jar cfM ${output_dir_for_train}features/$feature_filename ."); |
| 487 | /* |
| 488 | * Register this feature with the site.xml |
| 489 | */ |
kitlo | c42941d | 2008-11-20 15:33:00 +0000 | [diff] [blame] | 490 | $site_xml .= "\n\t<feature url=\"features/$feature_filename\" id=\"$feature_id\" version=\"$train_version_timestamp\">"; |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 491 | $site_xml .= "\n\t\t<category name=\"Babel Language Packs in $language_name\"/>"; |
| 492 | $site_xml .= "\n\t</feature>"; |
| 493 | echo "${leader}Completed language pack for $language_name ($language_iso)\n"; |
kitlo | 78f9743 | 2009-03-17 22:28:58 +0000 | [diff] [blame] | 494 | |
| 495 | fwrite($language_pack_links_file, "\n\t\t</ul>"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 496 | } |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 497 | } |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 498 | /* |
droy | 0b08d29 | 2008-05-28 15:18:11 +0000 | [diff] [blame] | 499 | * <site mirrorsURL=... implemented in the weekly build process by sed'ing <site> |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 500 | */ |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 501 | $outp = fopen("${output_dir_for_train}site.xml", "w"); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 502 | fwrite($outp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . |
| 503 | "\n<site>" . |
| 504 | "\n\t<description url=\"http://babel.eclipse.org/\">" . |
| 505 | "\n\t\tThis update site contains user-contributed translations of the strings in all Eclipse projects." . |
| 506 | "\n\t\tPlease see the http://babel.eclipse.org/ Babel project web pages for a full how-to-use explanation of" . |
| 507 | "\n\t\tthese translations as well as how you can contribute to the translations of this and future versions of Eclipse." . |
| 508 | "\n\t</description>"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 509 | fwrite($outp, $site_xml); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 510 | fwrite($outp, "\n</site>"); |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 511 | fclose($outp); |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 512 | |
| 513 | fwrite($language_pack_links_file, "\n\t</ul>"); |
atoulme | dbda427 | 2009-01-20 06:04:22 +0000 | [diff] [blame] | 514 | |
droy | 3081da0 | 2009-05-11 15:54:56 +0000 | [diff] [blame] | 515 | fwrite($language_pack_links_file, "\n</body>\n</html>"); |
| 516 | fclose($language_pack_links_file); |
| 517 | |
| 518 | |
| 519 | $dbh = $dbc->disconnect(); |
| 520 | |
atoulme | dbda427 | 2009-01-20 06:04:22 +0000 | [diff] [blame] | 521 | // now generate the metadata and add the non-greedy tags |
atoulme | 09ce464 | 2009-01-21 07:46:06 +0000 | [diff] [blame] | 522 | |
droy | e77ad17 | 2009-05-04 17:35:56 +0000 | [diff] [blame] | 523 | /* |
| 524 | * Leaving this out of generate1 to avoid p2 breakage |
| 525 | * |
atoulme | 12882d5 | 2009-01-26 18:39:17 +0000 | [diff] [blame] | 526 | system("sh " . dirname(__FILE__) . "/runMetadata.sh ". |
atoulme | 09ce464 | 2009-01-21 07:46:06 +0000 | [diff] [blame] | 527 | METADATA_GENERATOR_LOCATION . " ${output_dir_for_train} "); |
atoulme | c86be15 | 2009-01-21 22:36:31 +0000 | [diff] [blame] | 528 | system("xsltproc -o ${output_dir_for_train}content.xml ". |
atoulme | b0f0e50 | 2009-01-21 17:27:25 +0000 | [diff] [blame] | 529 | dirname(__FILE__) . "/content.xsl ${output_dir_for_train}content.xml"); |
atoulme | c8efccd | 2009-02-13 08:51:59 +0000 | [diff] [blame] | 530 | system("cd ${output_dir_for_train} ; jar -fc content.jar content.xml ; jar -fc artifacts.jar artifacts.xml ; rm site.xml"); |
droy | e77ad17 | 2009-05-04 17:35:56 +0000 | [diff] [blame] | 531 | */ |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 532 | } |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 533 | echo "Completed generating update site\n"; |
| 534 | |
kitlo | 9c7c62a | 2008-10-05 16:05:19 +0000 | [diff] [blame] | 535 | |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 536 | /* |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 537 | 2. what happens if the translation feature includes plug-in fragments for |
| 538 | plug-ins that are not in the current image? |
| 539 | does it load correctly and ignore those fragments? if so, good |
| 540 | A: warnings appear in the run-time error log |
| 541 | does it fail to load? if so, then we need to generate different features, perhaps |
| 542 | one feature for each plug or else we need to know more about the project |
| 543 | distro structure to know which plug-ins to put in each feature |
| 544 | what happens if those plug-ins are later added - does it load the strings now? |
| 545 | A: probably not |
| 546 | 3. need to handle different versions of each feature/plugin/platform; generate different |
| 547 | language packs for each |
| 548 | */ |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 549 | |
kitlo | 58d8a5a | 2008-09-24 20:08:44 +0000 | [diff] [blame] | 550 | $alloutput = fopen($output_dir."langpack_output_".date("m_d_Y"), "w"); |
| 551 | fwrite($alloutput,ob_get_contents()); |
droy | c6eb7ac | 2009-05-12 17:25:46 +0000 | [diff] [blame^] | 552 | |
| 553 | function usage() { |
| 554 | echo "\n"; |
| 555 | echo "generate1.php -b <build_id> [-t <train_id>]\n"; |
| 556 | echo " -b <build_id>: The Build ID for this build.\n"; |
| 557 | echo " -t <train_id>: Optional: train to build (europa, ganymede, galileo."; |
| 558 | echo "\n"; |
| 559 | } |
| 560 | |
kitlo | 399df20 | 2008-09-30 15:32:25 +0000 | [diff] [blame] | 561 | ?> |