From 783f6d60e2b77e5cbd8a2f5ee8abb36fa45aa7e6 Mon Sep 17 00:00:00 2001 From: Levi <57452819+l3v11@users.noreply.github.com> Date: Tue, 30 Aug 2022 12:17:46 +0600 Subject: [PATCH] Fix locale issue --- Dockerfile | 13 +++++++++---- bot/helper/drive_utils/gdriveTools.py | 15 ++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 56768005..f33b5050 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,16 @@ WORKDIR /usr/src/app SHELL ["/bin/bash", "-c"] RUN chmod 777 /usr/src/app -RUN apt-get -qq update && DEBIAN_FRONTEND="noninteractive" \ - apt-get -qq install -y locales python3 python3-pip \ - libmagic-dev p7zip-full p7zip-rar unzip && locale-gen en_US.UTF-8 +ARG DEBIAN_FRONTEND=noninteractive -ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en" +ENV LANGUAGE=en_US:en \ + LC_ALL=C.UTF-8 \ + LANG=en_US.UTF-8 + +RUN apt-get -qq update && apt-get -qq install -y \ + python3 python3-pip locales libmagic-dev \ + p7zip-full p7zip-rar unzip && \ + locale-gen en_US.UTF-8 COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt diff --git a/bot/helper/drive_utils/gdriveTools.py b/bot/helper/drive_utils/gdriveTools.py index e1b9d03f..e8b8bc4a 100644 --- a/bot/helper/drive_utils/gdriveTools.py +++ b/bot/helper/drive_utils/gdriveTools.py @@ -66,9 +66,6 @@ def __init__(self, name=None, path=None, size=0, listener=None): self.response = {} self.telegraph_path = [] self.telegraph_content = [] - self.title = "SearchX" - self.author_name = "Levi" - self.author_url = "https://t.me/l3v11" def speed(self): """ @@ -725,9 +722,9 @@ def __create_page(self, acc, content): try: self.telegraph_path.append( acc.create_page( - title=self.title, - author_name=self.author_name, - author_url=self.author_url, + title="SearchX", + author_name="Levi", + author_url="https://t.me/l3v11", html_content=content)['path']) except RetryAfterError as e: LOGGER.info(f"Cooldown: {e.retry_after} seconds") @@ -738,9 +735,9 @@ def __edit_page(self, acc, content, path): try: acc.edit_page( path=path, - title=self.title, - author_name=self.author_name, - author_url=self.author_url, + title="SearchX", + author_name="Levi", + author_url="https://t.me/l3v11", html_content=content) except RetryAfterError as e: LOGGER.info(f"Cooldown: {e.retry_after} seconds")