%s'
- % (indent, rel, quote(n), quote(n),
+ % (indent, rel, quote_i(n), quote(n),
linktitle,
inm))
@@ -543,3 +543,45 @@
got.insert(0, page)
return got
+def quote_i(u=''):
+ """Enable to use for wiki name as Japanese language.
+ by Nobuyuki Koyoshi in Japan. 2002-10-10
+ """
+ ul=quote_x(u)
+ if u==ul:
+ return upper(ul[0])+ul[1:]
+ else:
+ if ul[0:1]=='_' and not u[0:1]=='_':
+ return 'X%s' % (ul)
+ else:
+ return upper(ul[0])+ul[1:]
+
+always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ 'abcdefghijklmnopqrstuvwxyz'
+ '0123456789' '_.-')
+_fast_safe_test = always_safe + '/'
+_fast_safe = None
+
+def quote_x(s, safe = '/'):
+ safe = always_safe + safe
+ if _fast_safe_test == safe:
+ return _fast_quote_x(s)
+ res = list(s)
+ for i in range(len(res)):
+ c = res[i]
+ if c not in safe:
+ res[i] = '_%02x' % ord(c)
+ return ''.join(res)
+
+def _fast_quote_x(s):
+ global _fast_safe
+ if _fast_safe is None:
+ _fast_safe = {}
+ for c in _fast_safe_test:
+ _fast_safe[c] = c
+ res = list(s)
+ for i in range(len(res)):
+ c = res[i]
+ if not _fast_safe.has_key(c):
+ res[i] = '_%02x' % ord(c)
+ return ''.join(res)
diff -ruN ./ZWiki-0.12.0/ZWikiPage.py ./ZWiki/ZWikiPage.py
--- ./ZWiki-0.12.0/ZWikiPage.py Sat Nov 2 20:31:23 2002
+++ ./ZWiki/ZWikiPage.py Sat Nov 2 21:30:18 2002
@@ -15,7 +15,7 @@
import os, sys, re, string, time, math, traceback
from DateTime import DateTime
-from string import split,join,find,lower,rfind,atoi,strip
+from string import split,join,find,lower,rfind,atoi,strip,replace
from types import *
from wwml import translate_WMML
from AccessControl import getSecurityManager
@@ -913,7 +913,9 @@
# page = self.folder()[unquote(pagename)]
# I think they all need unquoting
# also allow for differing wikiname & id now
- page = self.pageWithName(unquote(pagename))
+ page = self.pageWithName(unquote_i(pagename,0))
+ if not page:
+ page = self.pageWithName(unquote_i(pagename,1))
# bah!!!
if page:
linktitle = page.linkTitle()
@@ -1652,7 +1654,7 @@
'APageWith_21'
>>> p.canonicalIdFrom('a_page')
'A_5fpage'
- >>> p.canonicalIdFrom('ÃPage')
+ >>> p.canonicalIdFrom('?Page')
'X_c3Page'
>>> p.canonicalIdFrom('_c3Page')
'X_5fc3Page'
@@ -2662,10 +2664,24 @@
titlestr=_('Edit conflict')
return MessageDialog(
title=titlestr,
- message="""
- %s
+ message="""
+ ÊÔ½¸¤Ç¾×Æͤ¬È¯À¸¤·¤Þ¤·¤¿
+ ¤¢¤Ê¤¿¤ÎÊÔ½¸Ãæ¤Ë¡¢¤É¤Ê¤¿¤«Â¾¤ÎÊý¤¬¤³¤Î¥Ú¡¼¥¸¤ò½ñÂؤ¨¤Þ¤·¤¿¡£
+ ¤³¤Î¾×Æͤò²ò·è¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤³¤È¤ò¼Â¹Ô¤·¤Æ²¼¤µ¤¤¡£:
+
+ - ¥Ö¥é¥¦¥¶¤Î¥Ð¥Ã¥¯¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£
+
- ¤¢¤Ê¤¿¤¬ÊÔ½¸¤·¤¿Éôʬ¤ò¥¯¥ê¥Ã¥×¥Ü¡¼¥È¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
+
- ¥ê¥Õ¥ì¥Ã¥·¥å¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£
+
- ¾¤ÎÉôʬ¤Ø¤Î±Æ¶Á¤Ëµ¤¤òÉÕ¤±¤Æ¡¢ÊÔ½¸²Õ½ê¤òÄ¥ÉÕ¤±¤ÆÉü¸µ¤·¤Þ¤¹¡£
+
- ºÆÅÙ¡¢Êѹ¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£
+
+ ¤Þ¤¿¤Ï
+
+ º£¤ÎÊÔ½¸¤ò¼Î¤Æ¤Æ¡¢²þ¤á¤Æ¿·µ¬¤ËÊÔ½¸¤·¤Þ¤¹¡££Ï£Ë¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£
+
+ %s
- %s.
+ %s.
%s:
- %s
@@ -2676,7 +2692,7 @@
%s,
- %s.
+ %s. |
""" % (
titlestr,
_("Someone else has saved this page while you were editing"),
@@ -3042,13 +3058,28 @@
# please clean me up
def linkTitleFrom(self,last_edit_time=None,last_editor=None,prettyprint=0):
"""
+ ºÇ½ª¹¹¿·»þ¤È¹¹¿·¼Ô¤Î¥ê¥ó¥¯¥¿¥¤¥È¥ëʸ»úÎó¤ÎÀ¸À®
make a link title string from these last_edit_time and editor strings
with prettyprint=1, format it for use in the standard header.
"""
interval = self.asAgeString(last_edit_time)
+ interval = replace(interval,'seconds','ÉÃ')
+ interval = replace(interval,'second','ÉÃ')
+ interval = replace(interval,'minutes','ʬ')
+ interval = replace(interval,'minute','ʬ')
+ interval = replace(interval,'hours','»þ´Ö')
+ interval = replace(interval,'hour','»þ´Ö')
+ interval = replace(interval,'days','Æü')
+ interval = replace(interval,'day','Æü')
+ interval = replace(interval,'weeks','½µ´Ö')
+ interval = replace(interval,'week','½µ´Ö')
+ interval = replace(interval,'months','·î')
+ interval = replace(interval,'month','·î')
+ interval = replace(interval,'years','ǯ')
+ interval = replace(interval,'year','ǯ')
if not prettyprint:
- s = "last edited %s ago" % (interval)
+ s = " %s Á°¹¹¿·" % (interval)
else:
try:
assert self.REQUEST.AUTHENTICATED_USER.has_permission(
@@ -3056,10 +3087,10 @@
#XXX do timezone conversion ?
lastlog = self.lastlog()
if lastlog: lastlog = ' ('+lastlog+')'
- s = 'last edited %s ago' % \
+ s = '%sÁ°¹¹¿·' % \
(self.page_url(), lastlog, interval)
except:
- s = 'last edited %s ago' % (interval)
+ s = ' %s Á°¹¹¿· ' % (interval)
if (last_editor and
not re.match(r'^[0-9\.\s]*$',last_editor)):
# escape some things that might cause trouble in an attribute
@@ -3417,3 +3448,30 @@
#large programs, it is wise to use some kind of convention that
#...
#verbs for methods and nouns for data attributes."
+
+
+def unquote_i(s,u=0):
+ """unquote('abc%20def') -> 'abc def'."""
+ mychr = chr
+ myatoi = int
+ if s[0:2]=='X_': s=s[1:]
+ pat=re.compile(r'(X_+[0-9a-f]+[0-9a-f]+)')
+ pat2=re.compile(r'[A-Z]+')
+ if re.match(pat,s[0:2]): s=s[1:]
+ else:
+ if u==1:
+ if re.match(pat2,s[0:1]):s=lower(s[0])+s[1:]
+ list = s.split('_')
+ res = [list[0]]
+ myappend = res.append
+ del list[0]
+ for item in list:
+ if item[1:2]:
+ try:
+ myappend(mychr(myatoi(item[:2], 16))
+ + item[2:])
+ except:
+ myappend('%' + item)
+ else:
+ myappend('%' + item)
+ return "".join(res)
diff -ruN ./ZWiki-0.12.0/dtml/zwikiPageAdd.dtml ./ZWiki/dtml/zwikiPageAdd.dtml
--- ./ZWiki-0.12.0/dtml/zwikiPageAdd.dtml Sat Nov 2 20:31:24 2002
+++ ./ZWiki/dtml/zwikiPageAdd.dtml Sat Nov 2 21:34:50 2002
@@ -1,14 +1,20 @@
-
+
+
+ZWiki¥Ú¡¼¥¸ ¤Î ÄɲÃ()
+
-
+ZWiki¥Ú¡¼¥¸ ¤Î ÄɲÃ()
+ ¡¡²¼¤Î¥Õ¥©¡¼¥à¤ò»È¤Ã¤Æ¿·¤·¤¤ZWiki¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ê¤Þ¤¹¡£
+ ƱÍͤˡ¢¡Ö³«¤¯(Browse)¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤Ç¤ª¼ê¸µ¤Î¥³¥ó¥Ô¥å¡¼¥¿
+ ¤è¤ê´û¸¤ÎHTML¥Õ¥¡¥¤¥ë¤òÁªÂò¤·¡¢·ÇºÜ¤·¤Æ¤â·ë¹½¤Ç¤¹¡£
You may create a new ZWiki Page object using the form below.
You may also choose to upload an existing html file from your
diff -ruN ./ZWiki-0.12.0/dtml/zwikiWebAdd.dtml ./ZWiki/dtml/zwikiWebAdd.dtml
--- ./ZWiki-0.12.0/dtml/zwikiWebAdd.dtml Sat Nov 2 20:31:24 2002
+++ ./ZWiki/dtml/zwikiWebAdd.dtml Sat Nov 2 23:49:45 2002
@@ -1,9 +1,12 @@
-
+
+
+ZWiki Web ¤Î ÄɲÃ()
+
-
+ZWiki Web ¤Î ÄɲÃ()