luukfroling / sphinx-translation-button

Add a custom launch button to a jupyter-book which allows switching between translations.
0 stars 0 forks source link

Error when converting multipe po files to the same directory #1

Open Tom-van-Woudenberg opened 5 months ago

Tom-van-Woudenberg commented 5 months ago
$ python poToMo.py "gettext/intro.po" "./locale/nl/LC_MESSAGES/intro.mo"
[Translator3000] Compiling PO file to MO file... gettext/intro.po -> ./locale/nl/LC_MESSAGES/intro.mo
Traceback (most recent call last):
  File "C:\Users\tomvanwoudenbe\Git\Sandbox-GH\book\poToMo.py", line 25, in <module>
    compile_po_to_mo(po_file, mo_file)
  File "C:\Users\tomvanwoudenbe\Git\Sandbox-GH\book\poToMo.py", line 10, in compile_po_to_mo
    os.makedirs(os.path.dirname(mo_file))
  File "<frozen os>", line 225, in makedirs
FileExistsError: [WinError 183] Kan geen bestand maken dat al bestaat: './locale/nl/LC_MESSAGES'
(sandbox)
luukfroling commented 5 months ago

Fixed! put a condition in to check if the file already exists