Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4e298a1a
Commit
4e298a1a
authored
Jan 10, 2014
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an apostrophe to the Lorem text.
parent
2ad4749a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
i18n/dummy.py
+5
-3
i18n/tests/test_dummy.py
+9
-9
No files found.
i18n/dummy.py
View file @
4e298a1a
...
@@ -53,10 +53,12 @@ TABLE = {
...
@@ -53,10 +53,12 @@ TABLE = {
# The print industry's standard dummy text, in use since the 1500s
# The print industry's standard dummy text, in use since the 1500s
# see http://www.lipsum.com/, then fed through a "fancy-text" converter.
# see http://www.lipsum.com/, then fed through a "fancy-text" converter.
# The string should start with a space.
# The string should start with a space, so that it joins nicely with the text
# that precedes it. The Lorem contains an apostrophe since French often does,
# and translated strings get put into single-quoted strings, which then break.
LOREM
=
" "
+
" "
.
join
(
# join and split just make the string easier here.
LOREM
=
" "
+
" "
.
join
(
# join and split just make the string easier here.
u"""
u"""
Ⱡσяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂
Ⱡ
'
σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂
тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм
тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм
νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα
νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα
¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє
¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє
...
@@ -68,7 +70,7 @@ LOREM = " " + " ".join( # join and split just make the string easier here.
...
@@ -68,7 +70,7 @@ LOREM = " " + " ".join( # join and split just make the string easier here.
# To simulate more verbose languages (like German), pad the length of a string
# To simulate more verbose languages (like German), pad the length of a string
# by a multiple of PAD_FACTOR
# by a multiple of PAD_FACTOR
PAD_FACTOR
=
1.3
PAD_FACTOR
=
1.3
3
class
Dummy
(
Converter
):
class
Dummy
(
Converter
):
...
...
i18n/tests/test_dummy.py
View file @
4e298a1a
...
@@ -34,13 +34,13 @@ class TestDummy(TestCase):
...
@@ -34,13 +34,13 @@ class TestDummy(TestCase):
@ddt.data
(
@ddt.data
(
(
u"hello my name is Bond, James Bond"
,
(
u"hello my name is Bond, James Bond"
,
u"héllø mý nämé ïs Bønd, Jämés Bønd Ⱡσяєм ι#"
),
u"héllø mý nämé ïs Bønd, Jämés Bønd Ⱡ
'
σяєм ι#"
),
(
u"don't convert <a href='href'>tag ids</a>"
,
(
u"don't convert <a href='href'>tag ids</a>"
,
u"døn't çønvért <a href='href'>täg ïds</a> Ⱡσяєм ιρѕυ#"
),
u"døn't çønvért <a href='href'>täg ïds</a> Ⱡ
'
σяєм ιρѕυ#"
),
(
u"don't convert
%(name)
s tags on
%(date)
s"
,
(
u"don't convert
%(name)
s tags on
%(date)
s"
,
u"døn't çønvért
%(name)
s tägs øn
%(date)
s Ⱡσяєм ιρѕ#"
),
u"døn't çønvért
%(name)
s tägs øn
%(date)
s Ⱡ
'
σяєм ιρѕ#"
),
)
)
def
test_dummy
(
self
,
data
):
def
test_dummy
(
self
,
data
):
"""
"""
...
@@ -53,17 +53,17 @@ class TestDummy(TestCase):
...
@@ -53,17 +53,17 @@ class TestDummy(TestCase):
def
test_singular
(
self
):
def
test_singular
(
self
):
entry
=
POEntry
()
entry
=
POEntry
()
entry
.
msgid
=
'A lovely day for a cup of tea.'
entry
.
msgid
=
"A lovely day for a cup of tea."
expected
=
u
'À løvélý däý før ä çüp øf téä. Ⱡσяєм ι#'
expected
=
u
"À løvélý däý før ä çüp øf téä. Ⱡ'σяєм #"
self
.
converter
.
convert_msg
(
entry
)
self
.
converter
.
convert_msg
(
entry
)
self
.
assertUnicodeEquals
(
entry
.
msgstr
,
expected
)
self
.
assertUnicodeEquals
(
entry
.
msgstr
,
expected
)
def
test_plural
(
self
):
def
test_plural
(
self
):
entry
=
POEntry
()
entry
=
POEntry
()
entry
.
msgid
=
'A lovely day for a cup of tea.'
entry
.
msgid
=
"A lovely day for a cup of tea."
entry
.
msgid_plural
=
'A lovely day for some cups of tea.'
entry
.
msgid_plural
=
"A lovely day for some cups of tea."
expected_s
=
u
'À løvélý däý før ä çüp øf téä. Ⱡσяєм ι#'
expected_s
=
u
"À løvélý däý før ä çüp øf téä. Ⱡ'σяєм #"
expected_p
=
u
'À løvélý däý før sømé çüps øf téä. Ⱡσяєм ιρ#'
expected_p
=
u
"À løvélý däý før sømé çüps øf téä. Ⱡ'σяєм ιρ#"
self
.
converter
.
convert_msg
(
entry
)
self
.
converter
.
convert_msg
(
entry
)
result
=
entry
.
msgstr_plural
result
=
entry
.
msgstr_plural
self
.
assertUnicodeEquals
(
result
[
'0'
],
expected_s
)
self
.
assertUnicodeEquals
(
result
[
'0'
],
expected_s
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment