Exemplo n.º 1
0
// Go through all the files
foreach ($list as $pathname) {
    if ($pathname) {
    	// Get the relative path name from server_root
        $pathname = str_replace($startdir, '', $pathname);
        $filenameParts = explode('.', basename($pathname));
        // prefix will be 'locals' or 'globals'
        $prefix = $filenameParts[0];
		$directory = dirname($pathname);

		// Find the language that matches this file.
        foreach ($languages as $lang) {
            if ($lang['Code'] == $filenameParts[1]) {
            	$twoLetterCode = $lang['Code'];
                $sourceFile = new LocalizerLanguage($prefix, $twoLetterCode);
                $sourceFile->loadGsFile();
            	switch ($twoLetterCode) {
            	case 'en':
            		$languageCode = 'en_US';
            		break;
            	case 'cz':
            		$languageCode = 'cs_CZ';
            		break;
            	case 'at':
            		$languageCode = 'de_AT';
            		break;
            	case 'sh':
            		// Serbian is for yugoslavia
            		// See: http://www.niso.org/standards/resources/3166.html#serbia
            		$languageCode = 'sh_YU';
            		break;