Boss needs a pretty simple script, looking for some help
Posted: Thu Aug 19, 2004 6:15 am
Hey guys. I only have 2 days left till of employment here, and the boss has asked me to put togther a rather simple script, involving a directory of language files.
In the root there is :
/en_US/
/de/
/it/
/po/
and so on.
There are a couple dozen of these directorys each having rouglhly 15 files or so in each, each of these files is a php file like such:
/en_us/alangfile.php:
Every language directory has the same php files, each of these are in all directories. The files have all the same variables, but the values are in the specific language.
What i need, is a script that will have a Language selection DropDown, and the page will _GET lang= whateverlang, then set a variable to whichever language it is, so that the page will then load all the variables (aka administror) from the desired directory.
Its quite easy Im sure, but Im not good with coming up with scripts from nothing. Im sure it'll go something like:
as you cans ee i need some help with this. I hope from my explanation you can understand what i need done.
In the root there is :
/en_US/
/de/
/it/
/po/
and so on.
There are a couple dozen of these directorys each having rouglhly 15 files or so in each, each of these files is a php file like such:
/en_us/alangfile.php:
Code: Select all
$stringї'action'] = 'Action';
$stringї'activities'] = 'Activities';
$stringї'activity'] = 'Activity';
$stringї'activityclipboard'] = 'Moving this activity: <b>$a</b>';
$stringї'activityiscurrentlyhidden'] = 'Sorry, this activity is currently hidden';
$stringї'activitymodule'] = 'Activity module';
$stringї'activityreport'] = 'Activity report';
$stringї'activityselect'] = 'Select this activity to be moved elsewhere';
$stringї'activitysince'] = 'Activity since $a';
$stringї'add'] = 'Add';
$stringї'addadmin'] = 'Add admin';
$stringї'addcreator'] = 'Add course creator';
$stringї'added'] = 'Added $a';
$stringї'addinganew'] = 'Adding a new $a';
$stringї'addinganewto'] = 'Adding a new $a->what to $a->to';
$stringї'addingdatatoexisting'] = 'Adding data to existing';
$stringї'addnewcategory'] = 'Add new category';
$stringї'addnewcourse'] = 'Add a new course';
$stringї'addnewuser'] = 'Add a new user';
$stringї'address'] = 'Address';
$stringї'addstudent'] = 'Add student';
$stringї'addteacher'] = 'Add teacher';
$stringї'admin'] = 'Admin';
$stringї'adminhelpaddnewuser'] = 'To manually create a new user account';
$stringї'adminhelpassignadmins'] = 'Admins can do anything and go anywhere in the site';
$stringї'adminhelpassigncreators'] = 'Creators can create new courses and teach in them';
$stringї'adminhelpassignstudents'] = 'Go into a course and add students from the admin menu';
$stringї'adminhelpassignteachers'] = 'Find a course then use the icon to add teachers';
$stringї'adminhelpauthentication'] = 'You can use internal user accounts or external databases';
$stringї'adminhelpconfiguration'] = 'Configure how the site looks and works';
$stringї'adminhelpconfigvariables'] = 'Configure variables that affect general operation of the site';
$stringї'adminhelpcourses'] = 'Define courses and categories and assign people to them';
$stringї'adminhelpedituser'] = 'Browse the list of user accounts and edit any of them';
$stringї'adminhelplanguage'] = 'For checking and editing the current language pack';
$stringї'adminhelplogs'] = 'Browse logs of all activity on this site';
$stringї'adminhelpmanagedatabase'] = 'Access the database directly (be careful!)';
$stringї'adminhelpmanagemodules'] = 'Manage installed modules and their settings';
$stringї'adminhelpsitefiles'] = 'For publishing general files or uploading external backups';
$stringї'adminhelpsitesettings'] = 'Define how the front page of the site looks';
$stringї'adminhelpthemes'] = 'Choose how the site looks (colors, fonts etc)';
$stringї'adminhelpusers'] = 'Define your users and set up authentication';
$stringї'administration'] = 'Administration';
$stringї'administrator'] = 'Administrator';What i need, is a script that will have a Language selection DropDown, and the page will _GET lang= whateverlang, then set a variable to whichever language it is, so that the page will then load all the variables (aka administror) from the desired directory.
Its quite easy Im sure, but Im not good with coming up with scripts from nothing. Im sure it'll go something like:
Code: Select all
If isset(GET'lang')
{
$lang= (GETїlang])
pre_load = $lang/langfile.php
pre_load = $lang/langfile2.php
prep_replace all variables with /lang/ variables
echo $administrator
//Should come out in whatever lang u tell it.
lol