Reputation: 505
$server_loc = $_SERVER['REQUEST_URI'];
$locations = array( '/aiesec/ar/',
'/aiesec/ar/volunteer-abroad/',
'/aiesec/ar/about/',
'/aiesec/ar/working-abroad/',
'/aiesec/ar/stories/'
);
foreach ($locations as $loc) {
if($server_loc == $loc) {
$translate['apply'] = "قدم الآن";
$translate['recent_stories'] = "قصص الأخيرة";
$translate['instagram_feed'] = "إينستاجرام تغذية";
} else {
$translate['apply'] = "APPLY NOW";
$translate['recent_stories'] = "RECENT STORIES";
$translate['instagram_feed'] = "INSTAGRAM FEED";
}
}
Hey all, Trying to get this simple code to work.
It's a very simple translation for a small website but for some reason, it refuses to work.
$server_loc works, as it'll echo '/aiesec/ar/' when I'm on the homepage.
Upvotes: 0
Views: 41