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? Quote 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 (edited) 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. Edited November 13, 2013 by requinix Quote 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]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/283878-replace-words-with-another/#findComment-1458163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.