Fixes in admin

This commit is contained in:
Antonio de la Rosa 2025-04-05 00:57:02 +02:00
parent b0881e7267
commit e10b5295bd
6 changed files with 39 additions and 1 deletions

View file

@ -108,7 +108,35 @@ class I18n:
#@staticmethod
#def set_lang(code_lang):
# if default_lang
def __init__(self, module):
self.module=module
def slang(self, symbol, text_default, lang=None):
"""Method for get a string from selected language but object oriented
Method for get a string from selected language but object oriented
Args:
symbol (str): The symbol used for identify the text string.
text_default (str): The text default used. You have use how base for translations.
"""
return I18n.lang(self.module, symbol, text_default)
def tlang(self, text_default, lang=None):
"""Method for get a string from selected language but object oriented and using module and symbol by default
Method for get a string from selected language but object oriented and using module and symbol by default
Args:
symbol (str): The symbol used for identify the text string.
text_default (str): The text default used. You have use how base for translations.
"""
symbol=text_default[:60]
return I18n.lang(self.module, symbol, text_default)
@staticmethod
def get_default_lang():