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
4dd2c42a
Commit
4dd2c42a
authored
Feb 04, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2451 from edx/db/i18n-dummy-path-py
Use path.py instead of os.path
parents
7e1e8fdc
b1be29ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
i18n/dummy.py
+5
-6
No files found.
i18n/dummy.py
View file @
4dd2c42a
...
...
@@ -24,8 +24,8 @@ where $DUMMY_LOCALE is the dummy_locale value set in the i18n config
"""
import
sys
import
os
import
polib
from
path
import
path
from
i18n.config
import
CONFIGURATION
from
i18n.execute
import
create_dir_if_necessary
...
...
@@ -164,7 +164,7 @@ def make_dummy(file, locale):
Takes a source po file, reads it, and writes out a new po file
in :param locale: containing a dummy translation.
"""
if
not
os
.
path
.
exists
(
file
):
if
not
path
(
file
)
.
exists
(
):
raise
IOError
(
'File does not exist:
%
s'
%
file
)
pofile
=
polib
.
pofile
(
file
)
converter
=
Dummy
()
...
...
@@ -182,10 +182,9 @@ def make_dummy(file, locale):
def
new_filename
(
original_filename
,
new_locale
):
"""Returns a filename derived from original_filename, using new_locale as the locale"""
orig_dir
=
os
.
path
.
dirname
(
original_filename
)
msgs_dir
=
os
.
path
.
basename
(
orig_dir
)
orig_file
=
os
.
path
.
basename
(
original_filename
)
return
os
.
path
.
abspath
(
os
.
path
.
join
(
orig_dir
,
'../..'
,
new_locale
,
msgs_dir
,
orig_file
))
f
=
path
(
original_filename
)
new_file
=
f
.
parent
.
parent
.
parent
/
new_locale
/
f
.
parent
.
name
/
f
.
name
return
new_file
.
abspath
()
def
main
():
...
...
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