-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2019-06-27T11:40:13+09:00 Author: terapyon (terapyon) <terada@cmscom.jp> Commit: plone/plone.i18n@0e06fea bugfix Shortname starts "b" in Japanese plone/Products.CMFPlone#2901 Files changed: M plone/i18n/normalizer/ja.py Repository: plone.i18n Branch: refs/heads/master Date: 2019-06-27T11:48:33+09:00 Author: terapyon (terapyon) <terada@cmscom.jp> Commit: plone/plone.i18n@d410286 Added news for CHANGES log Files changed: A news/32.bugfix Repository: plone.i18n Branch: refs/heads/master Date: 2019-06-27T10:29:48+02:00 Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.i18n@508af06 Merge pull request #33 from terapyon/bugfix/ja-shortname-2901 Bugfix shortname status "b" in Japanese Files changed: A news/32.bugfix M plone/i18n/normalizer/ja.py
- Loading branch information
Showing
1 changed file
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
Repository: plone.recipe.precompiler | ||
Repository: plone.i18n | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2019-06-26T20:59:50+02:00 | ||
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> | ||
Commit: https://github.com/plone/plone.recipe.precompiler/commit/b64cf83636c9f073e2cee008e59d6c0457b8b8ba | ||
Date: 2019-06-27T11:40:13+09:00 | ||
Author: terapyon (terapyon) <terada@cmscom.jp> | ||
Commit: https://github.com/plone/plone.i18n/commit/0e06fea2c2e1876ea7b391e3bde1e343dc68966b | ||
|
||
fix ReST | ||
bugfix Shortname starts "b" in Japanese https://github.com/plone/Products.CMFPlone/issues/2901 | ||
|
||
Files changed: | ||
M README.rst | ||
M plone/i18n/normalizer/ja.py | ||
|
||
b'diff --git a/README.rst b/README.rst\nindex 968e048..b4ad513 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -49,6 +49,8 @@ warnings are harmless, you may suppress them by tuning the skip list.\n Options\n -------\n \n+::\n+\n recipe = plone.recipe.precompiler\n \n eggs = required: list of eggs\n@@ -67,4 +69,4 @@ Notes\n =====\n \n This recipe was created for use in Plone installers, but is hopefully useful in\n-many buildout contexts.\n\\ No newline at end of file\n+many buildout contexts.\n' | ||
b'diff --git a/plone/i18n/normalizer/ja.py b/plone/i18n/normalizer/ja.py\nindex a4fbdc7..5c99efc 100644\n--- a/plone/i18n/normalizer/ja.py\n+++ b/plone/i18n/normalizer/ja.py\n@@ -2,6 +2,7 @@\n from plone.i18n.normalizer.base import allowed\n from plone.i18n.normalizer.interfaces import INormalizer\n from zope.interface import implementer\n+import six\n \n \n MAX_LENGTH = 6\n@@ -27,9 +28,13 @@ def ja_normalize(text, max_length=MAX_LENGTH):\n """\n text = text.strip()\n if all(s in allowed for s in text):\n- return text.encode(\'ascii\')\n+ exchanged = text\n else:\n- return "".join(_gethashed(text, max_length))\n+ exchanged = "".join(_gethashed(text, max_length))\n+ if six.PY2:\n+ return exchanged.encode(\'ascii\')\n+ else:\n+ return exchanged\n \n \n @implementer(INormalizer)\n@@ -48,8 +53,8 @@ class Normalizer(object):\n \n >>> norm = Normalizer()\n >>> text = u"test page"\n- >>> norm.normalize(text) == b\'test page\'\n- True\n+ >>> norm.normalize(text)\n+ \'test page\'\n \n Text that contains non-ASCII characters are normalized.\n \n' | ||
|
||
Repository: plone.i18n | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2019-06-27T11:48:33+09:00 | ||
Author: terapyon (terapyon) <terada@cmscom.jp> | ||
Commit: https://github.com/plone/plone.i18n/commit/d41028615e8e08c3cd001f3f862478a6f3193e4a | ||
|
||
Added news for CHANGES log | ||
|
||
Files changed: | ||
A news/32.bugfix | ||
|
||
b'diff --git a/news/32.bugfix b/news/32.bugfix\nnew file mode 100644\nindex 0000000..6dd360f\n--- /dev/null\n+++ b/news/32.bugfix\n@@ -0,0 +1 @@\n+bugfix Shortname starts "b" in Japanese https://github.com/plone/Products.CMFPlone/issues/2901 [terapyon]\n\\ No newline at end of file\n' | ||
|
||
Repository: plone.i18n | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2019-06-27T10:29:48+02:00 | ||
Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com> | ||
Commit: https://github.com/plone/plone.i18n/commit/508af066c4bd21df89c5c4ab89b2168426e8215a | ||
|
||
Merge pull request #33 from terapyon/bugfix/ja-shortname-2901 | ||
|
||
Bugfix shortname status "b" in Japanese | ||
|
||
Files changed: | ||
A news/32.bugfix | ||
M plone/i18n/normalizer/ja.py | ||
|
||
b'diff --git a/news/32.bugfix b/news/32.bugfix\nnew file mode 100644\nindex 0000000..6dd360f\n--- /dev/null\n+++ b/news/32.bugfix\n@@ -0,0 +1 @@\n+bugfix Shortname starts "b" in Japanese https://github.com/plone/Products.CMFPlone/issues/2901 [terapyon]\n\\ No newline at end of file\ndiff --git a/plone/i18n/normalizer/ja.py b/plone/i18n/normalizer/ja.py\nindex a4fbdc7..5c99efc 100644\n--- a/plone/i18n/normalizer/ja.py\n+++ b/plone/i18n/normalizer/ja.py\n@@ -2,6 +2,7 @@\n from plone.i18n.normalizer.base import allowed\n from plone.i18n.normalizer.interfaces import INormalizer\n from zope.interface import implementer\n+import six\n \n \n MAX_LENGTH = 6\n@@ -27,9 +28,13 @@ def ja_normalize(text, max_length=MAX_LENGTH):\n """\n text = text.strip()\n if all(s in allowed for s in text):\n- return text.encode(\'ascii\')\n+ exchanged = text\n else:\n- return "".join(_gethashed(text, max_length))\n+ exchanged = "".join(_gethashed(text, max_length))\n+ if six.PY2:\n+ return exchanged.encode(\'ascii\')\n+ else:\n+ return exchanged\n \n \n @implementer(INormalizer)\n@@ -48,8 +53,8 @@ class Normalizer(object):\n \n >>> norm = Normalizer()\n >>> text = u"test page"\n- >>> norm.normalize(text) == b\'test page\'\n- True\n+ >>> norm.normalize(text)\n+ \'test page\'\n \n Text that contains non-ASCII characters are normalized.\n \n' | ||
|