Skip to content

Commit

Permalink
영어판 완성 (아마)
Browse files Browse the repository at this point in the history
  • Loading branch information
surplus-dev committed May 20, 2018
1 parent fcda9b5 commit 3236bb3
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 87 deletions.
31 changes: 4 additions & 27 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
## 설명
<!-- 해당 이슈에 대한 자세한 설명을 작성해주세요.
## Explanation (설명)

예시: 로그아웃 직후 로그인 시 로그인이 되지 않습니다. -->
## Desired results (원하는 결과)

## 과정
<!-- 해당 이슈를 발생한 당시의 행동을 최대한 자세하게 나열해주세요.
## Current Results (현재 결과)

예시:
1. 로그인 버튼을 눌러 로그인을 합니다.
2. 로그아웃 버튼을 눌러 로그아웃을 합니다.
3. 다시 로그인 버튼을 눌러 로그인을 합니다. -->

## 정상 동작 시의 결과
<!-- 이 과정을 통해 얻어야할 결과가 무엇인가요?
예시: 로그인이 되어야 합니다. -->

## 현재 결과
<!-- 이 과정을 통해 얻은 결과를 설명해주세요.
예시: 로그인이 되지 않습니다. -->

## 스크린샷
<!-- 오류가 발생한 스크린샷을 최소 한장 이상 첨부해주세요. -->

## 수정 되어야 할 부분
<!-- 만약 수정되어야 할 부분이나 해결 방법을 아신다면 기재해주세요.
예시: 만약 로그아웃 페이지에서 로그인을 할 경우 대문 페이지로 이동시켜면 될 것 같습니다. -->
## Screenshot (스크린샷)
21 changes: 21 additions & 0 deletions Readme-Ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 개요
나무마크 기반의 파이썬 위키 엔진. (3.5 이상)

## 클론 명령어
### 일반
* git clone https://github.com/2DU/openNAMU.git

### 베타
* git clone -b master https://github.com/2DU/openNAMU.git

