From aa6fa9cc685b8e350c2daf731bc076f0644ef998 Mon Sep 17 00:00:00 2001 From: rudu <40572253+anon1892@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:38:57 +0100 Subject: [PATCH 1/8] Allow running with Python 3.11 --- poetry.lock | 8 +-- pyproject.toml | 2 +- requirements.txt | 152 +++++++++++++++++++++++------------------------ 3 files changed, 81 insertions(+), 81 deletions(-) diff --git a/poetry.lock b/poetry.lock index 65e50450..81580fc3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -15,7 +15,7 @@ optional = false python-versions = ">=3.8" [package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.12\""} idna = ">=2.8" sniffio = ">=1.1" @@ -57,7 +57,7 @@ click = ">=8.0.0" mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} +tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.12.0a7\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -148,7 +148,7 @@ optional = false python-versions = ">=3.8" [package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.12.0a6\" and extra == \"toml\""} [package.extras] toml = ["tomli"] @@ -384,7 +384,7 @@ python-versions = ">=3.8" [package.dependencies] mypy-extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomli = {version = ">=1.1.0", markers = "python_version < \"3.12\""} typing-extensions = ">=4.1.0" [package.extras] diff --git a/pyproject.toml b/pyproject.toml index 0c22de84..88b16667 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ homepage = "https://openandroidinstaller.org" include = ["openandroidinstaller/bin/*", "openandroidinstaller/bin/*/*"] [tool.poetry.dependencies] -python = "<3.11,>=3.9" +python = "<3.12,>=3.9" click = "^8.1.3" flet = "^0.7.4" black = "^22.8.0" diff --git a/requirements.txt b/requirements.txt index db0a1ce7..e53720f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,13 @@ -altgraph==0.17.4 ; python_version >= "3.9" and python_version < "3.11" \ +altgraph==0.17.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406 \ --hash=sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff -anyio==4.0.0 ; python_version >= "3.9" and python_version < "3.11" \ +anyio==4.0.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:cfdb2b588b9fc25ede96d8db56ed50848b0b649dca3dd1df0b11f683bb9e0b5f \ --hash=sha256:f7ed51751b2c2add651e5747c891b47e26d2a21be5d32d9311dfe9692f3e5d7a -bandit==1.7.5 ; python_version >= "3.9" and python_version < "3.11" \ +bandit==1.7.5 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:75665181dc1e0096369112541a056c59d1c5f66f9bb74a8d686c3c362b83f549 \ --hash=sha256:bdfc739baa03b880c2d15d0431b31c658ffc348e907fe197e54e0389dd59e11e -black==22.12.0 ; python_version >= "3.9" and python_version < "3.11" \ +black==22.12.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:101c69b23df9b44247bd88e1d7e90154336ac4992502d4197bdac35dd7ee3320 \ --hash=sha256:159a46a4947f73387b4d83e87ea006dbb2337eab6c879620a3ba52699b1f4351 \ --hash=sha256:1f58cbe16dfe8c12b7434e50ff889fa479072096d79f0a7f25e4ab8e94cd8350 \ @@ -20,7 +20,7 @@ black==22.12.0 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:9eedd20838bd5d75b80c9f5487dbcb06836a43833a37846cf1d8c1cc01cef59d \ --hash=sha256:c116eed0efb9ff870ded8b62fe9f28dd61ef6e9ddd28d83d7d264a38417dcee2 \ --hash=sha256:d30b212bffeb1e252b31dd269dfae69dd17e06d92b87ad26e23890f3efea366f -brotli==1.1.0 ; python_version >= "3.9" and python_version < "3.11" and platform_python_implementation == "CPython" \ +brotli==1.1.0 ; python_version >= "3.9" and python_version < "3.12" and platform_python_implementation == "CPython" \ --hash=sha256:03d20af184290887bdea3f0f78c4f737d126c74dc2f3ccadf07e54ceca3bf208 \ --hash=sha256:0541e747cce78e24ea12d69176f6a7ddb690e62c425e01d31cc065e69ce55b48 \ --hash=sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354 \ @@ -104,7 +104,7 @@ brotli==1.1.0 ; python_version >= "3.9" and python_version < "3.11" and platform --hash=sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596 \ --hash=sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2 \ --hash=sha256:fdc3ff3bfccdc6b9cc7c342c03aa2400683f0cb891d46e94b64a197910dc4064 -brotlicffi==1.1.0.0 ; python_version >= "3.9" and python_version < "3.11" and platform_python_implementation == "PyPy" \ +brotlicffi==1.1.0.0 ; python_version >= "3.9" and python_version < "3.12" and platform_python_implementation == "PyPy" \ --hash=sha256:19ffc919fa4fc6ace69286e0a23b3789b4219058313cf9b45625016bf7ff996b \ --hash=sha256:1a807d760763e398bbf2c6394ae9da5815901aa93ee0a37bca5efe78d4ee3171 \ --hash=sha256:1b12b50e07c3911e1efa3a8971543e7648100713d4e0971b13631cce22c587eb \ @@ -132,10 +132,10 @@ brotlicffi==1.1.0.0 ; python_version >= "3.9" and python_version < "3.11" and pl --hash=sha256:ce01c7316aebc7fce59da734286148b1d1b9455f89cf2c8a4dfce7d41db55c2d \ --hash=sha256:d9eb71bb1085d996244439154387266fd23d6ad37161f6f52f1cd41dd95a3808 \ --hash=sha256:fa8ca0623b26c94fccc3a1fdd895be1743b838f3917300506d04aa3346fd2a14 -certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.11" \ +certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 -cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.11" and platform_python_implementation == "PyPy" \ +cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.12" and platform_python_implementation == "PyPy" \ --hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \ --hash=sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a \ --hash=sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417 \ @@ -188,7 +188,7 @@ cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.11" and platform_ --hash=sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627 \ --hash=sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956 \ --hash=sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357 -charset-normalizer==3.3.0 ; python_version >= "3.9" and python_version < "3.11" \ +charset-normalizer==3.3.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:02673e456dc5ab13659f85196c534dc596d4ef260e4d86e856c3b2773ce09843 \ --hash=sha256:02af06682e3590ab952599fbadac535ede5d60d78848e555aa58d0c0abbde786 \ --hash=sha256:03680bb39035fbcffe828eae9c3f8afc0428c91d38e7d61aa992ef7a59fb120e \ @@ -279,16 +279,16 @@ charset-normalizer==3.3.0 ; python_version >= "3.9" and python_version < "3.11" --hash=sha256:f5969baeaea61c97efa706b9b107dcba02784b1601c74ac84f2a532ea079403e \ --hash=sha256:f8888e31e3a85943743f8fc15e71536bda1c81d5aa36d014a3c0c44481d7db6e \ --hash=sha256:fc52b79d83a3fe3a360902d3f5d79073a993597d48114c29485e9431092905d8 -click==8.1.7 ; python_version >= "3.9" and python_version < "3.11" \ +click==8.1.7 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de -colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.11" and (platform_system == "Windows" or sys_platform == "win32") \ +colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and (platform_system == "Windows" or sys_platform == "win32") \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 -contextlib2==21.6.0 ; python_version >= "3.9" and python_version < "3.11" \ +contextlib2==21.6.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:3fbdb64466afd23abaf6c977627b75b6139a5a3e8ce38405c5b413aed7a0471f \ --hash=sha256:ab1e2bfe1d01d968e1b7e8d9023bc51ef3509bba217bb730cee3827e1ee82869 -coverage[toml]==7.3.2 ; python_version >= "3.9" and python_version < "3.11" \ +coverage[toml]==7.3.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \ --hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \ --hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \ @@ -341,13 +341,13 @@ coverage[toml]==7.3.2 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f94b734214ea6a36fe16e96a70d941af80ff3bfd716c141300d95ebc85339738 \ --hash=sha256:fa28e909776dc69efb6ed975a63691bc8172b64ff357e663a1bb06ff3c9b589a \ --hash=sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4 -exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11" \ +exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \ --hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3 -flet-core==0.7.4 ; python_version >= "3.9" and python_version < "3.11" \ +flet-core==0.7.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:f161bba1d6221ab7b0e06c03f8c52ecd03e60e7ed5fc69a8701a6ba2ab1b08dc \ --hash=sha256:fa208e8cf1a64613a57c497526a9cb6eb46d153bed61f5ebb9518baf56d15c52 -flet==0.7.4 ; python_version >= "3.9" and python_version < "3.11" \ +flet==0.7.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:005eb2656672f938065799b17d2cc6f7f8af767f8fed7658437453978380221a \ --hash=sha256:192ebd5f6a6717c693e47a5c632de949b45935d37fca543d85763ff454edebd0 \ --hash=sha256:77024ccbea20ab6c734002fc3617b12d6eea9bc555e3e9fedf37eb0da4c05e00 \ @@ -358,25 +358,25 @@ flet==0.7.4 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:d182626579b8f8edbd31d054740761862761568090614d7a972e4a3fdc8f3b95 \ --hash=sha256:d5056777371895c38e32bfb947be2a1ee97aedaf0b9cf75f2dcdad225aeaf095 \ --hash=sha256:ffdd02df1d16027111a3d97d874cae06fc7c9df792fc73c96cb58a1eb226f92e -gitdb==4.0.10 ; python_version >= "3.9" and python_version < "3.11" \ +gitdb==4.0.10 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:6eb990b69df4e15bad899ea868dc46572c3f75339735663b81de79b06f17eb9a \ --hash=sha256:c286cf298426064079ed96a9e4a9d39e7f3e9bf15ba60701e95f5492f28415c7 -gitpython==3.1.37 ; python_version >= "3.9" and python_version < "3.11" \ +gitpython==3.1.37 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:5f4c4187de49616d710a77e98ddf17b4782060a1788df441846bddefbb89ab33 \ --hash=sha256:f9b9ddc0761c125d5780eab2d64be4873fc6817c2899cbcb34b02344bdc7bc54 -h11==0.14.0 ; python_version >= "3.9" and python_version < "3.11" \ +h11==0.14.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 -httpcore==0.16.3 ; python_version >= "3.9" and python_version < "3.11" \ +httpcore==0.16.3 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb \ --hash=sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0 -httpx==0.23.3 ; python_version >= "3.9" and python_version < "3.11" \ +httpx==0.23.3 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9 \ --hash=sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6 -idna==3.4 ; python_version >= "3.9" and python_version < "3.11" \ +idna==3.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 -inflate64==0.3.1 ; python_version >= "3.9" and python_version < "3.11" \ +inflate64==0.3.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:08c3b03514d4b849901762a32a45eeba7fd5d784fec698eca6975f41cca33672 \ --hash=sha256:094ef56a87c7b7398d93af7bfe7f24f830f24b6e55b77426f6516cef43e05460 \ --hash=sha256:09dd0f8d6dee0da467c264dbd9bca8b33f9c915860fc3385f2a633640a65bd10 \ @@ -446,31 +446,31 @@ inflate64==0.3.1 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f39b57974db0e85897fff40518da420f4c4012b73515ca6f415a472228fea288 \ --hash=sha256:fd04764d0bb830414788cae897d082bf6ad92324e571a5511bd7e1de4a0cdc67 \ --hash=sha256:fde3f85864c84badb26f42d95639360e627fd09c529a76c46a06dbd7a5735c51 -iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.11" \ +iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 -isort==5.12.0 ; python_version >= "3.9" and python_version < "3.11" \ +isort==5.12.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504 \ --hash=sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6 -loguru==0.6.0 ; python_version >= "3.9" and python_version < "3.11" \ +loguru==0.6.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c \ --hash=sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3 -macholib==1.16.3 ; python_version >= "3.9" and python_version < "3.11" and sys_platform == "darwin" \ +macholib==1.16.3 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "darwin" \ --hash=sha256:07ae9e15e8e4cd9a788013d81f5908b3609aa76f9b1421bae9c4d7606ec86a30 \ --hash=sha256:0e315d7583d38b8c77e815b1ecbdbf504a8258d8b3e17b61165c6feb60d18f2c -markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "3.11" \ +markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \ --hash=sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb -mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.11" \ +mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba -multivolumefile==0.2.3 ; python_version >= "3.9" and python_version < "3.11" \ +multivolumefile==0.2.3 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:237f4353b60af1703087cf7725755a1f6fcaeeea48421e1896940cd1c920d678 \ --hash=sha256:a0648d0aafbc96e59198d5c17e9acad7eb531abea51035d08ce8060dcad709d6 -mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "3.11" \ +mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 -mypy==1.6.0 ; python_version >= "3.9" and python_version < "3.11" \ +mypy==1.6.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:091f53ff88cb093dcc33c29eee522c087a438df65eb92acd371161c1f4380ff0 \ --hash=sha256:1a69db3018b87b3e6e9dd28970f983ea6c933800c9edf8c503c3135b3274d5ad \ --hash=sha256:24f3de8b9e7021cd794ad9dfbf2e9fe3f069ff5e28cb57af6f873ffec1cb0425 \ @@ -498,22 +498,22 @@ mypy==1.6.0 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:eb7ff4007865833c470a601498ba30462b7374342580e2346bf7884557e40531 \ --hash=sha256:f8598307150b5722854f035d2e70a1ad9cc3c72d392c34fffd8c66d888c90f17 \ --hash=sha256:fea451a3125bf0bfe716e5d7ad4b92033c471e4b5b3e154c67525539d14dc15a -oauthlib==3.2.2 ; python_version >= "3.9" and python_version < "3.11" \ +oauthlib==3.2.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8139f29aac13e25d502680e9e19963e83f16838d48a0d71c287fe40e7067fbca \ --hash=sha256:9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918 -packaging==23.2 ; python_version >= "3.9" and python_version < "3.11" \ +packaging==23.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 -pathspec==0.11.2 ; python_version >= "3.9" and python_version < "3.11" \ +pathspec==0.11.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20 \ --hash=sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3 -pbr==5.11.1 ; python_version >= "3.9" and python_version < "3.11" \ +pbr==5.11.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:567f09558bae2b3ab53cb3c1e2e33e726ff3338e7bae3db5dc954b3a44eef12b \ --hash=sha256:aefc51675b0b533d56bb5fd1c8c6c0522fe31896679882e1c4c63d5e4a0fccb3 -pefile==2023.2.7 ; python_version >= "3.9" and python_version < "3.11" and sys_platform == "win32" \ +pefile==2023.2.7 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" \ --hash=sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc \ --hash=sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6 -pillow==10.0.1 ; python_version >= "3.9" and python_version < "3.11" \ +pillow==10.0.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:0462b1496505a3462d0f35dc1c4d7b54069747d65d00ef48e736acda2c8cbdff \ --hash=sha256:186f7e04248103482ea6354af6d5bcedb62941ee08f7f788a1c7707bc720c66f \ --hash=sha256:19e9adb3f22d4c416e7cd79b01375b17159d6990003633ff1d8377e21b7f1b21 \ @@ -568,13 +568,13 @@ pillow==10.0.1 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f6d3d4c905e26354e8f9d82548475c46d8e0889538cb0657aa9c6f0872a37aa4 \ --hash=sha256:fcb59711009b0168d6ee0bd8fb5eb259c4ab1717b2f538bbf36bacf207ef7a68 \ --hash=sha256:fd2a5403a75b54661182b75ec6132437a181209b901446ee5724b589af8edef1 -platformdirs==3.11.0 ; python_version >= "3.9" and python_version < "3.11" \ +platformdirs==3.11.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3 \ --hash=sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e -pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.11" \ +pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 -psutil==5.9.5 ; python_version >= "3.9" and python_version < "3.11" and sys_platform != "cygwin" \ +psutil==5.9.5 ; python_version >= "3.9" and python_version < "3.12" and sys_platform != "cygwin" \ --hash=sha256:104a5cc0e31baa2bcf67900be36acde157756b9c44017b86b2c049f11957887d \ --hash=sha256:3c6f686f4225553615612f6d9bc21f1c0e305f75d7d8454f9b46e901778e7217 \ --hash=sha256:4aef137f3345082a3d3232187aeb4ac4ef959ba3d7c10c33dd73763fbc063da4 \ @@ -589,10 +589,10 @@ psutil==5.9.5 ; python_version >= "3.9" and python_version < "3.11" and sys_plat --hash=sha256:be8929ce4313f9f8146caad4272f6abb8bf99fc6cf59344a3167ecd74f4f203f \ --hash=sha256:c607bb3b57dc779d55e1554846352b4e358c10fff3abf3514a7a6601beebdb30 \ --hash=sha256:ea8518d152174e1249c4f2a1c89e3e6065941df2fa13a1ab45327716a23c2b48 -py7zr==0.20.6 ; python_version >= "3.9" and python_version < "3.11" \ +py7zr==0.20.6 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:c7cfb7183fb8f48038f1036a116ca89dc8bd57979d05b75567f00e88a5afe698 \ --hash=sha256:d036dee11fce69ad8d4fa86025ccfc4a3511ec27ee1c6b5bd8d6759313dbd077 -pybcj==1.0.1 ; python_version >= "3.9" and python_version < "3.11" \ +pybcj==1.0.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:023082fd677f67ebd36fe96322a4a45ac33a2b340d49010d88e1867c76744c50 \ --hash=sha256:05fad9a905772774aacc96cb174571ac1f5afa80b9f54c6ec414d369865d305c \ --hash=sha256:09872b32edad4e3653d5b357b244d267ca58fe52d4e1dd3cdff816d3bb9d9f7c \ @@ -671,10 +671,10 @@ pybcj==1.0.1 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f8576a1dcf445ef064bf8c3b2cdc1d6353e41cb4b366329946883e285dcbcec0 \ --hash=sha256:fa787b414c4dc6b6cd75338fac18a7dbb53a09443dd863020a2d2bda76940ca6 \ --hash=sha256:fda423836d7d69cba6a6f99e7a34c2e5fe3621e5e945cd25ea9ba60a96223254 -pycparser==2.21 ; python_version >= "3.9" and python_version < "3.11" and platform_python_implementation == "PyPy" \ +pycparser==2.21 ; python_version >= "3.9" and python_version < "3.12" and platform_python_implementation == "PyPy" \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 -pycryptodomex==3.19.0 ; python_version >= "3.9" and python_version < "3.11" \ +pycryptodomex==3.19.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:09c9401dc06fb3d94cb1ec23b4ea067a25d1f4c6b7b118ff5631d0b5daaab3cc \ --hash=sha256:0b2f1982c5bc311f0aab8c293524b861b485d76f7c9ab2c3ac9a25b6f7655975 \ --hash=sha256:136b284e9246b4ccf4f752d435c80f2c44fc2321c198505de1d43a95a3453b3c \ @@ -707,13 +707,13 @@ pycryptodomex==3.19.0 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:eb2fc0ec241bf5e5ef56c8fbec4a2634d631e4c4f616a59b567947a0f35ad83c \ --hash=sha256:edbe083c299835de7e02c8aa0885cb904a75087d35e7bab75ebe5ed336e8c3e2 \ --hash=sha256:ff64fd720def623bf64d8776f8d0deada1cc1bf1ec3c1f9d6f5bb5bd098d034f -pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.11" \ +pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692 \ --hash=sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29 -pyinstaller-hooks-contrib==2023.9 ; python_version >= "3.9" and python_version < "3.11" \ +pyinstaller-hooks-contrib==2023.9 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:76084b5988e3957a9df169d2a935d65500136967e710ddebf57263f1a909cd80 \ --hash=sha256:f34f4c6807210025c8073ebe665f422a3aa2ac5f4c7ebf4c2a26cc77bebf63b5 -pyinstaller==5.13.2 ; python_version >= "3.9" and python_version < "3.11" \ +pyinstaller==5.13.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:16cbd66b59a37f4ee59373a003608d15df180a0d9eb1a29ff3bfbfae64b23d0f \ --hash=sha256:27cd64e7cc6b74c5b1066cbf47d75f940b71356166031deb9778a2579bb874c6 \ --hash=sha256:2c2fe9c52cb4577a3ac39626b84cf16cf30c2792f785502661286184f162ae0d \ @@ -726,7 +726,7 @@ pyinstaller==5.13.2 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:c63ef6133eefe36c4b2f4daf4cfea3d6412ece2ca218f77aaf967e52a95ac9b8 \ --hash=sha256:c8e5d3489c3a7cc5f8401c2d1f48a70e588f9967e391c3b06ddac1f685f8d5d2 \ --hash=sha256:ddcc2b36052a70052479a9e5da1af067b4496f43686ca3cdda99f8367d0627e4 -pyppmd==1.0.0 ; python_version >= "3.9" and python_version < "3.11" \ +pyppmd==1.0.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:024f714ebb8ddf59dae164adc3c220c24555d470f4adb5bd022abc50298cfff3 \ --hash=sha256:05950d8a39fd9bf6c64572d69a6dd0a1af3fadf8d4a2a0bb62f5b04c0a618300 \ --hash=sha256:075c9bd297e3b0a87dd7aeabca7fee668218acbe69ecc1c6511064558de8840f \ @@ -805,22 +805,22 @@ pyppmd==1.0.0 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f7a1b08612627d5280ef2dad1fadb0b1a10c70df0c484f9091eff5fab5e4c84e \ --hash=sha256:f8dbe3076fe20c4d65cb1d1b51eeb17a1c177402b83100017a55daad888e198e \ --hash=sha256:f9a3782f5accab4186d68c86defc61fcc7d0146e9cdc5b54e18656852c71db16 -pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.11" \ +pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6 \ --hash=sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a -pytest-mock==3.11.1 ; python_version >= "3.9" and python_version < "3.11" \ +pytest-mock==3.11.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:21c279fff83d70763b05f8874cc9cfb3fcacd6d354247a976f9529d19f9acf39 \ --hash=sha256:7f6b125602ac6d743e523ae0bfa71e1a697a2f5534064528c6ff84c2f7c2fc7f -pytest-subprocess==1.5.0 ; python_version >= "3.9" and python_version < "3.11" \ +pytest-subprocess==1.5.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:d7693b96f588f39b84c7b2b5c04287459246dfae6be1dd4098937a728ad4fbe3 \ --hash=sha256:dfd75b10af6800a89a9b758f2e2eceff9de082a27bd1388521271b6e8bde298b -pytest==7.4.2 ; python_version >= "3.9" and python_version < "3.11" \ +pytest==7.4.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002 \ --hash=sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069 -pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.11" and sys_platform == "win32" \ +pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" \ --hash=sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60 \ --hash=sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7 -pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.11" \ +pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ --hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \ @@ -861,7 +861,7 @@ pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f -pyzstd==0.15.9 ; python_version >= "3.9" and python_version < "3.11" \ +pyzstd==0.15.9 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:00c188704141c709da96cc4a79f058d51f5318e839d6f904c7cc9badcf78e98e \ --hash=sha256:013321ddaff083b24e43a8b06303446771978343b488ed73adf56c70a46e2783 \ --hash=sha256:0a4334e972109bdd17fb40dbdd9fcca6137648cab416fca505a2dcd186f50533 \ @@ -967,7 +967,7 @@ pyzstd==0.15.9 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f7cfc683d320402d61205a196ace77f15dcfd16b5771f8b9ffaf406868c98e78 \ --hash=sha256:f9c5fc29a5b9d61a8f0a3494172107e0e6cf23d0cb800d6285c6722ba7fc3535 \ --hash=sha256:fc92a718bccb8ce5c9eb63fca743c38f3fa4c4e47f58f0c4ada51b2474668184 -regex==2022.10.31 ; python_version >= "3.9" and python_version < "3.11" \ +regex==2022.10.31 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:052b670fafbe30966bbe5d025e90b2a491f85dfe5b2583a163b5e60a85a321ad \ --hash=sha256:0653d012b3bf45f194e5e6a41df9258811ac8fc395579fa82958a8b76286bea4 \ --hash=sha256:0a069c8483466806ab94ea9068c34b200b8bfc66b6762f45a831c4baaa9e8cdd \ @@ -1056,19 +1056,19 @@ regex==2022.10.31 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:e4f781ffedd17b0b834c8731b75cce2639d5a8afe961c1e58ee7f1f20b3af185 \ --hash=sha256:e613a98ead2005c4ce037c7b061f2409a1a4e45099edb0ef3200ee26ed2a69a8 \ --hash=sha256:ef4163770525257876f10e8ece1cf25b71468316f61451ded1a6f44273eedeb5 -repath==0.9.0 ; python_version >= "3.9" and python_version < "3.11" \ +repath==0.9.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8292139bac6a0e43fd9d70605d4e8daeb25d46672e484ed31a24c7ce0aef0fb7 \ --hash=sha256:ee079d6c91faeb843274d22d8f786094ee01316ecfe293a1eb6546312bb6a318 -requests==2.31.0 ; python_version >= "3.9" and python_version < "3.11" \ +requests==2.31.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 -rfc3986[idna2008]==1.5.0 ; python_version >= "3.9" and python_version < "3.11" \ +rfc3986[idna2008]==1.5.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835 \ --hash=sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97 -rich==13.6.0 ; python_version >= "3.9" and python_version < "3.11" \ +rich==13.6.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245 \ --hash=sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef -ruff==0.0.25 ; python_version >= "3.9" and python_version < "3.11" \ +ruff==0.0.25 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:00383f785841f2c04d9eb281d316fd74e0b4f9171b641bd20fab98273b39c097 \ --hash=sha256:0f7b52bffa9201e4d68576634908e931a05304d434e798bfb1a5bec0dfa0474c \ --hash=sha256:196714934f0c902ef4d1bf2fad8dd60a23c03a1077dad8ecd9a4ce9c3dc10937 \ @@ -1085,37 +1085,37 @@ ruff==0.0.25 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:e774538075e7f3d1e3d4ea4f18d8d50e5964fd2c7fff54ddf39010b10ee1b49f \ --hash=sha256:f50842b5ea74e9a2e286bc83a9c4ff54a5c7439238843b46998d07838d7f4cd0 \ --hash=sha256:fa4df41b5a9622661402766015588663176f6c4b8abf403b739eec3f058fac2b -schema==0.7.5 ; python_version >= "3.9" and python_version < "3.11" \ +schema==0.7.5 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:f06717112c61895cabc4707752b88716e8420a8819d71404501e114f91043197 \ --hash=sha256:f3ffdeeada09ec34bf40d7d79996d9f7175db93b7a5065de0faa7f41083c1e6c -setuptools==68.2.2 ; python_version >= "3.9" and python_version < "3.11" \ +setuptools==68.2.2 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \ --hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a -six==1.16.0 ; python_version >= "3.9" and python_version < "3.11" \ +six==1.16.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 -smmap==5.0.1 ; python_version >= "3.9" and python_version < "3.11" \ +smmap==5.0.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62 \ --hash=sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da -sniffio==1.3.0 ; python_version >= "3.9" and python_version < "3.11" \ +sniffio==1.3.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101 \ --hash=sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384 -stevedore==5.1.0 ; python_version >= "3.9" and python_version < "3.11" \ +stevedore==5.1.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8cc040628f3cea5d7128f2e76cf486b2251a4e543c7b938f58d9a377f6694a2d \ --hash=sha256:a54534acf9b89bc7ed264807013b505bf07f74dbe4bcfa37d32bd063870b087c -texttable==1.7.0 ; python_version >= "3.9" and python_version < "3.11" \ +texttable==1.7.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:2d2068fb55115807d3ac77a4ca68fa48803e84ebb0ee2340f858107a36522638 \ --hash=sha256:72227d592c82b3d7f672731ae73e4d1f88cd8e2ef5b075a7a7f01a23a3743917 -tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" \ +tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f -typing-extensions==4.8.0 ; python_version >= "3.9" and python_version < "3.11" \ +typing-extensions==4.8.0 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef -urllib3==2.0.6 ; python_version >= "3.9" and python_version < "3.11" \ +urllib3==2.0.6 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:7a7c7003b000adf9e7ca2a377c9688bbc54ed41b985789ed576570342a375cd2 \ --hash=sha256:b19e1a85d206b56d7df1d5e683df4a7725252a964e3993648dd0fb5a1c157564 -watchdog==2.3.1 ; python_version >= "3.9" and python_version < "3.11" \ +watchdog==2.3.1 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:03f342a9432fe08107defbe8e405a2cb922c5d00c4c6c168c68b633c64ce6190 \ --hash=sha256:0d9878be36d2b9271e3abaa6f4f051b363ff54dbbe7e7df1af3c920e4311ee43 \ --hash=sha256:0e1dd6d449267cc7d6935d7fe27ee0426af6ee16578eed93bacb1be9ff824d2d \ @@ -1144,10 +1144,10 @@ watchdog==2.3.1 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:d9f9ed26ed22a9d331820a8432c3680707ea8b54121ddcc9dc7d9f2ceeb36906 \ --hash=sha256:ea5d86d1bcf4a9d24610aa2f6f25492f441960cf04aed2bd9a97db439b643a7b \ --hash=sha256:efe3252137392a471a2174d721e1037a0e6a5da7beb72a021e662b7000a9903f -websocket-client==1.6.4 ; python_version >= "3.9" and python_version < "3.11" \ +websocket-client==1.6.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:084072e0a7f5f347ef2ac3d8698a5e0b4ffbfcab607628cadabc650fc9a83a24 \ --hash=sha256:b3324019b3c28572086c4a319f91d1dcd44e6e11cd340232978c684a7650d0df -websockets==10.4 ; python_version >= "3.9" and python_version < "3.11" \ +websockets==10.4 ; python_version >= "3.9" and python_version < "3.12" \ --hash=sha256:00213676a2e46b6ebf6045bc11d0f529d9120baa6f58d122b4021ad92adabd41 \ --hash=sha256:00c870522cdb69cd625b93f002961ffb0c095394f06ba8c48f17eef7c1541f96 \ --hash=sha256:0154f7691e4fe6c2b2bc275b5701e8b158dae92a1ab229e2b940efe11905dff4 \ @@ -1217,6 +1217,6 @@ websockets==10.4 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:f5fc088b7a32f244c519a048c170f14cf2251b849ef0e20cbbb0fdf0fdaf556f \ --hash=sha256:fe10ddc59b304cb19a1bdf5bd0a7719cbbc9fbdd57ac80ed436b709fcf889106 \ --hash=sha256:ff64a1d38d156d429404aaa84b27305e957fd10c30e5880d1765c9480bea490f -win32-setctime==1.1.0 ; python_version >= "3.9" and python_version < "3.11" and sys_platform == "win32" \ +win32-setctime==1.1.0 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" \ --hash=sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2 \ --hash=sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad From 5b8981707d5691e911a22f818460a20c35c0c0f7 Mon Sep 17 00:00:00 2001 From: rudu <40572253+anon1892@users.noreply.github.com> Date: Sat, 13 Jan 2024 09:38:15 +0100 Subject: [PATCH 2/8] Use gettext almost everywhere --- openandroidinstaller/app_state.py | 9 +-- openandroidinstaller/openandroidinstaller.py | 16 +++-- openandroidinstaller/translations.py | 26 +++++++ openandroidinstaller/views/addon_view.py | 35 ++++----- .../views/install_addons_view.py | 18 ++--- openandroidinstaller/views/install_view.py | 21 +++--- .../views/requirements_view.py | 43 +++++------ openandroidinstaller/views/select_view.py | 71 ++++++++++--------- openandroidinstaller/views/start_view.py | 43 +++++------ openandroidinstaller/views/step_view.py | 15 ++-- openandroidinstaller/views/success_view.py | 5 +- openandroidinstaller/views/welcome_view.py | 18 ++--- 12 files changed, 180 insertions(+), 140 deletions(-) create mode 100644 openandroidinstaller/translations.py diff --git a/openandroidinstaller/app_state.py b/openandroidinstaller/app_state.py index 22d2722f..aad4973b 100644 --- a/openandroidinstaller/app_state.py +++ b/openandroidinstaller/app_state.py @@ -19,6 +19,7 @@ from loguru import logger from installer_config import _load_config, Step +from translations import _ class AppState: @@ -94,9 +95,9 @@ def toggle_flash_unlock_bootloader(self): else: self.steps = [ Step( - title="Boot custom recovery", + title=_("Boot custom recovery"), type="confirm_button", - content="If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue.", + content=_("If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue."), command="adb_reboot_recovery", img="twrp-start.jpeg", ) @@ -116,9 +117,9 @@ def toggle_flash_recovery(self): logger.info("Skipping flashing recovery.") self.steps = [ Step( - title="Boot custom recovery", + title=_("Boot custom recovery"), type="call_button", - content="If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue.", + content=_("If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue."), command="adb_reboot_recovery", img="twrp-start.jpeg", ) diff --git a/openandroidinstaller/openandroidinstaller.py b/openandroidinstaller/openandroidinstaller.py index ae783429..f44d6061 100644 --- a/openandroidinstaller/openandroidinstaller.py +++ b/openandroidinstaller/openandroidinstaller.py @@ -54,6 +54,8 @@ InstallAddonsView, ) from tooling import run_command +from translations import _ + # VERSION number VERSION = "0.5.1-beta" @@ -249,29 +251,29 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"): ), ), padding=15, - tooltip="Frequently asked questions and encountered issues.", + tooltip=_("Frequently asked questions and encountered issues."), ), Container( content=ElevatedButton( icon=icons.FEEDBACK_OUTLINED, - text="Give feedback", + text=_("Give feedback"), on_click=lambda _: webbrowser.open( "https://openandroidinstaller.org/feedback.html" ), ), padding=15, - tooltip="Give feedback about your experience with OpenAndroidInstaller", + tooltip=_("Give feedback about your experience with OpenAndroidInstaller"), ), Container( content=ElevatedButton( icon=icons.BUG_REPORT_OUTLINED, - text="Report a bug", + text=_("Report a bug"), on_click=lambda _: webbrowser.open( "https://github.com/openandroidinstaller-dev/openandroidinstaller/issues" ), ), padding=15, - tooltip="Report an issue on github", + tooltip=_("Report an issue on github"), ), ], ) @@ -285,10 +287,10 @@ def close_banner(e): bgcolor=colors.AMBER_100, leading=Icon(icons.WARNING_AMBER_ROUNDED, color=colors.AMBER, size=40), content=Text( - "These instructions only work if you follow every section and step precisely. Do not continue after something fails!" + _("These instructions only work if you follow every section and step precisely. Do not continue after something fails!") ), actions=[ - TextButton("I understand", on_click=close_banner), + TextButton(_("I understand"), on_click=close_banner), ], ) page.banner.open = True diff --git a/openandroidinstaller/translations.py b/openandroidinstaller/translations.py new file mode 100644 index 00000000..84f6b070 --- /dev/null +++ b/openandroidinstaller/translations.py @@ -0,0 +1,26 @@ +"""File to import to manage translations.""" + +# This file is part of OpenAndroidInstaller. +# OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of +# the GNU General Public License as published by the Free Software Foundation, +# either version 3 of the License, or (at your option) any later version. + +# OpenAndroidInstaller is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along with OpenAndroidInstaller. +# If not, see .""" +# Author: Tobias Sterbak + +import os +import gettext + + +# Initialize localization +# TODO : Automaticaly check user locale and if available, use it. +fr = gettext.translation('base', localedir='../locales', languages=['fr']) +fr.install() +_ = fr.gettext # French +#os.environ['LANGUAGE']='fr' +#_ = gettext.gettext diff --git a/openandroidinstaller/views/addon_view.py b/openandroidinstaller/views/addon_view.py index 5999e5b9..4240a173 100644 --- a/openandroidinstaller/views/addon_view.py +++ b/openandroidinstaller/views/addon_view.py @@ -40,6 +40,7 @@ from views import BaseView from app_state import AppState from widgets import get_title, confirm_button +from translations import _ class AddonsView(BaseView): @@ -55,8 +56,8 @@ def build(self): # dialog box to explain OS images and recovery self.dlg_explain_addons = AlertDialog( modal=True, - title=Text("What kind of addons are supported?"), - content=Markdown( + title=Text(_("What kind of addons are supported?")), + content=Markdown(_( """## Google Apps: There are different packages of Google Apps available. Most notable - [MindTheGapps](https://wiki.lineageos.org/gapps#downloads) and @@ -79,10 +80,10 @@ def build(self): F-Droid is an installable catalogue of libre software apps for Android. The F-Droid client app makes it easy to browse, install, and keep track of updates on your device. You can get the zip file to install this addon here: [https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota](https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota). -""", +"""), ), actions=[ - TextButton("Close", on_click=self.close_close_explain_addons_dlg), + TextButton(_("Close"), on_click=self.close_close_explain_addons_dlg), ], actions_alignment="end", shape=CountinuosRectangleBorder(radius=0), @@ -90,7 +91,7 @@ def build(self): # initialize file pickers self.pick_addons_dialog = FilePicker(on_result=self.pick_addons_result) - self.selected_addons = Text("Selected addons: ") + self.selected_addons = Text(_("Selected addons: ")) # initialize and manage button state. # wrap the call to the next step in a call to boot fastboot @@ -104,18 +105,18 @@ def build(self): # create help/info button to show the help dialog info_button = OutlinedButton( - "What kind of addons?", + _("What kind of addons?"), on_click=self.open_explain_addons_dlg, expand=True, icon=icons.HELP_OUTLINE_OUTLINED, icon_color=colors.DEEP_ORANGE_500, - tooltip="Get more details on what addons are supported.", + tooltip=_("Get more details on what addons are supported."), ) # add title self.right_view_header.controls.append( get_title( - "You can select additional addons to install.", + _("You can select additional addons to install."), info_button=info_button, step_indicator_img="steps-header-select.png", ) @@ -128,11 +129,11 @@ def build(self): self.right_view.controls.append( Column( [ - Text("Here you can download the F-Droid App-Store:"), + Text(_("Here you can download the F-Droid App-Store:")), Row( [ ElevatedButton( - "Download F-Droid App-Store", + _("Download F-Droid App-Store"), icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( "https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota/" @@ -142,12 +143,12 @@ def build(self): ] ), Text( - "Here you can find instructions on how to download the right Google apps for your device." + _("Here you can find instructions on how to download the right Google apps for your device.") ), Row( [ ElevatedButton( - "Download Google Apps", + _("Download Google Apps"), icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( "https://wiki.lineageos.org/gapps#downloads" @@ -156,11 +157,11 @@ def build(self): ), ] ), - Text("Here you can download MicroG:"), + Text(_("Here you can download MicroG:")), Row( [ ElevatedButton( - "Download MicroG", + _("Download MicroG"), icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( "https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/releases" @@ -176,7 +177,7 @@ def build(self): # attach the controls for uploading addons self.right_view.controls.extend( [ - Text("Select addons:", style="titleSmall"), + Text(_("Select addons:"), style="titleSmall"), # Markdown( # f""" # The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.metadata.get('devicecode')}-signed.zip`.""" @@ -184,7 +185,7 @@ def build(self): Row( [ FilledButton( - "Pick the addons you want to install", + _("Pick the addons you want to install"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_addons_dialog.pick_files( allow_multiple=True, @@ -225,7 +226,7 @@ def pick_addons_result(self, e: FilePickerResultEvent): self.state.addon_paths = self.addon_paths logger.info(f"Selected addons: {self.addon_paths}") else: - logger.info("No addons selected.") + logger.info(_("No addons selected.")) # check if the addons works with the device and show the filename in different colors accordingly # update self.selected_addons.update() diff --git a/openandroidinstaller/views/install_addons_view.py b/openandroidinstaller/views/install_addons_view.py index bdc54840..0dd6ed25 100644 --- a/openandroidinstaller/views/install_addons_view.py +++ b/openandroidinstaller/views/install_addons_view.py @@ -41,6 +41,8 @@ TerminalBox, ProgressIndicator, ) +from translations import _ + class InstallAddonsView(BaseView): @@ -73,7 +75,7 @@ def check_advanced_switch(e): self.right_view.update() self.advanced_switch = Switch( - label="Advanced output", + label=_("Advanced output"), on_change=check_advanced_switch, disabled=False, ) @@ -87,18 +89,18 @@ def check_advanced_switch(e): # main controls self.right_view_header.controls = [ get_title( - "Install Addons", + _("Install Addons"), step_indicator_img="steps-header-install.png", ) ] self.right_view.controls = [ Markdown( - """In the next steps, you flash the selected Addons. + _("""In the next steps, you flash the selected Addons. Confirm to install. This might take a while. At the end your phone will boot into the new OS. -""" +""") ) ] # basic view @@ -107,7 +109,7 @@ def check_advanced_switch(e): self.confirm_button.disabled = True # button to run the installation process self.install_button = ElevatedButton( - "Confirm and install addons", + _("Confirm and install addons"), on_click=self.run_install_addons, expand=True, icon=icons.DIRECTIONS_RUN_OUTLINED, @@ -133,9 +135,9 @@ def check_advanced_switch(e): self.right_view.controls.append( Row( [ - Text("Do you want to skip?"), + Text(_("Do you want to skip?")), ElevatedButton( - "Skip", + _("Skip"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, expand=True, @@ -200,7 +202,7 @@ def run_install_addons(self, e): # enable call button to retry self.install_button.disabled = False # also remove the last error text if it happened - self.error_text.value = "Installation failed! Try again or make sure everything is setup correctly." + self.error_text.value = _("Installation failed! Try again or make sure everything is setup correctly.") else: sleep(4) # wait to make sure everything is fine self.progress_indicator.set_progress_bar(100) diff --git a/openandroidinstaller/views/install_view.py b/openandroidinstaller/views/install_view.py index 6e8c7b4d..82eb6330 100644 --- a/openandroidinstaller/views/install_view.py +++ b/openandroidinstaller/views/install_view.py @@ -40,6 +40,7 @@ TerminalBox, ProgressIndicator, ) +from translations import _ class InstallView(BaseView): @@ -70,7 +71,7 @@ def check_advanced_switch(e): self.right_view.update() self.advanced_switch = Switch( - label="Advanced output", + label=_("Advanced output"), on_change=check_advanced_switch, disabled=False, ) @@ -88,7 +89,7 @@ def check_addons_switch(e): self.state.install_addons = False self.install_addons_switch = Switch( - label="Install addons", + label=_("Install addons"), on_change=check_addons_switch, disabled=False, ) @@ -101,13 +102,13 @@ def check_addons_switch(e): # main controls self.right_view_header.controls = [ get_title( - "Install OS", + _("Install OS"), step_indicator_img="steps-header-install.png", ) ] self.right_view.controls = [ Markdown( - """In the next steps, you finally flash the selected OS image. + _("""In the next steps, you finally flash the selected OS image. Connect your device with your computer with the USB-Cable. This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored in the internal storage. @@ -122,7 +123,7 @@ def check_addons_switch(e): #### **Warning:** Don't try to add addons like Google Apps if your OS ROM already has Google Apps or microG included! Otherwise your system will break! -""" +""") ) ] # basic view @@ -131,7 +132,7 @@ def check_addons_switch(e): self.confirm_button.disabled = True # button to run the installation process self.install_button = ElevatedButton( - "Confirm and install", + _("Confirm and install"), on_click=self.run_install, expand=True, icon=icons.DIRECTIONS_RUN_OUTLINED, @@ -157,9 +158,9 @@ def check_addons_switch(e): self.right_view.controls.append( Row( [ - Text("Do you want to skip?"), + Text(_("Do you want to skip?")), ElevatedButton( - "Skip", + _("Skip"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, expand=True, @@ -178,7 +179,7 @@ def run_install(self, e): # disable the call button while the command is running self.install_button.disabled = True self.install_addons_switch.disabled = True - self.error_text.value = "Please be patient, it may take a few minutes." + self.error_text.value = _("Please be patient, it may take a few minutes.") self.error_text.color = colors.GREEN # reset the progress indicators self.progress_indicator.clear() @@ -208,7 +209,7 @@ def run_install(self, e): # enable call button to retry self.install_button.disabled = False # also remove the last error text if it happened - self.error_text.value = "Installation failed! Try again or make sure everything is setup correctly." + self.error_text.value = _("Installation failed! Try again or make sure everything is setup correctly.") self.error_text.color = colors.RED else: sleep(5) # wait to make sure everything is fine diff --git a/openandroidinstaller/views/requirements_view.py b/openandroidinstaller/views/requirements_view.py index 05f7f2e8..ec34f5c6 100644 --- a/openandroidinstaller/views/requirements_view.py +++ b/openandroidinstaller/views/requirements_view.py @@ -38,6 +38,7 @@ from views import BaseView from app_state import AppState from widgets import get_title +from translations import _ class RequirementsView(BaseView): @@ -64,7 +65,7 @@ def init_visuals( self.checkbox_cards = [] # continue button self.continue_button = ElevatedButton( - "Continue", + _("Continue"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, disabled=True, @@ -72,7 +73,7 @@ def init_visuals( ) # back button self.back_button = ElevatedButton( - "Back", + _("Back"), on_click=self.on_back, icon=icons.ARROW_BACK, expand=True, @@ -81,9 +82,9 @@ def init_visuals( # dialog to explain howto find the android and firmware version self.dlg_howto_find_versions = AlertDialog( modal=True, - title=Text("Where to find the current Android and/or firmware version?"), + title=Text(_("Where to find the current Android and/or firmware version?")), content=Markdown( - """ + _(""" ## Find your current Android Version Scroll down on the Settings screen and look for an "About phone", "About tablet", or "System" option. You'll usually find this at the very bottom of the main Settings screen, under System, but depending @@ -94,10 +95,10 @@ def init_visuals( ## Find your current device firmware version On the same screen you find the "Android version" you can also find the Firmware Version. -On some devices, the build version is basically the firmware version.""", +On some devices, the build version is basically the firmware version."""), ), actions=[ - TextButton("Close", on_click=self.close_find_version_dlg), + TextButton(_("Close"), on_click=self.close_find_version_dlg), ], actions_alignment="end", shape=CountinuosRectangleBorder(radius=0), @@ -108,25 +109,25 @@ def build(self): # create help/info button to show the help dialog info_button = OutlinedButton( - "How to Find the version", + _("How to Find the version"), on_click=self.open_find_version_dlg, expand=False, icon=icons.HELP_OUTLINE_OUTLINED, icon_color=colors.DEEP_ORANGE_500, - tooltip="How to find the firmware and android version of your device.", + tooltip=_("How to find the firmware and android version of your device."), ) # build up the main view self.right_view_header.controls = [ get_title( - "Check the Requirements", + _("Check the Requirements"), step_indicator_img="steps-header-requirements.png", ), ] self.right_view.controls.extend( [ Text( - "Before continuing you need to check some requirements to progress. Please read the instructions and check the boxes if everything is fine." + _("Before continuing you need to check some requirements to progress. Please read the instructions and check the boxes if everything is fine.") ), Divider(), ] @@ -139,7 +140,7 @@ def build(self): required_android_version = self.state.config.requirements.get("android") if required_android_version: android_checkbox = Checkbox( - label="The required android version is installed. (Or I know the risk of continuing)", + label=_("The required android version is installed. (Or I know the risk of continuing)"), on_change=self.enable_continue_button, ) android_version_check = Card( @@ -178,7 +179,7 @@ def build(self): ) if required_firmware_version: firmware_checkbox = Checkbox( - label="The required firmware version is installed. (Or I know the risk of continuing)", + label=_("The required firmware version is installed. (Or I know the risk of continuing)"), on_change=self.enable_continue_button, ) firmware_version_check = Card( @@ -234,7 +235,7 @@ def build(self): def get_battery_check(self): """Get checkbox and card for default requirements: battery level.""" battery_checkbox = Checkbox( - label="The battery level is over 80%.", + label=_("The battery level is over 80%."), on_change=self.enable_continue_button, ) battery_check_card = Card( @@ -242,10 +243,10 @@ def get_battery_check(self): content=Column( [ Markdown( - """ + _(""" #### Battery level over 80% Before continuing make sure your device battery level is above 80%. - """ + """) ), battery_checkbox, ] @@ -258,7 +259,7 @@ def get_battery_check(self): def get_boot_stock_check(self): """Get checkbox and card for default requirements: boot stock once.""" boot_stock_checkbox = Checkbox( - label="Booted the stock OS at least once.", + label=_("Booted the stock OS at least once."), on_change=self.enable_continue_button, ) boot_stock_check_card = Card( @@ -266,11 +267,11 @@ def get_boot_stock_check(self): content=Column( [ Markdown( - """ + _(""" #### Boot your device with the stock OS at least once and check every functionality. Make sure that you can send and receive SMS and place and receive calls (also via WiFi and LTE, if available), otherwise it won\'t work on your custom ROM either! Additionally, some devices require that VoLTE/VoWiFi be utilized once on stock to provision IMS. - """ + """) ), boot_stock_checkbox, ] @@ -283,7 +284,7 @@ def get_boot_stock_check(self): def get_lock_check(self): """Get the checkbox and card for the default requirement: disable lock code and fingerprint.""" lock_checkbox = Checkbox( - label="No lock code or fingerprint lock enabled.", + label=_("No lock code or fingerprint lock enabled."), on_change=self.enable_continue_button, ) lock_check_card = Card( @@ -291,9 +292,9 @@ def get_lock_check(self): content=Column( [ Markdown( - """ + _(""" #### Disable all device lock codes and fingerprint locks. - """ + """) ), lock_checkbox, ] diff --git a/openandroidinstaller/views/select_view.py b/openandroidinstaller/views/select_view.py index d5937870..82f3dfef 100644 --- a/openandroidinstaller/views/select_view.py +++ b/openandroidinstaller/views/select_view.py @@ -47,6 +47,7 @@ recovery_works_with_device, image_sdk_level, ) +from translations import _ class SelectFilesView(BaseView): @@ -69,9 +70,9 @@ def init_visuals( # dialog box to explain OS images and recovery self.dlg_explain_images = AlertDialog( modal=True, - title=Text("What is an OS image and recovery and why do I need it?"), + title=Text(_("What is an OS image and recovery and why do I need it?")), content=Markdown( - """## OS image or ROM + _("""## OS image or ROM An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Popular, custom operating systems for mobile devices based on Android are @@ -89,10 +90,10 @@ def init_visuals( This custom software can include smaller modifications like rooting your device or even replacing the firmware of the device with a completely custom ROM. -OpenAndroidInstaller works with the [TWRP recovery project](https://twrp.me/about).""", +OpenAndroidInstaller works with the [TWRP recovery project](https://twrp.me/about)."""), ), actions=[ - TextButton("Close", on_click=self.close_close_explain_images_dlg), + TextButton(_("Close"), on_click=self.close_close_explain_images_dlg), ], actions_alignment="end", shape=CountinuosRectangleBorder(radius=0), @@ -110,8 +111,8 @@ def init_visuals( on_result=self.pick_vendor_boot_result ) - self.selected_image = Text("Selected image: ") - self.selected_recovery = Text("Selected recovery: ") + self.selected_image = Text(_("Selected image: ")) + self.selected_recovery = Text(_("Selected recovery: ")) self.selected_dtbo = Checkbox( fill_color=colors.RED, value=None, disabled=True, tristate=True ) @@ -129,7 +130,7 @@ def init_visuals( self.confirm_button = confirm_button(self.on_confirm) self.confirm_button.disabled = True self.continue_eitherway_button = confirm_button( - self.on_confirm, "Continue without additional images" + self.on_confirm, _("Continue without additional images") ) self.continue_eitherway_button.disabled = True self.pick_recovery_dialog.on_result = self.enable_button_if_ready @@ -140,7 +141,7 @@ def init_visuals( self.pick_vendor_boot_dialog.on_result = self.enable_button_if_ready # back button self.back_button = ElevatedButton( - "Back", + _("Back"), on_click=self.on_back, icon=icons.ARROW_BACK, expand=True, @@ -168,18 +169,18 @@ def build(self): # create help/info button to show the help dialog for the image and recovery selection explain_images_button = OutlinedButton( - "What is this?", + _("What is this?"), on_click=self.open_explain_images_dlg, expand=True, icon=icons.HELP_OUTLINE_OUTLINED, icon_color=colors.DEEP_ORANGE_500, - tooltip="Get more details on custom operating system images and recoveries.", + tooltip=_("Get more details on custom operating system images and recoveries."), ) # add title self.right_view_header.controls.append( get_title( - "Now pick an OS image and a recovery file:", + _("Now pick an OS image and a recovery file:"), info_button=explain_images_button, step_indicator_img="steps-header-select.png", ) @@ -196,7 +197,7 @@ def build(self): self.right_view.controls.extend( [ Text( - "Important notes for your device", + _("Important notes for your device"), style="titleSmall", color=colors.RED, weight="bold", @@ -213,12 +214,12 @@ def build(self): Column( [ Text( - "You can bring your own image and recovery or you download the officially supported image file for your device here:" + _("You can bring your own image and recovery or you download the officially supported image file for your device here:") ), Row( [ ElevatedButton( - "Download LineageOS image", + _("Download LineageOS image"), icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( self.download_link @@ -226,7 +227,7 @@ def build(self): expand=True, ), ElevatedButton( - "Download TWRP recovery", + _("Download TWRP recovery"), icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( twrp_download_link @@ -242,7 +243,7 @@ def build(self): # attach the controls for uploading image and recovery self.right_view.controls.extend( [ - Text("Select an OS image:", style="titleSmall"), + Text(_("Select an OS image:"), style="titleSmall"), Markdown( f""" The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.device_code}-signed.zip`.""" @@ -250,7 +251,7 @@ def build(self): Row( [ FilledButton( - "Pick OS image", + _("Pick OS image"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_image_dialog.pick_files( allow_multiple=False, @@ -268,7 +269,7 @@ def build(self): if self.state.flash_recovery: self.right_view.controls.extend( [ - Text("Select a TWRP recovery image:", style="titleSmall"), + Text(_("Select a TWRP recovery image:"), style="titleSmall"), Markdown( f""" The recovery image should look something like `twrp-3.7.0_12-0-{self.state.config.device_code}.img`. @@ -279,7 +280,7 @@ def build(self): Row( [ FilledButton( - "Pick TWRP recovery file", + _("Pick TWRP recovery file"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_recovery_dialog.pick_files( allow_multiple=False, @@ -324,13 +325,13 @@ def get_notes(self) -> str: brand = self.state.config.metadata.get("brand", "") if brand in ["xiaomi", "poco"]: notes.append( - "- If something goes wrong, you can reinstall MiUI here:\n\n" + _("- If something goes wrong, you can reinstall MiUI here:\n\n") ) # this should be used as little as possible! if self.state.config.metadata.get("untested", False): notes.append( - "- **This device has not been tested with OpenAndroidInstaller yet.** The installation can go wrong. You may have to finish the installation process with command line. If you test, please report the result on GitHub." + _("- **This device has not been tested with OpenAndroidInstaller yet.** The installation can go wrong. You may have to finish the installation process with command line. If you test, please report the result on GitHub.") ) notes.extend( @@ -343,7 +344,7 @@ def toggle_additional_image_selection(self): # dialogue box to explain additional required images self.dlg_explain_additional_images = AlertDialog( modal=True, - title=Text("Why do I need additional images and where do I get them?"), + title=Text(_("Why do I need additional images and where do I get them?")), content=Markdown( f"""## About additional images Some devices require additional images to be flashed before the recovery and OS image can be flashed. @@ -371,7 +372,7 @@ def toggle_additional_image_selection(self): ), actions=[ TextButton( - "Close", on_click=self.close_close_explain_additional_images_dlg + _("Close"), on_click=self.close_close_explain_additional_images_dlg ), ], actions_alignment="end", @@ -380,12 +381,12 @@ def toggle_additional_image_selection(self): # create help/info button to show the help dialog for the image and recovery selection explain_additional_images_button = OutlinedButton( - "Why do I need this and where do I get it?", + _("Why do I need this and where do I get it?"), on_click=self.open_explain_additional_images_dlg, expand=True, icon=icons.HELP_OUTLINE_OUTLINED, icon_color=colors.DEEP_ORANGE_500, - tooltip="Get more details on additional images and download links.", + tooltip=_("Get more details on additional images and download links."), ) # attach the controls for uploading others partitions, like dtbo, vbmeta & super_empty @@ -396,16 +397,16 @@ def toggle_additional_image_selection(self): Row( [ Text( - "Select required additional images:", style="titleSmall" + _("Select required additional images:"), style="titleSmall" ), explain_additional_images_button, ] ), Markdown( - """ + _(""" Your selected device and ROM requires flashing of additional partitions. Please select the required images below. -Make sure the file is for **your exact phone model!**""", +Make sure the file is for **your exact phone model!**"""), ), ] ) @@ -416,7 +417,7 @@ def toggle_additional_image_selection(self): Row( [ FilledButton( - "Pick `dtbo.img` image", + _("Pick `dtbo.img` image"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_dtbo_dialog.pick_files( allow_multiple=False, @@ -437,7 +438,7 @@ def toggle_additional_image_selection(self): Row( [ FilledButton( - "Pick `vbmeta.img` image", + _("Pick `vbmeta.img` image"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_vbmeta_dialog.pick_files( allow_multiple=False, @@ -458,7 +459,7 @@ def toggle_additional_image_selection(self): Row( [ FilledButton( - "Pick `super_empty.img` image", + _("Pick `super_empty.img` image"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_super_empty_dialog.pick_files( allow_multiple=False, @@ -479,7 +480,7 @@ def toggle_additional_image_selection(self): Row( [ FilledButton( - "Pick `vendor_boot.img` image", + _("Pick `vendor_boot.img` image"), icon=icons.UPLOAD_FILE, on_click=lambda _: self.pick_vendor_boot_dialog.pick_files( allow_multiple=False, @@ -670,7 +671,7 @@ def enable_button_if_ready(self, e): ) self.info_field.controls = [ Text( - "Image and/or recovery don't work with the device. Make sure you use a TWRP-based recovery.", + _("Image and/or recovery don't work with the device. Make sure you use a TWRP-based recovery."), color=colors.RED, weight="bold", ) @@ -700,7 +701,7 @@ def enable_button_if_ready(self, e): ) self.info_field.controls = [ Text( - "Some additional images don't match or are missing. Please select the right ones.", + _("Some additional images don't match or are missing. Please select the right ones."), color=colors.RED, weight="bold", ) @@ -727,7 +728,7 @@ def enable_button_if_ready(self, e): ) self.info_field.controls = [ Text( - "Image doesn't work with the device.", + _("Image doesn't work with the device."), color=colors.RED, weight="bold", ) diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index f7333429..0d596e7b 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -40,6 +40,7 @@ from app_state import AppState from widgets import get_title from tooling import search_device +from translations import _ class StartView(BaseView): @@ -60,14 +61,14 @@ def init_visuals( ): """Initialize the stateful visual elements of the view.""" self.continue_button = ElevatedButton( - "Continue", + _("Continue"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, disabled=True, expand=True, ) self.back_button = ElevatedButton( - "Back", + _("Back"), on_click=self.on_back, icon=icons.ARROW_BACK, expand=True, @@ -76,9 +77,9 @@ def init_visuals( # dialog box to help with developer options self.dlg_help_developer_options = AlertDialog( modal=True, - title=Text("How to enable developer options and OEM unlocking"), + title=Text(_("How to enable developer options and OEM unlocking")), content=Markdown( - """ + _(""" To do this, - **tap seven times on the build number** in the 'System'- or 'About the phone'-Menu in Settings. You can also use the phones own search to look for `build number`. - Then go back to the main menu and look for **'developer options'**. You can also search for it in your phone. @@ -86,7 +87,7 @@ def init_visuals( - If your phone is already connected to your PC, a pop-up might appear. **Allow USB debugging in the pop-up on your phone.** Now you are ready to continue. -""" +""") ), actions=[ TextButton("Close", on_click=self.close_developer_options_dlg), @@ -101,7 +102,7 @@ def check_bootloader_unlocked(e): self.state.toggle_flash_unlock_bootloader() self.bootloader_switch = Switch( - label="Bootloader is already unlocked.", + label=_("Bootloader is already unlocked."), on_change=check_bootloader_unlocked, disabled=True, inactive_thumb_color=colors.YELLOW, @@ -114,7 +115,7 @@ def check_recovery_already_flashed(e): self.state.toggle_flash_recovery() self.recovery_switch = Switch( - label="Custom recovery is already flashed.", + label=_("Custom recovery is already flashed."), on_change=check_recovery_already_flashed, disabled=True, inactive_thumb_color=colors.YELLOW, @@ -124,7 +125,7 @@ def check_recovery_already_flashed(e): # inform the user about the device detection self.device_name = Text("", weight="bold") self.device_detection_infobox = Row( - [Text("Detected device:"), self.device_name] + [Text(_("Detected device:")), self.device_name] ) self.device_request_row = Row([], alignment="center") self.device_infobox = Column( @@ -141,7 +142,7 @@ def build(self): self.right_view_header.controls.extend( [ get_title( - "Get the phone ready", + _("Get the phone ready"), step_indicator_img="steps-header-get-ready.png", ) ] @@ -149,27 +150,27 @@ def build(self): self.right_view.controls.extend( [ Markdown( - """ + _(""" To get started you need to - **enable developer options** on your device - and then **enable USB debugging** and **OEM unlocking** in the developer options. - """ + """) ), Row( [ OutlinedButton( - "How do I enable developer options?", + _("How do I enable developer options?"), on_click=self.open_developer_options_dlg, expand=True, icon=icons.HELP_OUTLINE_OUTLINED, icon_color=colors.DEEP_ORANGE_500, - tooltip="Get help to enable developer options and OEM unlocking.", + tooltip=_("Get help to enable developer options and OEM unlocking."), ) ] ), Divider(), Markdown( - """ + _(""" Now - **connect your device to this computer via USB** and - **allow USB debugging in the pop-up on your phone**. @@ -177,25 +178,25 @@ def build(self): - Then **press the button 'Search device'**. When everything works correctly you should see your device name here and you can continue. - """ + """) ), Divider(), Markdown( - """ + _(""" If you **already unlocked the bootloader** of your device or already **flashed a custom recovery**, please toggle the respective switch below, to skip the procedure. If you don't know what this means, you most likely don't need to do anything and you can just continue. - """ + """) ), self.device_infobox, Row( [ self.back_button, FilledButton( - "Search for device", + _("Search for device"), on_click=self.search_devices_clicked, icon=icons.DEVICES_OTHER_OUTLINED, expand=True, - tooltip="Search for a connected device.", + tooltip=_("Search for a connected device."), ), self.continue_button, ], @@ -238,7 +239,7 @@ def search_devices_clicked(self, e): else: logger.info("No device detected! Connect to USB and try again.") self.device_name.value = ( - "No device detected! Connect to USB and try again." + _("No device detected! Connect to USB and try again.") ) self.device_name.color = colors.RED @@ -279,7 +280,7 @@ def search_devices_clicked(self, e): request_url = f"https://github.com/openandroidinstaller-dev/openandroidinstaller/issues/new?labels=device&template=device-support-request.yaml&title=Add support for `{device_code}`" self.device_request_row.controls.append( ElevatedButton( - "Request support for this device", + _("Request support for this device"), icon=icons.PHONELINK_SETUP_OUTLINED, on_click=lambda _: webbrowser.open(request_url), ) diff --git a/openandroidinstaller/views/step_view.py b/openandroidinstaller/views/step_view.py index b64a78c2..65e32be1 100644 --- a/openandroidinstaller/views/step_view.py +++ b/openandroidinstaller/views/step_view.py @@ -65,6 +65,7 @@ TerminalBox, ProgressIndicator, ) +from translations import _ class StepView(BaseView): @@ -80,7 +81,7 @@ def __init__( # text input self.inputtext = TextField( - hint_text="your unlock code", expand=False + hint_text=_("your unlock code"), expand=False ) # textfield for the unlock code def build(self): @@ -102,7 +103,7 @@ def check_advanced_switch(e): self.right_view.update() self.advanced_switch = Switch( - label="Advanced output", + label=_("Advanced output"), on_change=check_advanced_switch, disabled=False, value=self.state.advanced, @@ -115,8 +116,8 @@ def check_advanced_switch(e): # main controls steps_indicator_img_lookup = { - "Unlock the bootloader": "steps-header-unlock.png", - "Boot custom recovery": "steps-header-recovery.png", + _("Unlock the bootloader"): "steps-header-unlock.png", + _("Boot custom recovery"): "steps-header-recovery.png", } self.right_view_header.controls = [ get_title( @@ -171,7 +172,7 @@ def check_advanced_switch(e): ) elif self.step.type == "link_button_with_confirm": self.right_view.controls.extend( - [Row([link_button(self.step.link, "Open Link"), self.confirm_button])] + [Row([link_button(self.step.link, _("Open Link")), self.confirm_button])] ) elif self.step.type != "text": @@ -183,9 +184,9 @@ def check_advanced_switch(e): self.right_view.controls.append( Row( [ - Text("Do you want to skip?"), + Text(_("Do you want to skip?")), ElevatedButton( - "Skip", + _("Skip"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, expand=True, diff --git a/openandroidinstaller/views/success_view.py b/openandroidinstaller/views/success_view.py index e1bd6af8..e4cbccfb 100644 --- a/openandroidinstaller/views/success_view.py +++ b/openandroidinstaller/views/success_view.py @@ -26,6 +26,7 @@ from views import BaseView from app_state import AppState from widgets import get_title +from translations import _ class SuccessView(BaseView): @@ -42,13 +43,13 @@ def close_window(e): # right view header self.right_view_header.controls = [ - get_title("Installation completed successfully!"), + get_title(_("Installation completed successfully!")), ] # right view main part contribute_link = "https://openandroidinstaller.org/#contribute" self.right_view.controls = [ Text( - "Now your devices boots into the new OS. Have fun with it!", + _("Now your devices boots into the new OS. Have fun with it!"), style="titleSmall", ), Markdown( diff --git a/openandroidinstaller/views/welcome_view.py b/openandroidinstaller/views/welcome_view.py index a3560ea7..4a2fec38 100644 --- a/openandroidinstaller/views/welcome_view.py +++ b/openandroidinstaller/views/welcome_view.py @@ -30,6 +30,8 @@ from views import BaseView from app_state import AppState from widgets import get_title +from translations import _ + class WelcomeView(BaseView): @@ -48,7 +50,7 @@ def init_visuals( ): """Initialize the stateful visual elements of the view.""" self.continue_button = ElevatedButton( - "Let's start!", + _("Let's start!"), on_click=self.on_confirm, icon=icons.NEXT_PLAN_OUTLINED, disabled=False, @@ -60,36 +62,36 @@ def build(self): # build up the main view self.right_view_header.controls.extend( - [get_title("Welcome to the OpenAndroidInstaller!")] + [get_title(_("Welcome to the OpenAndroidInstaller!"))] ) self.right_view.controls.extend( [ Text( - "Great that you want to install alternative, open source Android operating systems!" + _("Great that you want to install alternative, open source Android operating systems!") ), Text( - "We will walk you through the installation process nice and easy." + _("We will walk you through the installation process nice and easy.") ), Markdown( - """ + _(""" The following steps are performed in this tool: - First, we help you to **get your device ready** for the installation process. - Next, you can **select the operating system** you want to install (with guidance). - Then, we guide you though the process of **unlocking the bootloader** (if necessary). If you don't know what that means, it will be explained later. - As a next step, the **operation system is installed**. At this point you can also **select to install additional software** ("addons") like Google Apps. - Finally your device starts your new operating system. - """ + """) ), Divider(), Markdown( - """ + _(""" Before you continue, make sure - your devices is on the latest system update. - you have a backup of all your important data, since this procedure will **erase all data from the phone**. - to not store the backup on the phone! Please note, that vendor specific back-ups will most likely not work on LineageOS! - """ + """) ), Divider(), Row( From d45010892d8435960e566295adf966ccd724bdf7 Mon Sep 17 00:00:00 2001 From: rudu <40572253+anon1892@users.noreply.github.com> Date: Sat, 13 Jan 2024 13:13:27 +0100 Subject: [PATCH 3/8] Use gettext everywhere? (except config files) --- openandroidinstaller/openandroidinstaller.py | 2 +- openandroidinstaller/translations.py | 2 +- .../views/install_addons_view.py | 2 +- openandroidinstaller/views/requirements_view.py | 12 ++++++------ openandroidinstaller/views/select_view.py | 16 ++++++++-------- openandroidinstaller/views/start_view.py | 2 +- openandroidinstaller/views/step_view.py | 2 +- openandroidinstaller/views/success_view.py | 4 ++-- openandroidinstaller/widgets.py | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/openandroidinstaller/openandroidinstaller.py b/openandroidinstaller/openandroidinstaller.py index f44d6061..022c0517 100644 --- a/openandroidinstaller/openandroidinstaller.py +++ b/openandroidinstaller/openandroidinstaller.py @@ -237,7 +237,7 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"): toolbar_height=72, elevation=0, title=Text( - f"OpenAndroidInstaller version {VERSION}" + _("OpenAndroidInstaller version {version}").format(version=VERSION) ), # , style="displaySmall"), center_title=False, bgcolor="#00d886", diff --git a/openandroidinstaller/translations.py b/openandroidinstaller/translations.py index 84f6b070..7afdfc68 100644 --- a/openandroidinstaller/translations.py +++ b/openandroidinstaller/translations.py @@ -19,7 +19,7 @@ # Initialize localization # TODO : Automaticaly check user locale and if available, use it. -fr = gettext.translation('base', localedir='../locales', languages=['fr']) +fr = gettext.translation('base', localedir='locales', languages=['fr']) fr.install() _ = fr.gettext # French #os.environ['LANGUAGE']='fr' diff --git a/openandroidinstaller/views/install_addons_view.py b/openandroidinstaller/views/install_addons_view.py index 0dd6ed25..9e75f22a 100644 --- a/openandroidinstaller/views/install_addons_view.py +++ b/openandroidinstaller/views/install_addons_view.py @@ -167,7 +167,7 @@ def run_install_addons(self, e): # reset the progress indicators self.progress_indicator.clear() # inform about the currently installed addon - self.addon_info_text.value = f"{addon_num + 1}/{len(self.state.addon_paths)}: Installing {Path(addon_path).name} ..." + self.addon_info_text.value = f"{addon_num + 1}/{len(self.state.addon_paths)}: " + _("Installing") + f"{Path(addon_path).name} ..." self.right_view.update() # install one addon at the time diff --git a/openandroidinstaller/views/requirements_view.py b/openandroidinstaller/views/requirements_view.py index ec34f5c6..7b77fd50 100644 --- a/openandroidinstaller/views/requirements_view.py +++ b/openandroidinstaller/views/requirements_view.py @@ -150,7 +150,7 @@ def build(self): Row( [ Text( - f"Android Version {required_android_version}:", + _("Android Version {required_android_version}:").format(required_android_version=required_android_version), style="titleSmall", ), info_button, @@ -158,11 +158,11 @@ def build(self): alignment="spaceBetween", ), Markdown( - f"""Before following these instructions please ensure that the device is currently using Android {required_android_version} firmware. + _("""Before following these instructions please ensure that the device is currently using Android {required_android_version} firmware. If the vendor provided multiple updates for that version, e.g. security updates, make sure you are on the latest! If your current installation is newer or older than Android {required_android_version}, please upgrade or downgrade to the required version before proceeding (guides can be found on the internet!). - """ + """).format(required_android_version=required_android_version) ), android_checkbox, ] @@ -189,7 +189,7 @@ def build(self): Row( [ Text( - f"Firmware Version {required_firmware_version}:", + _("Firmware Version {required_firmware_version}:").format(required_firmware_version=required_firmware_version), style="titleSmall", ), info_button, @@ -197,10 +197,10 @@ def build(self): alignment="spaceBetween", ), Markdown( - f"""Before following these instructions please ensure that the device is on firmware version {required_firmware_version}. + _("""Before following these instructions please ensure that the device is on firmware version {required_firmware_version}. To discern this, you can run the command `adb shell getprop ro.build.display.id` on the stock ROM. If the device is not on the specified version, please follow the instructions below to install it. - """ + """).format(required_firmware_version=required_firmware_version) ), firmware_checkbox, ] diff --git a/openandroidinstaller/views/select_view.py b/openandroidinstaller/views/select_view.py index 82f3dfef..5cdf9e7f 100644 --- a/openandroidinstaller/views/select_view.py +++ b/openandroidinstaller/views/select_view.py @@ -245,8 +245,8 @@ def build(self): [ Text(_("Select an OS image:"), style="titleSmall"), Markdown( - f""" -The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.device_code}-signed.zip`.""" + _(""" +The image file should look something like `lineage-19.1-20221101-nightly-{device_code}-signed.zip`.""").format(device_code=self.state.config.device_code) ), Row( [ @@ -271,10 +271,10 @@ def build(self): [ Text(_("Select a TWRP recovery image:"), style="titleSmall"), Markdown( - f""" -The recovery image should look something like `twrp-3.7.0_12-0-{self.state.config.device_code}.img`. + _(""" +The recovery image should look something like `twrp-3.7.0_12-0-{device_code}.img`. -**Note:** This tool **only supports TWRP recoveries**.""", +**Note:** This tool **only supports TWRP recoveries**.""").format(device_code=self.state.config.device_code), extension_set="gitHubFlavored", ), Row( @@ -346,7 +346,7 @@ def toggle_additional_image_selection(self): modal=True, title=Text(_("Why do I need additional images and where do I get them?")), content=Markdown( - f"""## About additional images + _("""## About additional images Some devices require additional images to be flashed before the recovery and OS image can be flashed. Not all images explained below are required for all devices. The installer will tell you which images are required for your device. @@ -365,9 +365,9 @@ def toggle_additional_image_selection(self): The `vendor_boot.img` is a partition image that contains the vendor boot image. ## Where do I get these images? -You can download the required images for your device from the [LineageOS downloads page](https://download.lineageos.org/devices/{self.state.config.device_code}/builds). +You can download the required images for your device from the [LineageOS downloads page](https://download.lineageos.org/devices/{device_code}/builds). If this download page does not contain the required images, you can try to find them on the [XDA developers forum](https://xdaforums.com). - """, + """).format(device_code=self.state.config.device_code), auto_follow_links=True, ), actions=[ diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index 0d596e7b..334bc836 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -274,7 +274,7 @@ def search_devices_clicked(self, e): f"Device with code '{device_code}' is not supported or the config is corrupted. Please check the logs for more information." ) self.device_name.value = ( - f"Device with code '{device_code}' is not supported yet." + _("Device with code '{device_code}' is not supported yet.").format(device_code=device_code) ) # add request support for device button request_url = f"https://github.com/openandroidinstaller-dev/openandroidinstaller/issues/new?labels=device&template=device-support-request.yaml&title=Add support for `{device_code}`" diff --git a/openandroidinstaller/views/step_view.py b/openandroidinstaller/views/step_view.py index 65e32be1..e5349a22 100644 --- a/openandroidinstaller/views/step_view.py +++ b/openandroidinstaller/views/step_view.py @@ -281,7 +281,7 @@ def call_to_phone(self, e, command: str): # enable call button to retry self.call_button.disabled = False # also remove the last error text if it happened - self.error_text.value = f"Command {command} failed! Try again or make sure everything is setup correctly." + self.error_text.value = _("Command {command} failed! Try again or make sure everything is setup correctly.").format(command=command) else: sleep(5) # wait to make sure everything is fine logger.success(f"Command {command} run successfully. Allow to continue.") diff --git a/openandroidinstaller/views/success_view.py b/openandroidinstaller/views/success_view.py index e4cbccfb..b6eb8597 100644 --- a/openandroidinstaller/views/success_view.py +++ b/openandroidinstaller/views/success_view.py @@ -53,13 +53,13 @@ def close_window(e): style="titleSmall", ), Markdown( - f""" + _(""" If you liked the tool, help spread the word and **share it with people** who might want to use it. Also, you can consider contributing to make it better. There are a lot of different ways how you can help! [How to contribute]({contribute_link}) -""", +""").format(contribute_link=contribute_link), ), Row( [ diff --git a/openandroidinstaller/widgets.py b/openandroidinstaller/widgets.py index e4400c5a..22530ad7 100644 --- a/openandroidinstaller/widgets.py +++ b/openandroidinstaller/widgets.py @@ -195,7 +195,7 @@ def get_title( Image( src=f"/imgs/{step_indicator_img}", fit="fitWidth", - tooltip=f"Current step: {title}", + tooltip=_("Current step: {title}").format(title=title), width=600, ), content, @@ -213,7 +213,7 @@ def get_title( def confirm_button( - confirm_func: Callable, confirm_text: str = "Continue" + confirm_func: Callable, confirm_text: str = _("Continue") ) -> ElevatedButton: """Get a button, that calls a given function when clicked.""" return ElevatedButton( @@ -225,7 +225,7 @@ def confirm_button( def call_button( - call_func: Callable, command: str, confirm_text: str = "Confirm and run" + call_func: Callable, command: str, confirm_text: str = _("Confirm and run") ) -> ElevatedButton: """Get a button, that calls a given function with given command when clicked.""" return ElevatedButton( From 70ce0fc9404ce40259cca7cf1270c5ec80c6c00d Mon Sep 17 00:00:00 2001 From: rudu <40572253+anon1892@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:24:56 +0100 Subject: [PATCH 4/8] Automaticaly test if user locale is available --- openandroidinstaller/translations.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/openandroidinstaller/translations.py b/openandroidinstaller/translations.py index 7afdfc68..1b49a3b4 100644 --- a/openandroidinstaller/translations.py +++ b/openandroidinstaller/translations.py @@ -1,4 +1,4 @@ -"""File to import to manage translations.""" +"""File that manages translations.""" # This file is part of OpenAndroidInstaller. # OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of @@ -13,14 +13,16 @@ # If not, see .""" # Author: Tobias Sterbak -import os +import locale import gettext +from loguru import logger -# Initialize localization -# TODO : Automaticaly check user locale and if available, use it. -fr = gettext.translation('base', localedir='locales', languages=['fr']) -fr.install() -_ = fr.gettext # French -#os.environ['LANGUAGE']='fr' -#_ = gettext.gettext +# Initialize localization with user locale if available +try: + lang = gettext.translation('base', localedir='locales', languages=[locale.getlocale()[0]]) +except FileNotFoundError: + logger.info("User locale not available, fallback to english") + lang = gettext.translation('base', localedir='locales', languages=['en']) +lang.install() +_ = lang.gettext From 92855be1bf09e9f94e3b2be4b2c082efd8d2d077 Mon Sep 17 00:00:00 2001 From: rudu <40572253+anon1892@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:51:01 +0100 Subject: [PATCH 5/8] French translation (except config files) --- locales/base.pot | 806 ++++++++++++++++++++++++ locales/en/LC_MESSAGES/base.po | 48 ++ locales/fr/LC_MESSAGES/base.mo | Bin 0 -> 32427 bytes locales/fr/LC_MESSAGES/base.po | 1057 ++++++++++++++++++++++++++++++++ 4 files changed, 1911 insertions(+) create mode 100644 locales/base.pot create mode 100644 locales/en/LC_MESSAGES/base.po create mode 100644 locales/fr/LC_MESSAGES/base.mo create mode 100644 locales/fr/LC_MESSAGES/base.po diff --git a/locales/base.pot b/locales/base.pot new file mode 100644 index 00000000..634f5f09 --- /dev/null +++ b/locales/base.pot @@ -0,0 +1,806 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-01-13 15:00+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: openandroidinstaller/app_state.py:98 openandroidinstaller/app_state.py:120 +#: openandroidinstaller/views/step_view.py:120 +msgid "Boot custom recovery" +msgstr "" + +#: openandroidinstaller/app_state.py:100 openandroidinstaller/app_state.py:122 +msgid "" +"If you already flashed TWRP, boot into it by pressing 'Confirm and run'. " +"Otherwise restart the process. Once your phone screen looks like the picture " +"on the left, continue." +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:240 +#, python-brace-format +msgid "OpenAndroidInstaller version {version}" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:254 +msgid "Frequently asked questions and encountered issues." +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:259 +msgid "Give feedback" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:265 +msgid "Give feedback about your experience with OpenAndroidInstaller" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:270 +msgid "Report a bug" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:276 +msgid "Report an issue on github" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:290 +msgid "" +"These instructions only work if you follow every section and step precisely. " +"Do not continue after something fails!" +msgstr "" + +#: openandroidinstaller/openandroidinstaller.py:293 +msgid "I understand" +msgstr "" + +#: openandroidinstaller/widgets.py:198 +#, python-brace-format +msgid "Current step: {title}" +msgstr "" + +#: openandroidinstaller/widgets.py:216 +#: openandroidinstaller/views/requirements_view.py:68 +#: openandroidinstaller/views/start_view.py:64 +msgid "Continue" +msgstr "" + +#: openandroidinstaller/widgets.py:228 +msgid "Confirm and run" +msgstr "" + +#: openandroidinstaller/views/addon_view.py:59 +msgid "What kind of addons are supported?" +msgstr "" + +#: openandroidinstaller/views/addon_view.py:61 +msgid "" +"## Google Apps:\n" +"There are different packages of Google Apps available. Most notable\n" +"- [MindTheGapps](https://wiki.lineageos.org/gapps#downloads) and \n" +"- [NikGApps](https://nikgapps.com).\n" +"\n" +"These packages are only dependent on your OS version and processor " +"architecture, which can be found on each device specific info page.\n" +"Filenames on MindTheGApps are of the format `MindTheGapps--" +"-_