kalabox Posted April 7, 2007 Report Share Posted April 7, 2007 klau man ir parasta php lapiņa, ir rinda piem: <a href="index.php"><=$home ?></a> uztaisu txt failu ar LV un veel veinu txt failu ar RU valodu, un kā man dabūt gatavu ka var pārslēgties??? Link to comment Share on other sites More sharing options...
v3rb0 Posted April 7, 2007 Report Share Posted April 7, 2007 izmanto sessiju, cepumu vai urli. Link to comment Share on other sites More sharing options...
kalabox Posted April 7, 2007 Author Report Share Posted April 7, 2007 emm, konkreetaaak, luudzu.. Un lapai nav paredzeets sesijas... jebkuram userim ir jaabuut iespeejai paarsleegties... Link to comment Share on other sites More sharing options...
Stopp Posted April 7, 2007 Report Share Posted April 7, 2007 Tas šeit bija apspriests vienā tēmā no visiem galiem jau. Ne tikai vienā, ja nemaldos. Pameklē, pameklē. Link to comment Share on other sites More sharing options...
kalabox Posted April 8, 2007 Author Report Share Posted April 8, 2007 ok... :) Link to comment Share on other sites More sharing options...
kalabox Posted April 14, 2007 Author Report Share Posted April 14, 2007 varbut kadam ir aizkjeries kad kodinjsh?? Link to comment Share on other sites More sharing options...
black Posted April 14, 2007 Report Share Posted April 14, 2007 $domainPath = WEBROOT ."/locale"; $language = $this->GetLanguage(); // piem. lv_LV.UTF-8 $domain = 'messages'; setlocale(LC_ALL, $language); bindtextdomain($domain, $domainPath); textdomain($domain); bind_textdomain_codeset($domain, 'UTF-8'); print _("hello world"); Link to comment Share on other sites More sharing options...
kalabox Posted April 14, 2007 Author Report Share Posted April 14, 2007 neiebraucu riktiigi.. Link to comment Share on other sites More sharing options...
black Posted April 14, 2007 Report Share Posted April 14, 2007 (edited) nu, ja nesaproti, tad taisi šādi (neliela deva ironijas): $language = $this->GetLanguage(); if($language=='lv_LV.UTF-8') { print 'sveika pasaule'; } else { print 'hello world'; } Atbilde uz šādiem jautājumiem ir "gettext". Un Gūgle lai ir tavs draugs! Edited April 14, 2007 by black Link to comment Share on other sites More sharing options...
kalabox Posted April 14, 2007 Author Report Share Posted April 14, 2007 pag, bet kur ir txt fails, no kura njem to valodu?? piem man ir poga LV un RU uzspiezhu uz ru, njem no ru.txt Link to comment Share on other sites More sharing options...
black Posted April 14, 2007 Report Share Posted April 14, 2007 teksti atrodas, piemēram, WEBROOT/locale/lv_LV/LC_MESSAGES/messages.mo Link to comment Share on other sites More sharing options...
kalabox Posted April 14, 2007 Author Report Share Posted April 14, 2007 un veel, man nevajag lai izmantotu sql tikai un vieniigi php.. Link to comment Share on other sites More sharing options...
black Posted April 14, 2007 Report Share Posted April 14, 2007 Kur Tu redzēji, ka gettext izmanto SQL? :) Cita lieta, ka vajadzīgs gettext extension. Bet ja tādu nav iespējams pieslēgt, tad var izlīdzēties arī ar gettext php emulatoru. Link to comment Share on other sites More sharing options...
4e4en Posted April 14, 2007 Report Share Posted April 14, 2007 valodu identificēšanai vislabāk ir izmantot URLU un valodām php failus <?php $lang=array(); $lang['login']='autorizēties'; ... ?> Link to comment Share on other sites More sharing options...
andrisp Posted April 14, 2007 Report Share Posted April 14, 2007 Neesmu vēl izmantojis gettext piedāvādās iespējas, bet domāju, ka tas nu noteikti nav piemērots kalabox zināšanām. No offence, protams. Sākumā varētu kaut ko vienkāršu kā 4e4en iesaka. Atkarībā no izvēlētās valodas tiek ielādēts attiecīgais valodas fails, kurā atrodas masīvs ar visiem stringiem. Link to comment Share on other sites More sharing options...
Recommended Posts