Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 349107
Collapse All | Expand All

(-)server/classes/export/generate1.php (-9 / +20 lines)
Lines 231-256 Link Here
231
			} else {
231
			} else {
232
				exec("mkdir $tmp_dir");
232
				exec("mkdir $tmp_dir");
233
			}
233
			}
234
235
			$need_nl_path_case = array('templates/', 'config/', 'data/', 'property_files/');
234
			/*
236
			/*
235
			 * Generate each *.properties file
237
			 * Generate each *.properties file
236
			 */
238
			 */
237
			foreach ($plugin_row as $properties_file) {
239
			foreach ($plugin_row as $properties_file) {
238
				/*
240
				$dirname = $properties_file['dir_name'];
239
				 * Convert the filename to *_lang.properties, e.g., foo_fr.properties
240
				 */
241
				$filename = $properties_file['file_name'];
241
				$filename = $properties_file['file_name'];
242
				if (preg_match( "/^(.*)\.properties$/", $filename, $matches)) {
242
243
					$filename = $matches[1] . '_' . $language_iso . '.properties';
243
				if (in_array($dirname, $need_nl_path_case)) {
244
					/*
245
					 * Convert the dirname to nl/lang/path, e.g., nl/fr/templates
246
					 */
247
					$dirname = 'nl/' . $language_iso . '/' . $dirname;
248
				} else {
249
					/*
250
					 * Convert the filename to *_lang.properties, e.g., foo_fr.properties
251
					 */
252
					if (preg_match( "/^(.*)\.properties$/", $filename, $matches)) {
253
						$filename = $matches[1] . '_' . $language_iso . '.properties';
254
					}
244
				}
255
				}
245
				echo "${leader}${leader}${leader}Generating properties file " . $properties_file['dir_name'] . $filename . " (file_id=" . $properties_file['file_id'] . ")\n";
256
				echo "${leader}${leader}${leader}Generating properties file " . $dirname . $filename . " (file_id=" . $properties_file['file_id'] . ")\n";
246
				/*
257
				/*
247
				 * Create any needed sub-directories
258
				 * Create any needed sub-directories
248
				 */
259
				 */
249
				exec("mkdir -p \"" . $tmp_dir . $properties_file['dir_name'] . "\"");
260
				exec("mkdir -p \"" . $tmp_dir . $dirname . "\"");
250
				/*
261
				/*
251
				 * Start writing to the file
262
				 * Start writing to the file
252
				 */
263
				 */
253
				$fullpath = $tmp_dir . $properties_file['dir_name'] . $filename;
264
				$fullpath = $tmp_dir . $dir_name . $filename;
254
				$outp = fopen($fullpath, "w");
265
				$outp = fopen($fullpath, "w");
255
				fwrite($outp, "# Copyright by many contributors; see http://babel.eclipse.org/");
266
				fwrite($outp, "# Copyright by many contributors; see http://babel.eclipse.org/");
256
				if (strcmp($language_iso, "en_AA") == 0) {
267
				if (strcmp($language_iso, "en_AA") == 0) {
Lines 311-317 Link Here
311
				 * Finish the properties file
322
				 * Finish the properties file
312
				 */
323
				 */
313
				fclose($outp);
324
				fclose($outp);
314
				echo "${leader}${leader}${leader}Completed  properties file " . $properties_file['dir_name'] . $filename . "\n";
325
				echo "${leader}${leader}${leader}Completed  properties file " . $dirname . $filename . "\n";
315
			}
326
			}
316
			/*
327
			/*
317
			 * Copy in the various legal files
328
			 * Copy in the various legal files

Return to bug 349107