From 011b1f2a722a58d0875bdc1c60b45373972e8e17 Mon Sep 17 00:00:00 2001 From: Sayyid Hamid Mahdavi Date: Tue, 9 Sep 2025 14:08:48 +0330 Subject: [PATCH] i18n --- apps/pg/models.py | 2 +- locale/ar/LC_MESSAGES/django.mo | Bin 0 -> 463 bytes locale/ar/LC_MESSAGES/django.po | 120 ++++++++++++++++++++++++++++++++ locale/en/LC_MESSAGES/django.mo | Bin 0 -> 380 bytes locale/en/LC_MESSAGES/django.po | 119 +++++++++++++++++++++++++++++++ locale/fa/LC_MESSAGES/django.mo | Bin 0 -> 647 bytes locale/fa/LC_MESSAGES/django.po | 119 +++++++++++++++++++++++++++++++ locale/tr/LC_MESSAGES/django.mo | Bin 0 -> 379 bytes locale/tr/LC_MESSAGES/django.po | 119 +++++++++++++++++++++++++++++++ main/settings.py | 11 ++- 10 files changed, 488 insertions(+), 2 deletions(-) create mode 100644 locale/ar/LC_MESSAGES/django.mo create mode 100644 locale/ar/LC_MESSAGES/django.po create mode 100644 locale/en/LC_MESSAGES/django.mo create mode 100644 locale/en/LC_MESSAGES/django.po create mode 100644 locale/fa/LC_MESSAGES/django.mo create mode 100644 locale/fa/LC_MESSAGES/django.po create mode 100644 locale/tr/LC_MESSAGES/django.mo create mode 100644 locale/tr/LC_MESSAGES/django.po diff --git a/apps/pg/models.py b/apps/pg/models.py index b7f9615..2560397 100644 --- a/apps/pg/models.py +++ b/apps/pg/models.py @@ -130,7 +130,7 @@ class PaymentRequest(models.Model): "payee_type": 1, "amount": self.amount, "details": { - 'description': "charge via IPG", + 'description': _("charge via ipg"), 'reference_id': str(self.uuid), 'application_details_url': '' }, diff --git a/locale/ar/LC_MESSAGES/django.mo b/locale/ar/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..74dbaf67ca1b1ef110318ec24bc2175e757fa49b GIT binary patch literal 463 zcmYk0%}&BV6ooaq>e97~yHGYd*n%1;3{qjh#{Q-JB)S`6tTknZOb4S6!t41g-by0g zJn8=3$;bFjc=9tn?$R3u`tA6lDW`juA~czH+b~M z4CXAI_;F;VVy(0xVVUJia=*z+GF2{ENla4lkykrp$c=E}iFqjrV>0yMA$CLm;yI3( z74XuKsphgQxKY}L(JTlc@pJ zb)~a?1{;Ka$o93Jx@`@VG(zIJuQm2D;?rEM3!cjkEZ(>-g`u(s@AK}gvo_k z<}!1k^^zMaDK?rHWTf<}bV06vza_oxzz(UT)P_5-0bNQRL}!N$#72eZj&1j76Kb^` Xcd1itH20q4{4?8aG_TRT=~xFpfMj~p literal 0 HcmV?d00001 diff --git a/locale/ar/LC_MESSAGES/django.po b/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 0000000..c3dc886 --- /dev/null +++ b/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,120 @@ +# 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: 2025-09-09 14:04+0330\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +#: apps/pg/constans.py:6 +msgid "created" +msgstr "" + +#: apps/pg/constans.py:7 +msgid "ipg pending" +msgstr "" + +#: apps/pg/constans.py:8 +msgid "ipg success" +msgstr "" + +#: apps/pg/constans.py:10 +msgid "wallet submit pending" +msgstr "" + +#: apps/pg/constans.py:11 +msgid "wallet submit success" +msgstr "" + +#: apps/pg/constans.py:13 +msgid "failed" +msgstr "" + +#: apps/pg/constans.py:14 +msgid "expected failure" +msgstr "" + +#: apps/pg/constans.py:15 +msgid "success" +msgstr "" + +#: apps/pg/constans.py:19 +msgid "user" +msgstr "" + +#: apps/pg/constans.py:20 +msgid "application" +msgstr "" + +#: apps/pg/models.py:24 +msgid "fake" +msgstr "" + +#: apps/pg/models.py:25 +msgid "pna" +msgstr "" + +#: apps/pg/models.py:133 +msgid "charge via ipg" +msgstr "" + +#: apps/users/models.py:49 +msgid "password" +msgstr "" + +#: apps/users/models.py:52 +msgid "username" +msgstr "" + +#: apps/users/models.py:55 +msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." +msgstr "" + +#: apps/users/models.py:58 +msgid "A user with that username already exists." +msgstr "" + +#: apps/users/models.py:64 +msgid "last update" +msgstr "" + +#: apps/users/models.py:65 +msgid "last login" +msgstr "" + +#: apps/users/models.py:66 +msgid "date joined" +msgstr "" + +#: main/settings.py:184 +msgid "English" +msgstr "" + +#: main/settings.py:185 +msgid "Persian" +msgstr "" + +#: main/settings.py:186 +msgid "Arabic" +msgstr "" + +#: main/settings.py:187 +msgid "Turkish" +msgstr "" + +#: templates/admin/input_filter.html:5 +#, python-format +msgid " By %(filter_title)s " +msgstr "" diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..71cbdf3e9d8d54be31066ec4ad8628bc2c1f2845 GIT binary patch literal 380 zcmYL@K~KUk7=|%=+R?Lz&%}d9i{c3jGZa>EvE7z2Nc2{r&Y96JZ6W$Y{CoZuJ5A(G zp7i_Dx9RhJeDu}vIq;l#&OC>nD^HugXY4QU{MmN?lNtRkR}RH%w3NnHT4Bh@vF%H^(V-=Ii1iQ$Qo9Pt!I1Rhe%oml#`f^NEGFCKEL->Rc=KoQ6a?!10%_7(V7ey8`V`;n{war z20Z3;uifk31QV^CRQ|iq#``$=;jWunRB8aLH({)F;i8zL{=V00y-I_qTIqGAN(}v% i$^}`yHKImSZ8jEzYJOK6-VWez49^vuhS0kh1f3tbb!oc* literal 0 HcmV?d00001 diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000..584b9ba --- /dev/null +++ b/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,119 @@ +# 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: 2025-09-09 14:04+0330\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: apps/pg/constans.py:6 +msgid "created" +msgstr "" + +#: apps/pg/constans.py:7 +msgid "ipg pending" +msgstr "" + +#: apps/pg/constans.py:8 +msgid "ipg success" +msgstr "" + +#: apps/pg/constans.py:10 +msgid "wallet submit pending" +msgstr "" + +#: apps/pg/constans.py:11 +msgid "wallet submit success" +msgstr "" + +#: apps/pg/constans.py:13 +msgid "failed" +msgstr "" + +#: apps/pg/constans.py:14 +msgid "expected failure" +msgstr "" + +#: apps/pg/constans.py:15 +msgid "success" +msgstr "" + +#: apps/pg/constans.py:19 +msgid "user" +msgstr "" + +#: apps/pg/constans.py:20 +msgid "application" +msgstr "" + +#: apps/pg/models.py:24 +msgid "fake" +msgstr "" + +#: apps/pg/models.py:25 +msgid "pna" +msgstr "" + +#: apps/pg/models.py:133 +msgid "charge via ipg" +msgstr "" + +#: apps/users/models.py:49 +msgid "password" +msgstr "" + +#: apps/users/models.py:52 +msgid "username" +msgstr "" + +#: apps/users/models.py:55 +msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." +msgstr "" + +#: apps/users/models.py:58 +msgid "A user with that username already exists." +msgstr "" + +#: apps/users/models.py:64 +msgid "last update" +msgstr "" + +#: apps/users/models.py:65 +msgid "last login" +msgstr "" + +#: apps/users/models.py:66 +msgid "date joined" +msgstr "" + +#: main/settings.py:184 +msgid "English" +msgstr "" + +#: main/settings.py:185 +msgid "Persian" +msgstr "" + +#: main/settings.py:186 +msgid "Arabic" +msgstr "" + +#: main/settings.py:187 +msgid "Turkish" +msgstr "" + +#: templates/admin/input_filter.html:5 +#, python-format +msgid " By %(filter_title)s " +msgstr "" diff --git a/locale/fa/LC_MESSAGES/django.mo b/locale/fa/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..2e8cd0d52d86e2c9e10b19efa640104f892d9e53 GIT binary patch literal 647 zcmYL^&u-H|5XKFZKQa;rZb%$PoIq#`;Z!+ERnu%rgq=i=QweU{WO28+>uBv%AaN-w z5r&Ha3`8%onkw1jos87FWZO6s=|I!n zeClpd*rq|N)~MS7? zv(^i)2$h|rD`e!r+K$NVX53dSCe=jkrw+*8tW3*~iZD;hcO|St;a<_U^iMs}$J3#u zNBQ7anvf6NE@kr~Pd)_*}8%1;0Q literal 0 HcmV?d00001 diff --git a/locale/fa/LC_MESSAGES/django.po b/locale/fa/LC_MESSAGES/django.po new file mode 100644 index 0000000..6252a0f --- /dev/null +++ b/locale/fa/LC_MESSAGES/django.po @@ -0,0 +1,119 @@ +# 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: 2025-09-09 14:03+0330\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: apps/pg/constans.py:6 +msgid "created" +msgstr "" + +#: apps/pg/constans.py:7 +msgid "ipg pending" +msgstr "" + +#: apps/pg/constans.py:8 +msgid "ipg success" +msgstr "" + +#: apps/pg/constans.py:10 +msgid "wallet submit pending" +msgstr "" + +#: apps/pg/constans.py:11 +msgid "wallet submit success" +msgstr "" + +#: apps/pg/constans.py:13 +msgid "failed" +msgstr "" + +#: apps/pg/constans.py:14 +msgid "expected failure" +msgstr "" + +#: apps/pg/constans.py:15 +msgid "success" +msgstr "" + +#: apps/pg/constans.py:19 +msgid "user" +msgstr "" + +#: apps/pg/constans.py:20 +msgid "application" +msgstr "" + +#: apps/pg/models.py:24 +msgid "fake" +msgstr "" + +#: apps/pg/models.py:25 +msgid "pna" +msgstr "" + +#: apps/pg/models.py:133 +msgid "charge via ipg" +msgstr "افزایش موجودی از طریق پرداخت آنلاین" + +#: apps/users/models.py:49 +msgid "password" +msgstr "" + +#: apps/users/models.py:52 +msgid "username" +msgstr "" + +#: apps/users/models.py:55 +msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." +msgstr "" + +#: apps/users/models.py:58 +msgid "A user with that username already exists." +msgstr "" + +#: apps/users/models.py:64 +msgid "last update" +msgstr "" + +#: apps/users/models.py:65 +msgid "last login" +msgstr "" + +#: apps/users/models.py:66 +msgid "date joined" +msgstr "" + +#: main/settings.py:184 +msgid "English" +msgstr "انگلیسی" + +#: main/settings.py:185 +msgid "Persian" +msgstr "فارسی" + +#: main/settings.py:186 +msgid "Arabic" +msgstr "عربی" + +#: main/settings.py:187 +msgid "Turkish" +msgstr "ترکی" + +#: templates/admin/input_filter.html:5 +#, python-format +msgid " By %(filter_title)s " +msgstr "" diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..2c90dd0c81aca562856271a6885816b565885734 GIT binary patch literal 379 zcmYL@y-ve06h@0+%E-)c2L=$hP^RMksHSmCgq=ibS_wAOnqZXLk?kUQ5MGaG!2yYW z(vk0#Kg;L)_~@$>au7HPoCXd9mw`6@01213;cPqq$*p;lYmbr*T1o4a(HL?veIRoR zD_Sg)ER71;80!&tmD-@YUFA?|FhqHV3i+e|LVdy_A hALaGViW<#~-8u}q`CZ-UW&nTV=uE>Hdgp_v^8-$QX_^24 literal 0 HcmV?d00001 diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po new file mode 100644 index 0000000..dd60a8c --- /dev/null +++ b/locale/tr/LC_MESSAGES/django.po @@ -0,0 +1,119 @@ +# 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: 2025-09-09 14:04+0330\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: apps/pg/constans.py:6 +msgid "created" +msgstr "" + +#: apps/pg/constans.py:7 +msgid "ipg pending" +msgstr "" + +#: apps/pg/constans.py:8 +msgid "ipg success" +msgstr "" + +#: apps/pg/constans.py:10 +msgid "wallet submit pending" +msgstr "" + +#: apps/pg/constans.py:11 +msgid "wallet submit success" +msgstr "" + +#: apps/pg/constans.py:13 +msgid "failed" +msgstr "" + +#: apps/pg/constans.py:14 +msgid "expected failure" +msgstr "" + +#: apps/pg/constans.py:15 +msgid "success" +msgstr "" + +#: apps/pg/constans.py:19 +msgid "user" +msgstr "" + +#: apps/pg/constans.py:20 +msgid "application" +msgstr "" + +#: apps/pg/models.py:24 +msgid "fake" +msgstr "" + +#: apps/pg/models.py:25 +msgid "pna" +msgstr "" + +#: apps/pg/models.py:133 +msgid "charge via ipg" +msgstr "" + +#: apps/users/models.py:49 +msgid "password" +msgstr "" + +#: apps/users/models.py:52 +msgid "username" +msgstr "" + +#: apps/users/models.py:55 +msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." +msgstr "" + +#: apps/users/models.py:58 +msgid "A user with that username already exists." +msgstr "" + +#: apps/users/models.py:64 +msgid "last update" +msgstr "" + +#: apps/users/models.py:65 +msgid "last login" +msgstr "" + +#: apps/users/models.py:66 +msgid "date joined" +msgstr "" + +#: main/settings.py:184 +msgid "English" +msgstr "" + +#: main/settings.py:185 +msgid "Persian" +msgstr "" + +#: main/settings.py:186 +msgid "Arabic" +msgstr "" + +#: main/settings.py:187 +msgid "Turkish" +msgstr "" + +#: templates/admin/input_filter.html:5 +#, python-format +msgid " By %(filter_title)s " +msgstr "" diff --git a/main/settings.py b/main/settings.py index 67c8799..4a5e9a1 100644 --- a/main/settings.py +++ b/main/settings.py @@ -100,13 +100,15 @@ REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'oauth2_provider.contrib.rest_framework.OAuth2Authentication', 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', 'PAGE_SIZE': 200, "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", + 'EXCEPTION_HANDLER': 'utils.exceptions.exception_handler', } ROOT_URLCONF = 'main.urls' @@ -178,6 +180,13 @@ USE_L10N = True USE_TZ = False +LANGUAGES = [ + ('en', _('English')), + ('fa', _('Persian')), + ('ar', _('Arabic')), + ('tr', _('Turkish')), +] + LOCALE_PATHS = [ BASE_DIR / 'locale', ]