You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
710 B

7 years ago
  1. <?php
  2. /**
  3. * 다국어 언어 스트링을 출력합니다.
  4. * @param $key
  5. */
  6. function langs($key) {
  7. $CI = &get_instance();
  8. if( ! $langs = $CI->cache->get('site_language') )
  9. {
  10. $result = $CI->db->get('localize')->result_array();
  11. $langs = array(
  12. "ko" => array(),
  13. "en" => array()
  14. );
  15. foreach( $result as $row )
  16. {
  17. $langs['ko'][ $row['loc_key'] ] = $row['loc_value_ko'];
  18. $langs['en'][ $row['loc_key'] ] = $row['loc_value_en'];
  19. }
  20. $CI->cache->save('site_language', $langs);
  21. }
  22. if( isset($langs[LANG][$key]) ) {
  23. return $langs[LANG][$key];
  24. }
  25. else {
  26. return '';
  27. }
  28. }