barryflood22 Posted November 13, 2013 Share Posted November 13, 2013 I have a script which is running which pulls data from a database, however - it is stored like this in the database: COM_COMMUNITY_LANG_NAME_IRELAND when I call it it echos the same, I want the above to say "Ireland" instead. is this something you can help with? Link to comment https://forums.phpfreaks.com/topic/283878-replace-words-with-another/ Share on other sites More sharing options...
requinix Posted November 13, 2013 Share Posted November 13, 2013 Internationalization, huh? Is there somewhere already a place in your system that "defines" COM_COMMUNITY_LANG_NAME_IRELAND to be Ireland? Maybe in the database? Configuration files? It might also define that for a specific locale/language, like it's Ireland for most English speakers but Éire for the Irish and Ирландия for Russians. Link to comment https://forums.phpfreaks.com/topic/283878-replace-words-with-another/#findComment-1458162 Share on other sites More sharing options...
barryflood22 Posted November 13, 2013 Author Share Posted November 13, 2013 I need to stop answering my own questions, I created a language file :-) <?PHP //Have seperate language files for each language I add, this would be english file function lang($phrase){ static $lang = array( 'COM_COMMUNITY_LANG_NAME_UNITEDKINGDOM' => 'The UK', 'COM_COMMUNITY_LANG_NAME_IRELAND' => 'Ireland' ); return $lang[$phrase]; } ?> Link to comment https://forums.phpfreaks.com/topic/283878-replace-words-with-another/#findComment-1458163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.