$v) { $out .= "#define $k MSG_ALL[lang_selected][$counter]\n"; if ($k=="MSG_LANGUAGE_NAME") $langname = $counter; if ($k=="MSG_LANGUAGE_SELECT") $langsel = $counter; //$out2 .= "\t".''.$v.','."\n"; //$out3 .= "\t".''.$en[$k].','."\n"; $counter++; } $out.="#define LANGUAGE_NAME $langname \n"; $out.="#define LANGUAGE_SELECT $langsel \n"; $out.="#define LANG_NUM ".count($langs)." \n"; $out.="char* CAT2(const char *s1,const char *s2);\n"; $out.="char* CAT4(const char *s1,const char *s2,const char *s3,const char *s4);\n"; $out.="\n\n\n#endif //LANGUAGE_ALL.H"; file_put_contents("language_all.h",$out); echo ".h created\n"; $out="#include \n#define LCD_WIDTH 20\nextern unsigned char lang_selected;\n"; foreach ($langs as $lang) { $outa[$lang]="const char* MSG".strtoupper($lang)."[] = {"; } //$out2="const char* MSGCZ[] = {"; //$out3="const char* MSGEN[] = {"; $counter=0; foreach ($cz as $k=>$v) { foreach ($langs as $lang) { $out .= "const char MSG".strtoupper($lang)."${counter}[] PROGMEM = { ".${$lang}[$k]." }; //$k\n"; $outa[$lang].="MSG".strtoupper($lang)."$counter, //$k\n"; if (${$lang}[$k] == "") echo "ERR: In language: ".strtoupper($lang)." string \"".$k."\" NOT FOUND !\n"; } //$out .= "const char MSGCZ${counter}[] PROGMEM = { $v }; //$k\n"; //$out .= "const char MSGEN${counter}[] PROGMEM = {".$en[$k]."}; //$k\n"; //$out2 .= "MSGCZ$counter, //$k\n"; //$out3 .= "MSGEN$counter, //$k\n"; $counter++; } $langlist=array(); foreach ($langs as $lang) { $out.= $outa[$lang] . "};\n"; $langlist[]="MSG".strtoupper($lang); } /* $out2.="};\n"; $out3.="};\n"; $out .= $out2; $out .= $out3; */ $out .= "\n\nconst char** MSG_ALL[] = {".join(",",$langlist)."};"; $tools = <<