메뉴 건너뛰기

test

<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>

 
<%@page import="java.io.BufferedReader"%>
<%@page import="java.util.*"%>
<%@page import="java.io.FileReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.net.URLEncoder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<div id="google_translate_element"></div>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<%
try {
           BufferedReader in = new BufferedReader(new FileReader("C:/tmp/conv/EN/messages.inc.php"));
           BufferedReader in2 = new BufferedReader(new FileReader("C:/tmp/conv/KR/messages.inc.php"));
           String s;
           Map<String, String> map = new HashMap<String, String>();
           Map<String, String> map2 = new HashMap<String, String>();
          
           while ((s = in.readLine()) != null) {
            if(s.startsWith("$")) {
               String[] split_in = s.split("=");
               map.put(split_in[0], split_in[1]);
            } else {
     // pass            
            }
           }
           in.close();
           s = null;
          
           while ((s = in2.readLine()) != null) {
            if(s.startsWith("$")) {
               String[] split_in = s.split("=");
               map2.put(split_in[0], split_in[1]);
            } else {
     // pass            
            }
           }
           in2.close();
          
           Iterator<String> keys = map.keySet().iterator();
           /* */
           while (keys.hasNext()) {
           String key = keys.next();
             out.print("<table><tr>");
             //out.print("<td><input type=text name =aaa value="+key+"</input></td>");
             out.print("<td>"+key+""="</td>");
             out.print("<td><textarea name =bbb cols=50 rows=5 style="display:none;">"+map.get(key)+"</textarea></td>");
            
          // 번역기용
          out.print("<td width=600><p>"+map.get(key)+"</p></td>");
            
             /*
             if(map2.containsKey(key)) {

              
              out.print("<td><textarea name =ccc cols=50 rows=5>"+map2.get(key)+"</textarea></td>");
             } else {
              out.print("<td><textarea name =ccc cols=50 rows=5>"+""+"</textarea></td>");
             }
             */
            
             out.print("</tr></table>");           
           }
           /* */

           ////////////////////////////////////////////////////////////////
         } catch (IOException e) {
             System.err.println(e); // 에러가 있다면 메시지 출력
             System.exit(1);
         }
%>

<p>This example displays a simple translate button, with no text.</p>
<p>park</p>
<p>sang</p>


</body>
</html>

위로