Files
0ad/source/tools/i18n/txclib/paths.py
T
Gallaecio 64d204228a Message extraction and localization
It includes the translation template files (POT) as well as translation
files
(PO) developer through the Transifex platform by our awesome
translators.

It also includes tools to generate the translation template files,
generate a
special translation file with the longest strigns of all translations,
and a
tool to download translations from Transifex into the right game folders
automatically.

Fixes #67

This was SVN commit r14955.
2014-04-20 21:48:23 +00:00

37 lines
777 B
Python

# -*- coding: utf-8 -*-
"""
Path handling.
We need to take into account the differences between UNIX systems and
Windows.
"""
import os
posix_sep = os.sep if os.altsep is None else os.altsep
def posix_path(fpath):
"""Convert a filesystem path to a posix path.
Always use the forward slash as a separator. For instance,
in windows the separator is the backslash.
Args:
fpath: The path to convert.
"""
return fpath if os.altsep is None else fpath.replace(os.sep, os.altsep)
def native_path(fpath):
"""Convert a filesystem path to a native path.
Use whatever separator is defined by the platform.
Args:
fpath: The path to convert.
"""
return fpath if os.altsep is None else fpath.replace(os.altsep, os.sep)