mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Update doc strings for translation scripts
This commit is contained in:
parent
2277d225eb
commit
c517801c5f
@ -28,8 +28,10 @@ def manually_translate_file(filename, save=False):
|
|||||||
print("For each missing translation:")
|
print("For each missing translation:")
|
||||||
print("a) Directly enter a new tranlation in the target language")
|
print("a) Directly enter a new tranlation in the target language")
|
||||||
print("b) Leave empty to skip")
|
print("b) Leave empty to skip")
|
||||||
|
print("c) Press Ctrl+C to exit")
|
||||||
|
|
||||||
input("Press <ENTER> to continue")
|
print("-------------------------")
|
||||||
|
input("Press <ENTER> to start")
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
with open(filename, 'r') as f:
|
with open(filename, 'r') as f:
|
||||||
@ -58,7 +60,10 @@ def manually_translate_file(filename, save=False):
|
|||||||
print("Source:", source_line)
|
print("Source:", source_line)
|
||||||
print("Enter translation for {t}".format(t=msgid))
|
print("Enter translation for {t}".format(t=msgid))
|
||||||
|
|
||||||
translation = str(input(">"))
|
try:
|
||||||
|
translation = str(input(">"))
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
break
|
||||||
|
|
||||||
if translation and len(translation) > 0:
|
if translation and len(translation) > 0:
|
||||||
# Update the line with the new translation
|
# Update the line with the new translation
|
||||||
@ -71,7 +76,7 @@ def manually_translate_file(filename, save=False):
|
|||||||
output_file.writelines(out)
|
output_file.writelines(out)
|
||||||
|
|
||||||
print("Translation done: written to", filename)
|
print("Translation done: written to", filename)
|
||||||
print("Run 'make translate' to rebuild translation data")
|
print("Run 'invoke translate' to rebuild translation data")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user