Skip to content

Commit

Permalink
Fixed output format with plural terms.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lednerb committed Sep 8, 2018
1 parent 415ede3 commit 615026e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions poeditor2hugo.py
@@ -1,10 +1,8 @@
#!/usr/bin/env python3
import sys, os, os.path, errno
import sys, os, os.path
import requests
from tqdm import tqdm



# Greeting
os.system('cls' if os.name == 'nt' else 'clear')
print()
Expand Down Expand Up @@ -64,15 +62,15 @@
# Convert and write file
with open(LANGUAGE_FILE_PATH + language.get('code') + '.toml', 'w', 1, 'utf-8') as file:
for string in f.json():
if string.get('definition') is not None:
if string.get('definition'):
definition = string.get('definition')

if type(definition) is dict:
if (definition.get('one') is not '') or (definition.get('other') is not ''):
if definition.get('one') or definition.get('other'):
file.write("[" + string.get('term') + "]\n")
if(definition.get('one') is not None):
if(definition.get('one')):
file.write('one = "' + definition.get("one") + '"\n')
if(definition.get('other') is not None):
if(definition.get('other')):
file.write('other = "' + definition.get("other") + '"\n')
file.write("\n")
else:
Expand Down

0 comments on commit 615026e

Please sign in to comment.