Fixes in admin
This commit is contained in:
parent
b0881e7267
commit
e10b5295bd
6 changed files with 39 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
from paramecio2.libraries.db.corefields import PhangoField
|
||||
from paramecio2.libraries.db.coreforms import PasswordForm
|
||||
from hmac import compare_digest as compare_hash
|
||||
import crypt
|
||||
#import crypt
|
||||
import re
|
||||
|
||||
class UserNameField(PhangoField):
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -157,8 +157,12 @@ class PTemplate:
|
|||
#print(path.basename(module_env)+' '+base_name+'/languages/')
|
||||
|
||||
self.l=PGetText(module_env+'/app.py')
|
||||
|
||||
self.i18n=I18n(module_env)
|
||||
|
||||
self.add_filter(self._)
|
||||
|
||||
self.add_filter(self.i18n.tlang)
|
||||
|
||||
def _(self, text):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue