From 65671e947bf6dc5a4531c3cba5aea755b292927f Mon Sep 17 00:00:00 2001 From: Andrew Ahn Date: Sat, 12 Oct 2024 19:05:02 -0700 Subject: [PATCH 1/2] Added file generation (PIP). --- .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 214 bytes .../__pycache__/generateFile.cpython-311.pyc | Bin 0 -> 1062 bytes .../__pycache__/generate_file.cpython-311.pyc | Bin 0 -> 850 bytes .../__pycache__/helpers.cpython-311.pyc | Bin 0 -> 1315 bytes .../src/internationalize/generate_file.py | 24 +++++++++++++++ i18nilize/src/internationalize/helpers.py | 8 ++++- .../jsonFile/translations.json | 15 +++++++++ .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 199 bytes .../test_generate_file.cpython-311.pyc | Bin 0 -> 2190 bytes i18nilize/tests/test_generate_file.py | 29 ++++++++++++++++++ 10 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 i18nilize/src/internationalize/__pycache__/__init__.cpython-311.pyc create mode 100644 i18nilize/src/internationalize/__pycache__/generateFile.cpython-311.pyc create mode 100644 i18nilize/src/internationalize/__pycache__/generate_file.cpython-311.pyc create mode 100644 i18nilize/src/internationalize/__pycache__/helpers.cpython-311.pyc create mode 100644 i18nilize/src/internationalize/generate_file.py create mode 100644 i18nilize/src/internationalize/jsonFile/translations.json create mode 100644 i18nilize/tests/__pycache__/__init__.cpython-311.pyc create mode 100644 i18nilize/tests/__pycache__/test_generate_file.cpython-311.pyc create mode 100644 i18nilize/tests/test_generate_file.py diff --git a/i18nilize/src/internationalize/__pycache__/__init__.cpython-311.pyc b/i18nilize/src/internationalize/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b889cd46a65049fd5a41716041c5d326f24e9562 GIT binary patch literal 214 zcmXv|K?(vf3~Uue1n~=Ay$If95kd4QDu}m0DQ#FHYb$9L^dmk&e3u^(ym_(}ox@}% zGmzXmowi6Q7VR?6N2WjIPrRB*T!j@I(U;4+;9Byp9KLB*z&0QU(9SZ#%Hf>pgfKPQ z;+{-^nYZN1-kSXmO$<A?)ppmrXV^=j@)* zkU$D68!ZGaQdlXXg_X5-78VJlIHn4Sh22RMf|YL;lNdwZu;09S-+OPqx9q;Q?KA>2 zj%O-G4WX~#uXm8IZaqFjz|IIG-=-CGnC1uNVqHv z+{ouF{B9@?%Y@GeWzl>-6kgtE5fv;>a07py=BGo>M*V>1|1CYEq7u)6AR~57Qk$)Y z(%@CN#hep|HFT(ty;e+;KW85M3s z)hK7G52d{om{cmnQBa|jgmr)=wB9EgC literal 0 HcmV?d00001 diff --git a/i18nilize/src/internationalize/__pycache__/generate_file.cpython-311.pyc b/i18nilize/src/internationalize/__pycache__/generate_file.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2e53ec10de4f063aa8dfa73c2c2db01f6c15a10 GIT binary patch literal 850 zcmZWn&ubGw6rR~1X`1a?o2acdLIf`((n1emKqz?XZJ~JS$u|qBRNu~i@4cDt&3wF>ueO~-U?1kJ7S|B^ zrIL|Bp4wRn+-F1(!68~#UJG$oTh}lm`g^pl6TF7X#;GDV%2-;ypk7QjIuU2SnjBdM z0v-M{1^^pkq7j`K#3Y$LgN%_Z8Q;@d8p-WxyC}w^GK4x8@eU%^_lbRwb}*8Mc5!U} z{smfJg-L?8f%p`r<;(*<4!T79oYrP-!o$fefcQh(jvl4ENZ!!i>vLRnnarJ=eeP15i7BB7cEl@psm zNH=`WV&F(iF*bO!L;W~XO(>Pl+3G#_RYXPPdW;C_K4&duz%S@1hD`;wVXcrPwH(*AAotrfh)4rBT5WwKs?-D9Z zf13N^{ z@*5I2fi9*2&a?Nsob*HbKolWW4<=dxNOX+x5Ltut8zSfM@<_6Id^F|9LL|AnQeC)SJ$+pgSNP*iBJp^i6}xhh{^)%pbW^g^U~3AW_dHZDQhkf zVIgEEJ$f?2TXcyo9Xl%QVHpsDPTe-PgLvxqd;2GMwcjw`H}CiR&3nIjzt4P##m*A2 zxy$PG6^W3aIH?)Tg_RR9Y!Z{0)FzX}lwOfZYRaIJsesBR9Vc4o7bcITDGpUT1EUOg z`31-(@sGuFu-Xpnuv^=OTq7&g$Ly-j)+0H(18?ru-(HcR7PuPUr^Hc{WPo@|R(dW^ zkSwKSf>5|}64WP+1(a)Yptu?41j?-Eg4(WOf-m~ave{I|@Mi)A9|OfSe8aj?(``3x*w(V)Tdt#9 z1H+C5Gp2hyty_-IxFaH%!t@ztXJGNZ%u*1UX8shG##>--+}~RS$&-U zqTMAzLzlKY5867`m$o|Jtgf%FDJ2BSP zwScSWi{j}BKaay4eO@;R9FN+uad%(sDX2a9(PB${qig*^K2=oX`TJ!^APtq*seB2M z#>!1^zKD^5woO-3PH@0h}kjUzi87_ zm9_t;R)D)OD1TOl!(ZueSW`GQOVA-&&avu`gtwy?`+pRCBr6{v3HO4VHF(oxOGr2g%IX@*cFI^#^C_gJTxuiHICqFqcC$lQC zBr`uRCezR&FB8a1jVVbj21>@qXXa&=#K-FuRQ}?y$<0qG%}KQ@Vg*_Sa!fHlkodsN O$jJDC0Y(%t1H}NE05l)~ literal 0 HcmV?d00001 diff --git a/i18nilize/tests/__pycache__/test_generate_file.cpython-311.pyc b/i18nilize/tests/__pycache__/test_generate_file.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ccda6d6dccbc21839b45b6a7ad820a4fa3beb02 GIT binary patch literal 2190 zcmbVN%}?V-6d%WS7)S!Uf{M-ViXv214He--5CVn53YOhV!%DEK6h*R3JOrnX&5oU_ zP%3354twmO5*)S?C%V;M_*0z9Qlq){#4Qy)?V;)$n*bwu5<-9QPOHh6%moGJ2x&+Y43rQ4LSBG=#E4YHyeM#)Xh;<~FAFGwo*_*- zM4C)cIodLIDkAhAzM$p1A_%m&)jtL1eXE1Op0I&Z(Q_`zr398J5tC5WAk@}~6-G50^o&P+~CZ_mz+O=PF$#-_Kj z6Jyz}nc|o>Gc`Lgp=C2I>ZlM^$tK3O&4GtMXe;xDmoUUG zsHR3qVcjIFRR5L~o)lG$RP>@O3+92LfpO zRJpc|>D@in! zrWE4k&Yk^_HliULU3avBLpHkaXrm`&BlbUR#6$DK@krd!MmQe5oi_Yx>C3TrxJu7? zIZ;j+HdM1zRZE0L*C;WIJ51gohGDU;Ez2xhRmvhci-|eQWa8I5dkpV_>{Zp$&w0|Y zu8m#Q)a@N6J+}-sB~pI4(r&I24PvGuG{yz@fY=;wc$o6cX7__k51kzQBezsTXiOhB z(*y!VG5F}Gy^|qtaN3)ZQ_0b)_s%w_? Date: Wed, 16 Oct 2024 21:14:45 -0700 Subject: [PATCH 2/2] Moved generate_file to helpers --- .../src/internationalize/generate_file.py | 24 ------------------- i18nilize/src/internationalize/helpers.py | 24 ++++++++++++++++++- 2 files changed, 23 insertions(+), 25 deletions(-) delete mode 100644 i18nilize/src/internationalize/generate_file.py diff --git a/i18nilize/src/internationalize/generate_file.py b/i18nilize/src/internationalize/generate_file.py deleted file mode 100644 index a230916..0000000 --- a/i18nilize/src/internationalize/generate_file.py +++ /dev/null @@ -1,24 +0,0 @@ -import json -from src.internationalize.helpers import create_json - -# Input: None (for now) -# Output: None, but creates a local JSON file containing translations -def generate_file(): - file_content = { - "Token": "85124f79-0829-4b80-8b5c-d52700d86e46", - "translations" : [{ - "language": "French", - "hello": "bonjour", - "No": "Non", - "Why": "pourquoi", - }, - { - "language": "Spanish", - "hello": "Hola", - }, - ] - } - - # transforms the dictionary object above into a JSON object - json_object = json.dumps(file_content, indent=4) - create_json(json_object) diff --git a/i18nilize/src/internationalize/helpers.py b/i18nilize/src/internationalize/helpers.py index 865b3ed..10b84da 100644 --- a/i18nilize/src/internationalize/helpers.py +++ b/i18nilize/src/internationalize/helpers.py @@ -17,4 +17,26 @@ def get_token(file_path): # Output: None, but creates a local JSON file containing the object def create_json(json_object): with open("src/internationalize/jsonFile/translations.json", "w") as outfile: - outfile.write(json_object) \ No newline at end of file + outfile.write(json_object) + +# Input: None (for now) +# Output: None, but creates a local JSON file containing translations +def generate_file(): + file_content = { + "Token": "85124f79-0829-4b80-8b5c-d52700d86e46", + "translations" : [{ + "language": "French", + "hello": "bonjour", + "No": "Non", + "Why": "pourquoi", + }, + { + "language": "Spanish", + "hello": "Hola", + }, + ] + } + + # transforms the dictionary object above into a JSON object + json_object = json.dumps(file_content, indent=4) + create_json(json_object)