Browse Source

언어 시스템 변경

ect (or 2du) 8 years ago
parent
commit
d2fa100ac8
3 changed files with 194 additions and 174 deletions
  1. 174 174
      app.py
  2. 10 0
      func.py
  3. 10 0
      language/ko-KR.json

File diff suppressed because it is too large
+ 174 - 174
app.py


+ 10 - 0
func.py

@@ -21,6 +21,10 @@ from set_mark.tool import sha224
 # 나무마크 불러옴
 from mark import *
 
+# 서브 언어팩 불러옴
+json_data = open(os.path.join('language', 'ko-KR.json'), 'rt', encoding='utf-8').read()
+else_lang = json.loads(json_data)
+
 def captcha_get(conn):
     curs = conn.cursor()
 
@@ -61,6 +65,12 @@ def captcha_post(test, conn, num = 1):
     else:
         pass
 
+def load_lang(lang, data):
+    if data in lang:
+        return lang[data]
+    else:
+        return else_lang[data]
+
 def edit_help_button():
     # https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
     js = '''<script>

+ 10 - 0
language/ko-KR.json

@@ -17,26 +17,36 @@
     "other" : "기타",
     "tool" : "도구",
     "plus" : "추가",
+    "open" : "열린",
+    "search" : "검색",
+
     "user" : "사용자",
     "alarm" : "알림",
     "watchlist" : "주시 문서",
     "my_info" : "내 정보",
+    
     "recent" : "최근",
     "recent_changes" : "최근 변경",
+    
     "discussion" : "토론",
+    
     "login" : "로그인",
     "logout" : "로그아웃",
     "register" : "회원가입",
     "no_alarm" : "알림이 없습니다.",
+    
     "able" : "가능",
+    
     "year" : "년",
     "month" : "월",
     "day" : "일",
+    
     "normal" : "일반",
     "subscriber" : "가입자",
     "admin" : "관리자",
     "owner" : "소유자",
     "admin_group" : "관리 그룹",
+
     "user_css_warring" : "비 로그인의 경우에는 사용자 CSS가 로그인하거나 브라우저 닫으면 날아갑니다.",
     "http_warring" : "주의 : 만약 HTTPS 연결이 아닌 경우 데이터가 유출될 가능성이 있습니다. 이에 대해 책임지지 않습니다."
 }

Some files were not shown because too many files changed in this diff