public function generateLocalizationFiles()
 {
     foreach (localization::getLanguageList() as $languageCode => $languageName) {
         $file_jsFile = $this->outputPath . "/locals/" . $languageCode . ".js";
         $file_buildNumber = $file_jsFile . "_build#";
         $newContents = "localizationStrings = " . json_encode(localization::getLanguageStrings($languageCode), JSON_FORCE_OBJECT) . ";";
         $md5_existing = file_exists($file_jsFile) ? md5_file($file_jsFile) : false;
         $buildNumber = file_exists($file_buildNumber) ? file_get_contents($file_buildNumber) : 1;
         if ($md5_existing != md5($newContents) || !file_exists($file_jsFile)) {
             file_put_contents($file_buildNumber, ++$buildNumber);
             file_put_contents($file_jsFile, $newContents);
             echo "  Wrote new {$languageCode} to disk." . PHP_EOL;
         } else {
             echo "  Skipped {$languageCode} as content is unchanged." . PHP_EOL;
         }
     }
 }
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
 * 
 */
header('Content-type: application/json; charset=UTF-8');
include_once 'includes/utf8_handling.php';
include_once 'includes/class_localization.php';
ob_start("ob_gzhandler");
if (!isset($_REQUEST["task"])) {
    $get_task = "getList";
} else {
    $get_task = $_REQUEST["task"];
}
switch ($get_task) {
    case "getLang":
        if (!isset($_REQUEST["lang"])) {
            $lang = "en_US";
        } else {
            $lang = $_REQUEST["lang"];
        }
        echo json_encode(localization::getLanguageStrings($lang));
        break;
    default:
        echo json_encode(localization::getLanguageList());
        break;
}