Jump to content
php.lv forumi

Uz pa6taisitas lapas


goma smile

Recommended Posts

Es zinu ka uz pa6taisitas lapas var uzlikt vairakas valodas (un tas izveleties Lv,eng,Ru.....).....

 

piemers ir aptuveni ta :

 

ka uztaisa papku valodas tur uztaisit failus kadas valodas gribi piemeram lat.lang eng.lang rus.lang vai kautka ta

Piemeram tajos failos ieraksta

 (<.News.> "jaunumi";

Ta butu lat.lang faila

 (<.News.> "news";

Ta butu eng.lang faila

 

un piemeram taja faila kur gribi redzet izmainas ieraksti

<h3><.News.></h3>

 

Un tad weba kautkur var izveleties kadas valodas gribi Lv,eng,Ru.....

 

Bet man vaig vai kads zin ka izdarit lai parmestu uz tam valodam kad uzpiez Lv,eng,Ru.....

 

Butu labi ja kadam butu kads piemers ka un ka tajos lang failos butu jadara

Edited by goma smile
Link to comment
Share on other sites

Dažas interesantas lietas, ko atradu Googlē pēc atslēgas vārdiem: how to make multilanguage php

Creating A Simple Multi Language System

Multi language PHP scripting

 

P.S. Tīri personīgi man nepatīk 6āds p13ra}{ts. Bet tas nu tā...

P.P.S. Tas 13dots izskatās interesants forums. ;)

Edited by Aleksejs
Link to comment
Share on other sites

Man personīgi strādā ar sesijām:

<?php
if(isset($_REQUEST['set_lang'])){
if($_REQUEST['set_lang'] == "lv" OR $_REQUEST['set_lang'] == "en" OR $_REQUEST['set_lang'] == "ru"){
//$_SESSION['lang'] = $_REQUEST['set_lang'];
// setcookie("nwd_lang",$_REQUEST['set_lang']);
$_SESSION['valoda'] = $_REQUEST['set_lang'];
header ("Location: http://eip.wc3.lv");
//echo "<meta http-equiv=refresh content='0;url=".$_SERVER['PHP_SELF'].">";
}
}
//$_SESSION['lang']

switch($_SESSION['valoda']){
case 'en':
//latvieshu valoda, ja izveeleeta
include("valodas/en.php");
break;
case 'ru':
//krievu valoda, ja izveleta
include("valodas/ru.php");
break;
default:
//galvenaa valoda
include("valodas/lv.php");
break;
}
?>

Link to comment
Share on other sites

Nu ta es ieks faila index.php ierkakstu ko gribu kas tulkojas

 

<?php echo $web_lang['Jaunumi'];?>

 

Un iek6 tiem en.php...... ierakstu

$web_lang['Jaunumi'] = "News";

 

tad es ieraktsu

http://nosaukums.oo.lv/index.php?set_lang=en

 

un tad ma paradas

 

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\index.php:7) in C:\AppServ\www\index.php on line 322

Link to comment
Share on other sites

<?php
if(!$_SESSION["mana_valoda"]) $_SESSION["mana_valoda"] = "lv";
if($_GET["v"]) $_SESSION["mana_valoda"] = $_GET["v"];
define("VALODA", $_SESSION["mana_valoda"]);

include("valodas_fails/".VALODA."/valoda.lng); // Piemeram..

echo "<a href='?v=rus'>$txt[001]</a> | <a href='?v=lv'>$txt[02]</a>";
echo "<p>-> ".VALODA;
?>

Link to comment
Share on other sites

×
×
  • Create New...