diff --git a/README b/README index c75e5dd..c4f01ff 100644 --- a/README +++ b/README @@ -60,6 +60,7 @@ When you are done, you have to edit the chat script, to include your translation 'lang_code' =>'Language name', to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation. Please share your translation with me, so I can add it to the official version. +To update your translation, you can copy each new string to your translation file or edit the automated lang_update.php script to reflect you language and run it. REGEX: diff --git a/README.md b/README.md index 235d0c5..bee8736 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ When you are done, you have to edit the chat script, to include your translation 'lang_code' =>'Language name', to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation. Please share your translation with me, so I can add it to the official version. +To update your translation, you can copy each new string to your translation file or edit the automated lang_update.php script to reflect you language and run it. Regex: ------ diff --git a/chat.php b/chat.php index b5bf5df..a511eda 100644 --- a/chat.php +++ b/chat.php @@ -3754,7 +3754,7 @@ function load_config(){ define('MEMCACHEDHOST', 'localhost'); // Memcached host define('MEMCACHEDPORT', '11211'); // Memcached port } - define('DBDRIVER', 2); // Selects the database driver to use - 0=MySQL, 1=PostgreSQL, 2=sqlite + define('DBDRIVER', 0); // Selects the database driver to use - 0=MySQL, 1=PostgreSQL, 2=sqlite if(DBDRIVER===2){ define('SQLITEDBFILE', 'public_chat.sqlite'); // Filepath of the sqlite database, if sqlite is used - make sure it is writable for the webserver user } diff --git a/lang_update.php b/lang_update.php new file mode 100644 index 0000000..bf51aae --- /dev/null +++ b/lang_update.php @@ -0,0 +1,45 @@ + +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* 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, see . +*/ + +//Native language name: $native +\$T=array( +"; +if(file_exists("lang_$code.php")){ + include("lang_$code.php"); +} +include('lang_en.php'); +foreach($T as $id=>$value){ + if(isSet($I[$id])){ + $I[$id]=$value; + } +} +foreach($I as $id=>$value){ + echo "\t'$id' => '".str_replace("'", "\'", $value)."',\n"; +} +echo ");\n?>\n"; +$file=ob_get_clean(); +file_put_contents("lang_$code.php", $file); +?>