From c2454d37df2537137645c46f82d13e8c5b81e098 Mon Sep 17 00:00:00 2001 From: gamerYazilimci67 Date: Fri, 22 Nov 2024 20:31:41 +0300 Subject: [PATCH] =?UTF-8?q?Dil=20dosyalar=C4=B1=20bulunamad=C4=B1=C4=9F?= =?UTF-8?q?=C4=B1nda=20indirme=20eklendi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 ++++++------------- anka-browser.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8a39d9f..bdbe770 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Anka -Anka Browser v1.9 +Anka Browser v1.9.5 ## What is Anka Browser? @@ -12,12 +12,13 @@ You can download and use Anka Browser in every Python installed device. --- -## Anka v1.9 Beta: +## Anka v1.9.5: -- ### Bookmarks Beta: - Now, bookmars added. But beta version. - +- ### Better Project Struct +- ### Bookmarks: + Now, bookmars added. + - ### Languages: Now, Anka Browser is support two language. Türkçe(Turkish) and English. You can change language from settings. @@ -46,14 +47,6 @@ You can download and use Anka Browser in every Python installed device. ![Screenshot2](./.github/docs/img/image2.png) ![Screenshot3](./.github/docs/img/image3.png) -## Imported Python libraries in project: - -- PyQt6 -- sys -- os -- configparser -- json - ## How I download Anka Browser? - Download latest version from Releases. - And extract it. diff --git a/anka-browser.py b/anka-browser.py index 8f97bf8..3b912d3 100644 --- a/anka-browser.py +++ b/anka-browser.py @@ -7,7 +7,10 @@ import configparser import json import re +import requests +tr_json_url = "https://raw.githubusercontent.com/gamerYazilimci45/Anka/main/public/browser/languages/tr-TR.json" +en_json_url = "https://raw.githubusercontent.com/gamerYazilimci45/Anka/main/public/browser/languages/en-US.json" home = os.path.expanduser('~') config_anka = f"{home}/.config/Anka" @@ -16,6 +19,19 @@ os.makedirs(config_anka) config_path = f"{config_anka}/config.conf" +browser_path = f"{config_anka}/public/browser" + + +if not os.path.exists(browser_path): + os.makedirs(browser_path) + + +languages_path = f"{browser_path}/languages" +if not os.path.exists(languages_path): + os.makedirs(languages_path) + +tr_json = f"{languages_path}/tr-TR.json" +en_json = f"{languages_path}/en-EN.json" if not os.path.exists(config_path): with open(config_path, 'w') as cf: @@ -30,6 +46,19 @@ language = tr-TR """) +if not os.path.exists(tr_json): + response = requests.get(tr_json_url) + response.raise_for_status() + + with open(tr_json, 'x', encoding="utf-8") as jsonn: + json.dump(response.json(), jsonn, ensure_ascii=False, indent=4) + +if not os.path.exists(en_json): + response = requests.get(en_json_url) + response.raise_for_status() + + with open(en_json, 'x', encoding="utf-8") as jsonn: + json.dump(response.json(), jsonn, ensure_ascii=False, indent=4) config = configparser.ConfigParser() config.read(config_path)