Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-07-25 18:15:39 +0300
committerGhostkeeper <rubend@tutanota.com>2019-07-26 14:18:47 +0300
commitd1c4b639717f1efd26209278140264a702308858 (patch)
tree558b4872f35b6b2e30d2976181ff5aa41d1bb0fe /scripts
parent55af42bb466d530ba8090100c17132856c0d9309 (diff)
Add empty script to perform imports from Lionbridge
I want to automate this or it'll be a lot of work. Contributes to issue CURA-6663.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lionbridge_import.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/lionbridge_import.py b/scripts/lionbridge_import.py
new file mode 100644
index 0000000000..a876a90cfd
--- /dev/null
+++ b/scripts/lionbridge_import.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2019 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
+import argparse #To get the source directory from command line arguments.
+import os.path #To find files from the source and the destination path.
+
+## Imports translation files from Lionbridge.
+#
+# Lionbridge has a bit of a weird export feature. It exports it to the same
+# file type as what we imported, so that's a .pot file. However this .pot file
+# only contains the translations, so the header is completely empty. We need
+# to merge those translations into our existing files so that the header is
+# preserved.
+def lionbridge_import(source: str) -> None:
+ print("Importing from:", source)
+ print("Importing to:", destination())
+
+## Gets the destination path to copy the translations to.
+def destination() -> str:
+ return os.path.abspath(os.path.join(__file__, "..", "..", "resources", "i18n"))
+
+if __name__ == "__main__":
+ argparser = argparse.ArgumentParser(description = "Import translation files from Lionbridge.")
+ argparser.add_argument("source")
+ args = argparser.parse_args()
+ lionbridge_import(args.source) \ No newline at end of file