## 설치법
* [참조](http://namu.ml/w/오픈나무%2F설치법)

## set.json 설명
* db = 데이터베이스 이름

set.json를 삭제하면 다시 새로 만들 수 있습니다.

## 기타
* [테스트 서버](http://namu.ml/)
* 첫 번째 가입자에게 소유자 권한이 부여됩니다.
2 changes: 1 addition & 1 deletion version.md → Version-Ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@

----
## 기타
* 현재 버전 : v3.0.3
* 현재 버전 : v3.0.4

----
## 개발 이념
Expand Down
38 changes: 26 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from func import *

# 버전 표기
r_ver = 'v3.0.4-Final-Beta-' + re.sub('^[0-9]{2}', '', str(int(datetime.datetime.fromtimestamp(os.path.getmtime('app.py')).strftime('%Y%m%d'))))
r_ver = 'v3.0.4-Stable-' + re.sub('^[0-9]{2}', '', str(int(datetime.datetime.fromtimestamp(os.path.getmtime('app.py')).strftime('%Y%m%d'))))
print('Version : ' + r_ver)

# set.json 설정 확인
Expand Down Expand Up @@ -1427,7 +1427,11 @@ def revert(name = None):
curs.execute("insert into data (title, data) values (?, ?)", [name, data[0][0]])

history_plus(name, data[0][0], get_time(), ip_check(), flask.request.form.get('send', None) + ' (' + str(num) + load_lang('version') + ')', leng)
namumark(name, data[0][0], 1)
namumark_re(
name = name,
data = data[0][0],
set_num = 1
)

conn.commit()

Expand Down Expand Up @@ -1681,7 +1685,11 @@ def edit(name = None):
curs.execute("delete from back where link = ?", [name])
curs.execute("delete from back where title = ? and type = 'no'", [name])

namumark(name, content, 1)
namumark_re(
name = name,
data = content,
set_num = 1
)

conn.commit()

Expand Down Expand Up @@ -1756,7 +1764,10 @@ def preview(name = None):
new_data = re.sub('^\r\n', '', new_data)
new_data = re.sub('\r\n$', '', new_data)

end_data = namumark(name, new_data, 0)
end_data = namumark_re(
name = name,
data = new_data
)

if flask.request.args.get('section', None):
action = '?section=' + flask.request.args.get('section', None)
Expand Down Expand Up @@ -2029,7 +2040,7 @@ def title_index():
else:
count_end += [0]

sql_list = ['' + load_lang('template') + ':', load_lang('category') + ':', load_lang('user') + ':', load_lang('file') + ':']
sql_list = [load_lang('template') + ':', load_lang('category') + ':', load_lang('user') + ':', load_lang('file') + ':']
for sql in sql_list:
curs.execute("select count(title) from data where title like ?", [sql + '%'])
count = curs.fetchall()
Expand All @@ -2041,10 +2052,10 @@ def title_index():
count_end += [count_end[0] - count_end[1] - count_end[2] - count_end[3] - count_end[4]]

data += '</ul><hr><ul><li>All : ' + str(count_end[0]) + '</li></ul><hr><ul>'
data += '<li>Template : ' + str(count_end[1]) + '</li>'
data += '<li>Category : ' + str(count_end[2]) + '</li>'
data += '<li>User : ' + str(count_end[3]) + '</li>'
data += '<li>File : ' + str(count_end[4]) + '</li>'
data += '<li>' + load_lang('template') + ' : ' + str(count_end[1]) + '</li>'
data += '<li>' + load_lang('category') + ' : ' + str(count_end[2]) + '</li>'
data += '<li>' + load_lang('user') + ' : ' + str(count_end[3]) + '</li>'
data += '<li>' + load_lang('file') + ' : ' + str(count_end[4]) + '</li>'
data += '<li>Other : ' + str(count_end[5]) + '</li>'

data += '</ul>' + next_fix('/title_index?num=' + str(num) + '&page=', page, title_list, num)
Expand Down Expand Up @@ -2291,7 +2302,7 @@ def topic(name = None, sub = None):

all_data += '<table id="toron"><tbody><tr><td id="toron_color_red">'
all_data += '<a href="#' + topic_data[1] + '">#' + topic_data[1] + '</a> ' + ip_pas(topic_data[3]) + who_plus + ' <span style="float: right;">' + topic_data[2] + '</span>'
all_data += '</td></tr><tr><td>' + namumark('', topic_data[0], 0) + '</td></tr></tbody></table><br>'
all_data += '</td></tr><tr><td>' + namumark_re(data = topic_data[0]) + '</td></tr></tbody></table><br>'

for topic_data in topic:
if number == 1:
Expand All @@ -2310,7 +2321,7 @@ def topic(name = None, sub = None):
else:
blind_data = ''

user_write = namumark('', topic_data[0], 0)
user_write = namumark_re(data = topic_data[0])
ip = ip_pas(topic_data[3])

curs.execute('select acl from user where id = ?', [topic_data[3]])
Expand Down Expand Up @@ -3137,7 +3148,10 @@ def read_view(name = None):
else_data = re.sub('^\r\n', '', else_data)
else_data = re.sub('\r\n$', '', else_data)

end_data = namumark(name, else_data, 0)
end_data = namumark_re(
name = name,
data = else_data
)

if num:
menu = [['history/' + url_pas(name), load_lang('history')]]
Expand Down
3 changes: 3 additions & 0 deletions func.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def load_lang(data):
else:
return else_lang[data]

def namumark_re(name = '', data = '', set_num = 0):
return namumark(name, data, set_num, load_lang('please_all'))

def edit_help_button():
# https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
'''
Expand Down
1 change: 1 addition & 0 deletions language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"move" : "Move",
"hide" : "Hide",
"list" : "List",
"out" : "out",
"revert" : "Undo",
"version" : " Ver",
"normal_version" : "Version",
Expand Down
8 changes: 5 additions & 3 deletions language/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"delete": "삭제",
"bulk_delete": "대량 삭제",
"edit_filter": "편집 필터",
"move": " 이동",
"move": "이동",
"hide": "숨김",
"list": "목록",
"revert": "되돌리기",
"version": "",
"normal_version" : "버전",
"normal_version": "버전",
"document": "문서",
"all": "모든",
"ban": "차단",
Expand Down Expand Up @@ -101,5 +101,7 @@
"decument_exist_error": "내용이 원래 문서와 동일 합니다.",
"password_diffrent_error": "재 확인 비밀번호와 입력 비밀번호가 다릅니다.",
"edit_filter_error": "편집 필터에 의해 검열 되었습니다.",
"file_name_error": "파일 이름은 알파벳, 한글, 띄어쓰기, 언더바, 빼기표만 허용 됩니다."
"file_name_error": "파일 이름은 알파벳, 한글, 띄어쓰기, 언더바, 빼기표만 허용 됩니다.",
"template": "",
"out": "외부"
}
14 changes: 14 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,17 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## External File License
* Quotes icon [Dave Gandy](http://www.flaticon.com/free-icon/quote-left_25672) CC 3.0 BY
* Syntax highlighting [highlightjs](https://highlightjs.org/)
* Numerical expression [MathJax](https://www.mathjax.org/)

## Contributors
* [Reference](https://github.com/2DU/openNAMU/graphs/contributors)

## Helpful people
* [Team Croatia](https://github.com/TeamCroatia)
* Basix
* Efrit
* Other chat rooms
4 changes: 2 additions & 2 deletions mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def plusing(name, link, backtype):
if not curs.fetchall():
curs.execute("insert into back (title, link, type) values (?, ?, ?)", [link, name, backtype])

def namumark(title, data, num):
data = start(conn, data, title)
def namumark(title, data, num, lang):
data = start(conn, data, title, lang)
if num == 1:
i = 0
while 1:
Expand Down
29 changes: 13 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
## 개요
오픈나무 정식 버전 입니다. 파이썬으로 돌아 갑니다. (3.5 이상)
## Intro
NamuMark based wiki engine returns to Python. (3.5 and above)

## 클론 명령어
### 일반
## Clone command
### Stable
* git clone https://github.com/2DU/openNAMU.git

### 베타
### Master
* git clone -b master https://github.com/2DU/openNAMU.git

### 업데이트
* git pull

## 설치법
* [참조](http://namu.ml/w/오픈나무%2F설치법)
## Install
* [참조](http://namu.ml/w/openNAMU/Install)

## set.json 설명
* db = 데이터베이스 이름
## set.json Explanation
* db = Database Name

set.json를 삭제하면 다시 새로 만들 수 있습니다.
You can create a new set.json by deleting it.

## 기타
* [테스트 서버](http://namu.ml/)
* 첫 번째 가입자에게 소유자 권한이 부여됩니다.
## Other
* [Test Server (Ko)](http://namu.ml/)
* The first registor is granted owner privileges.
Loading

0 comments on commit 3236bb3

Please sign in to comment.