Fixes in i18n
This commit is contained in:
parent
1485e5cee6
commit
5008fc0462
5 changed files with 75 additions and 39 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
|
@ -16,11 +17,42 @@ lang_t=re.compile("\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
|||
|
||||
def start():
|
||||
|
||||
global lang_p
|
||||
global lang_t
|
||||
|
||||
# Module to search a file where save the file.
|
||||
|
||||
parser = argparse.ArgumentParser(description='A tool for create python language files')
|
||||
|
||||
parser.add_argument('--module', help='The module where search lang files', required=False)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
#Without arguments, search in paramecio directory all language files
|
||||
|
||||
path_save='paramecio/i18n'
|
||||
|
||||
scandir('.', path_save)
|
||||
path='paramecio'
|
||||
|
||||
if args.module!=None:
|
||||
|
||||
path=args.module
|
||||
|
||||
path_save=args.module+'/i18n'
|
||||
|
||||
module_base=os.path.basename(args.module)
|
||||
|
||||
lang_p=re.compile("I18n\.lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
lang_t=re.compile("\${lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||
|
||||
|
||||
if not os.path.isdir(path):
|
||||
|
||||
print("Error: directory to scan doesn't exists")
|
||||
|
||||
exit(1)
|
||||
|
||||
scandir(path, path_save)
|
||||
|
||||
#Save the files
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ from paramecio.citoplasma.i18n import I18n
|
|||
|
||||
I18n.l['admin']['applications']='Applications'
|
||||
|
||||
I18n.l['admin']['sign_up']='Paramecio Sign up'
|
||||
I18n.l['admin']['administrator']='Administrator'
|
||||
|
||||
I18n.l['admin']['selected_privileges']='Selected privileges'
|
||||
|
||||
I18n.l['admin']['users_admin']='User\'s Admin'
|
||||
|
||||
I18n.l['admin']['selected_privileges']='Selected privileges'
|
||||
I18n.l['admin']['sign_up']='Paramecio Sign up'
|
||||
|
||||
I18n.l['admin']['welcome_to_paramecio']='Welcome to Paramecio Admin!!!'
|
||||
|
||||
I18n.l['admin']['login']='Paramecio Login'
|
||||
|
||||
I18n.l['admin']['without_privileges']='Without privileges'
|
||||
|
||||
I18n.l['admin']['administrator']='Administrator'
|
||||
|
||||
|
|
|
|||
|
|
@ -2,41 +2,41 @@
|
|||
|
||||
from paramecio.citoplasma.i18n import I18n
|
||||
|
||||
I18n.l['common']['repeat_password']='Repeat Password'
|
||||
I18n.l['common']['edit']='Edit'
|
||||
|
||||
I18n.l['common']['add_new_item']='Add new item'
|
||||
I18n.l['common']['search']='Search'
|
||||
|
||||
I18n.l['common']['error_username_or_password_exists']='Error: username or email exists in database'
|
||||
|
||||
I18n.l['common']['last']='Last'
|
||||
I18n.l['common']['repeat_password']='Repeat Password'
|
||||
|
||||
I18n.l['common']['add_item']='Add new item'
|
||||
I18n.l['common']['error_passwords_no_match']='Error: passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['yes']='Yes'
|
||||
I18n.l['common']['add_new_item']='Add new item'
|
||||
|
||||
I18n.l['common']['edit']='Edit'
|
||||
|
||||
I18n.l['common']['password_no_match']='Passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['delete']='Delete'
|
||||
I18n.l['common']['home']='Home'
|
||||
|
||||
I18n.l['common']['login']='Login'
|
||||
|
||||
I18n.l['common']['no']='No'
|
||||
|
||||
I18n.l['common']['error_login']='Error, wrong username or password'
|
||||
I18n.l['common']['edit_new_item']='Edit item'
|
||||
|
||||
I18n.l['common']['password_no_match']='Passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['sign_up']='Sign up'
|
||||
|
||||
I18n.l['common']['search']='Search'
|
||||
I18n.l['common']['yes']='Yes'
|
||||
|
||||
I18n.l['common']['error_login']='Error, wrong username or password'
|
||||
|
||||
I18n.l['common']['task_successful']='Task successful'
|
||||
|
||||
I18n.l['common']['home']='Home'
|
||||
I18n.l['common']['delete']='Delete'
|
||||
|
||||
I18n.l['common']['edit_new_item']='Edit item'
|
||||
I18n.l['common']['add_item']='Add new item'
|
||||
|
||||
I18n.l['common']['error_passwords_no_match']='Error: passwords doesn\'t match'
|
||||
I18n.l['common']['last']='Last'
|
||||
|
||||
I18n.l['common']['options']='Options'
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ from paramecio.citoplasma.i18n import I18n
|
|||
|
||||
I18n.l['admin']['applications']='Applications'
|
||||
|
||||
I18n.l['admin']['sign_up']='Entrar en Paramecio'
|
||||
I18n.l['admin']['administrator']='Administrador'
|
||||
|
||||
I18n.l['admin']['selected_privileges']='Selected privileges'
|
||||
|
||||
I18n.l['admin']['users_admin']='Usuarios de administración'
|
||||
|
||||
I18n.l['admin']['selected_privileges']='Selected privileges'
|
||||
I18n.l['admin']['sign_up']='Entrar en Paramecio'
|
||||
|
||||
I18n.l['admin']['welcome_to_paramecio']='Bienvenido a la administración de este site!!'
|
||||
|
||||
I18n.l['admin']['login']='Entrar en Paramecio'
|
||||
|
||||
I18n.l['admin']['without_privileges']='Without privileges'
|
||||
|
||||
I18n.l['admin']['administrator']='Administrador'
|
||||
|
||||
|
|
|
|||
|
|
@ -2,41 +2,41 @@
|
|||
|
||||
from paramecio.citoplasma.i18n import I18n
|
||||
|
||||
I18n.l['common']['repeat_password']='Repeat Password'
|
||||
I18n.l['common']['edit']='Edit'
|
||||
|
||||
I18n.l['common']['add_new_item']='Add new item'
|
||||
I18n.l['common']['search']='Search'
|
||||
|
||||
I18n.l['common']['error_username_or_password_exists']='Error: username or email exists in database'
|
||||
|
||||
I18n.l['common']['last']='Last'
|
||||
I18n.l['common']['repeat_password']='Repeat Password'
|
||||
|
||||
I18n.l['common']['add_item']='Add new item'
|
||||
I18n.l['common']['error_passwords_no_match']='Error: passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['yes']='Yes'
|
||||
I18n.l['common']['add_new_item']='Add new item'
|
||||
|
||||
I18n.l['common']['edit']='Edit'
|
||||
|
||||
I18n.l['common']['password_no_match']='Passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['delete']='Delete'
|
||||
I18n.l['common']['home']='Home'
|
||||
|
||||
I18n.l['common']['login']='Login'
|
||||
|
||||
I18n.l['common']['no']='No'
|
||||
|
||||
I18n.l['common']['error_login']='Error, wrong username or password'
|
||||
I18n.l['common']['edit_new_item']='Edit item'
|
||||
|
||||
I18n.l['common']['password_no_match']='Passwords doesn\'t match'
|
||||
|
||||
I18n.l['common']['sign_up']='Sign up'
|
||||
|
||||
I18n.l['common']['search']='Search'
|
||||
I18n.l['common']['yes']='Yes'
|
||||
|
||||
I18n.l['common']['error_login']='Error, wrong username or password'
|
||||
|
||||
I18n.l['common']['task_successful']='Task successful'
|
||||
|
||||
I18n.l['common']['home']='Home'
|
||||
I18n.l['common']['delete']='Delete'
|
||||
|
||||
I18n.l['common']['edit_new_item']='Edit item'
|
||||
I18n.l['common']['add_item']='Add new item'
|
||||
|
||||
I18n.l['common']['error_passwords_no_match']='Error: passwords doesn\'t match'
|
||||
I18n.l['common']['last']='Last'
|
||||
|
||||
I18n.l['common']['options']='Options'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue