From 1b30b63e9a8fa8009cf7bca8c140b6838cda78fe Mon Sep 17 00:00:00 2001 From: Marucci Maximo Date: Tue, 7 May 2024 00:15:06 -0300 Subject: [PATCH] feat (EFDE): #32 translations system - Add feature to incorporate translation into i18n directory - en_US - es_ES - pt_PT - Translations of implementations available so far - Fix small bugs --- CHANGELOG.md | 2 +- README.md | 2 + bin/efde.sh | 19 +++++++-- console/common/core | 47 +++++++++++++++++++++-- console/common/i18n/es_ES | 14 +++++++ console/common/i18n/pt_PT | 14 +++++++ console/common/tasks/menu | 22 +++++------ console/efde/i18n/es_ES | 37 ++++++++++++++++++ console/efde/i18n/pt_PT | 37 ++++++++++++++++++ console/efde/props/menu | 2 +- console/efde/tasks/config | 29 +++++++++----- console/efde/tasks/implemention | 2 +- console/efde/tasks/main | 4 +- console/implemention/laravel/i18n/es_ES | 19 +++++++++ console/implemention/laravel/i18n/pt_PT | 19 +++++++++ console/implemention/symfony/i18n/es_ES | 21 ++++++++++ console/implemention/symfony/i18n/pt_PT | 20 ++++++++++ console/implemention/wordpress/i18n/es_ES | 18 +++++++++ console/implemention/wordpress/i18n/pt_PT | 18 +++++++++ console/init | 9 ++--- console/service/docker/i18n/es_ES | 26 +++++++++++++ console/service/docker/i18n/pt_PT | 25 ++++++++++++ console/service/docker/tasks/main | 2 +- console/service/mysql/i18n/es_ES | 19 +++++++++ console/service/mysql/i18n/pt_PT | 19 +++++++++ console/service/mysql/props/menu | 2 +- console/service/mysql/tasks/main | 2 +- docs/developer.md | 11 ++++++ i18n/en_US | 0 i18n/es_ES | 0 30 files changed, 420 insertions(+), 41 deletions(-) create mode 100644 console/common/i18n/es_ES create mode 100644 console/common/i18n/pt_PT create mode 100644 console/efde/i18n/es_ES create mode 100644 console/efde/i18n/pt_PT create mode 100644 console/implemention/laravel/i18n/es_ES create mode 100644 console/implemention/laravel/i18n/pt_PT create mode 100644 console/implemention/symfony/i18n/es_ES create mode 100644 console/implemention/symfony/i18n/pt_PT create mode 100644 console/implemention/wordpress/i18n/es_ES create mode 100644 console/implemention/wordpress/i18n/pt_PT create mode 100644 console/service/docker/i18n/es_ES create mode 100644 console/service/docker/i18n/pt_PT create mode 100644 console/service/mysql/i18n/es_ES create mode 100644 console/service/mysql/i18n/pt_PT delete mode 100644 i18n/en_US delete mode 100644 i18n/es_ES diff --git a/CHANGELOG.md b/CHANGELOG.md index 528a480..5794480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.2.0] 2024-xx-xx ### Added - +- EFDE: #32 Translation system (en_US es_ES pt_PT) - Laravel: #5 Add new implemention - Wordpress: #31 Add new implemention - Symfony: #35 Add new version of Symfony 7.x diff --git a/README.md b/README.md index 25e0a28..8fa2233 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ ![pull-open](https://img.shields.io/github/issues-pr/mmaximo33/efde.svg) ![pull-close](https://img.shields.io/github/issues-pr-closed/mmaximo33/efde.svg) +![efde version](https://img.shields.io/badge/language-grey.svg) ![en_US](https://img.shields.io/badge/en.US-blue.svg) ![es_ES](https://img.shields.io/badge/es.ES-blue.svg) ![pt_PT](https://img.shields.io/badge/pt.PT-blue.svg) + ## Index - [Intro](#intro) diff --git a/bin/efde.sh b/bin/efde.sh index 642b7b2..b35bf5e 100755 --- a/bin/efde.sh +++ b/bin/efde.sh @@ -2,8 +2,9 @@ set -euo pipefail declare -gA GLOBAL_EFDE_CONFIG=( - [EFDE_MODE_DEBUG]=false # Debug Messages - [EFDE_MODE_DEVELOP]=false # MMTodo: Prepared for create tmps + [LANGUAGE_DEFAULT]="en_US" + [EFDE_MODE_DEBUG]=false # Debug Messages + [EFDE_MODE_DEVELOP]=false # MMTodo: Prepared for create tmps ) resolve_absolute_dir() { @@ -38,8 +39,18 @@ menu_implementation(){ fi } -menu(){ +generate_extra_elements(){ efde.tasks.config.check_config + common.core.generate_shortcuts_file + + if [ "${GLOBAL_EFDE_CONFIG['EFDE_MODE_DEBUG']}" = "true" ]; then + if [ ${GLOBAL_EFDE_CONFIG['LANGUAGE_DEFAULT']} != "$(efde.tasks.config.get_var "EFDE_LANGUAGE")" ]; then + common.core.generate_transactions + fi + fi +} + +menu(){ if ! efde.tasks.implemention.has_folder_implementation ; then efde.tasks.menu.main fi @@ -48,12 +59,12 @@ menu(){ } shortcuts(){ - efde.tasks.config.check_config common.tasks.shortcuts.target "$@" } main() { init_dirs # IMPORTANT + generate_extra_elements if [ $# -gt 0 ]; then shortcuts "$@" else diff --git a/console/common/core b/console/common/core index 23e2116..e0bb4e7 100755 --- a/console/common/core +++ b/console/common/core @@ -3,7 +3,7 @@ set -euo pipefail _mod_.step(){ _mod_.msg_debug "#######################################################################" - _mod_.msg_debug "# LOAD MODULES " + _mod_.msg_debug "# LOAD $1 " _mod_.msg_debug "-----------------------------------------------------------------------" } @@ -57,7 +57,7 @@ _mod_.load_module(){ local MODULE_NAME=$(basename "$PATH_MODULE") local elements=("props" "tasks") - _mod_.step + _mod_.step "MODULES" _mod_.msg_debug "Module: $MODULE_NAME" 1 for element in "${elements[@]}"; do @@ -116,6 +116,10 @@ _mod_.replacemod () { sed -E "s/_mod_([a-zA-Z_][a-zA-Z0-9_]*)/${NEW_NAME_VAR}_\1/g" "$SOURCE_PATH" > "$PATH_TARGET" fi + # translation + #sed -i "s/Select an option/hola/g" "$PATH_TARGET" + + if [ ! $? -eq 0 ]; then _mod_.msg_danger "[ERROR] The conversion could not be carried out, report this!" 4 _mod_.msg_danger "Source: $SOURCE_PATH" 5 @@ -133,7 +137,6 @@ _mod_.replacemod () { fi } -# Función para extraer valores _mod_.generate_shortcuts_file() { local TARGET_SHORTCUTS="$DIRECTORY_TMP/common.props.shortcuts" @@ -157,8 +160,44 @@ _mod_.generate_shortcuts_file() { echo ")" >> "$TARGET_SHORTCUTS" source $TARGET_SHORTCUTS + _mod_.step "SHORTCUTS" _mod_.msg_debug "Shortcuts file created in $TARGET_SHORTCUTS" } - +# MMTodo: +# Improve this feature so that +# - Take all characters enclosed in double quotes (\n or \") +# - Do not consider spaces between origin and destination ("origin", "destination") +_mod_.generate_transactions(){ + local PATH_TO_INSPECT="${1:-$PATH_CONSOLE}" + local LANGUAGE_DEFAULT=${GLOBAL_EFDE_CONFIG['LANGUAGE_DEFAULT']} + local LANGUAGE_CONFIG=$(efde.tasks.config.get_var "EFDE_LANGUAGE") + if [ "$LANGUAGE_DEFAULT" != "$LANGUAGE_CONFIG" ]; then + DIRECTORIES=$(find "$PATH_TO_INSPECT" -maxdepth 1 -type d ! -path "$PATH_TO_INSPECT" ! -name "$(basename "$PATH_TO_INSPECT")" -printf "%f\n") + for DIRECTORY in $DIRECTORIES; do + + local PATH_TARGET="$PATH_TO_INSPECT/$DIRECTORY" + local PATH_TASKS_EXISTS="$PATH_TARGET/tasks" + + if [ ! -d "$PATH_TASKS_EXISTS" ]; then + _mod_.generate_transactions "$PATH_TARGET" + else + local FILE_i18n="$PATH_TARGET/i18n/$LANGUAGE_CONFIG" + if common.tasks.file.exists "$FILE_i18n"; then + while IFS= read -r line || [ -n "$line" ]; do + [ -z "$line" ] && continue + + line=$(echo "$line" | sed 's/^"//; s/"$//') + text_old=$(echo "$line" | awk -F '","' '{print $1}') + text_new=$(echo "$line" | awk -F '","' '{print $2}') + + if [ -n "$text_old" ] && [ -n "$text_new" ]; then + find "$DIRECTORY_TMP" -type f -name "$DIRECTORY.*" -exec sh -c "sed -i 's#$text_old#$text_new#g' {};" \; + fi + done < "$FILE_i18n" + fi + fi + done + fi +} diff --git a/console/common/i18n/es_ES b/console/common/i18n/es_ES new file mode 100644 index 0000000..26cd6ea --- /dev/null +++ b/console/common/i18n/es_ES @@ -0,0 +1,14 @@ +"Select an option","Seleccione una opción" +"Error: Path '$PATH' does not exist.","Error: El path '$PATH' no existe." +"Delete FOLDER","Eliminar DIRECTORIO" +"Confirm this action by writing '$CONFIRM_COLOR':","Confirme esta accion escribiendo '$CONFIRM_COLOR':" +"We are about to delete the directory","Estamos a punto de eliminar el directorio" +"We are about to delete the file","Estamos a punto de eliminar el archivo" +"Removed: $PATH","Eliminado: $PATH" +"Removal aborted.","Eliminación cancelada." +"Enter the url of your repository\nEnter URL (https):","Ingrese la url de su repositorio\nIngresar URL (https):" +"Press R to return | Q to quit | I for info","Presionar R para volver | Q para salir | I mas informacion" +"Enter the option number:","Ingresar numero de opción:" +"The '$choice' option is not in the list.","La opción '$choice' no esta en la lista." +"But we found some that may match the desired action:","Pero encontramos algunos que podrian coincidir con la action:" +"The shortcut is not registered:","El shortcut no esta registrado:" \ No newline at end of file diff --git a/console/common/i18n/pt_PT b/console/common/i18n/pt_PT new file mode 100644 index 0000000..f161fe7 --- /dev/null +++ b/console/common/i18n/pt_PT @@ -0,0 +1,14 @@ +"Select an option","Selecione uma opção" +"Error: Path '$PATH' does not exist.","Erro: O caminho '$PATH' não existe." +"Delete FOLDER","Excluir PASTA" +"Confirm this action by writing '$CONFIRM_COLOR':","Confirme esta ação escrevendo '$CONFIRM_COLOR':" +"We are about to delete the directory","Estamos prestes a excluir o diretório" +"We are about to delete the file","Estamos prestes a excluir o arquivo" +"Removed: $PATH","Removido: $PATH" +"Removal aborted.","Remoção cancelada." +"Enter the url of your repository\nEnter URL (https):","Digite o URL do seu repositório\nDigite o URL (https):" +"Press R to return | Q to quit | I for info","Pressione R para retornar | Q para sair | I para informações" +"Enter the option number:","Digite o número da opção:" +"The '$choice' option is not in the list.","A opção '$choice' não está na lista." +"But we found some that may match the desired action:","Mas encontramos algumas que podem corresponder à ação desejada:" +"The shortcut is not registered:","O atalho não está registrado:" \ No newline at end of file diff --git a/console/common/tasks/menu b/console/common/tasks/menu index 205ccd1..1928cac 100644 --- a/console/common/tasks/menu +++ b/console/common/tasks/menu @@ -5,15 +5,15 @@ declare -gA GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE #VARIABLE GLOBAL - HIGH SOLUTIO _mod_.msg_debug() { if [[ "${GLOBAL_EFDE_CONFIG['EFDE_MODE_DEBUG']}" = "true" ]]; then - common.msg_debug "#######################################################################" - common.msg_debug "# MENU " - common.msg_debug "GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE:" 1 - common.msg_debug "title: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['title']}" 2 - common.msg_debug "description: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['description']}" 2 - common.msg_debug "functions:" 2 - common.msg_debug "new: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['function']}" 3 - common.msg_debug "old: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['function_old']}" 3 1 - common.msg_debug "-----------------------------------------------------------------------" + common.core.msg_debug "#######################################################################" + common.core.msg_debug "# MENU " + common.core.msg_debug "GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE:" 1 + common.core.msg_debug "title: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['title']}" 2 + common.core.msg_debug "description: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['description']}" 2 + common.core.msg_debug "functions:" 2 + common.core.msg_debug "new: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['function']}" 3 + common.core.msg_debug "old: ${GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['function_old']}" 3 1 + common.core.msg_debug "-----------------------------------------------------------------------" fi } @@ -42,7 +42,7 @@ _mod_.print_options(){ printf "%-0s. %-25s %s\n" "$i" "$TITULO" "$DESCRIPTION" else - common.tasks.message.warning "\nInvalid menu option: Requieres minimum: \"shortcut, function, name\" \n- For: $OPTION" + common.tasks.message.warning "\nInvalid menu option: Requieres minimum: \'shortcut, function, name\' \n- For: $OPTION" fi done } @@ -100,7 +100,7 @@ _mod_.chosen_option(){ GLOBAL_MENU_RESPONSE_ARRAY_ASOCITIVE['description']="${VALUES[3]:-${VALUES[2]}}" else - common.tasks.message.danger "Error: Formato de entrada incorrecto" + common.tasks.message.danger "Error: Incorrect input format" exit 1 fi } diff --git a/console/efde/i18n/es_ES b/console/efde/i18n/es_ES new file mode 100644 index 0000000..1c0a556 --- /dev/null +++ b/console/efde/i18n/es_ES @@ -0,0 +1,37 @@ +"Select an option","Seleccione una opción" +"Coming Soon","Proximamente" +"Settings and configurations","Configuraciones" +"Show project EFDE","Ver projecto EFDE" +"Efde Global Settings","Ver configuraciones EFDE" +"Show shortcuts","Mostrar shortcuts" +"Report Bug | Improvements | New Features | others","Reportar bugs | mejoras | nuevas caracteristicas | otros" +"Check update and downloads","Comprobar si existe actualizaciones y descargar" +"Uninstall from computer","Desintalar de mi equipo" +"Set config","Establecer configuraciones" +"Your first time with EFDE?","Tu primera vez con EFDE?" +"We will create the basic configurations","Vamos a crear la configuraciones basicas" +"The translation configuration has been applied, we need to restart EFDE","Se ha aplicado la configuración de traducción, necesitamos reiniciar EFDE" +"Run on your console","Ejecutar en su consola" +"This is your EFDE configuration","Esta es tu configuración de EFDE" +"It is stored in the following file","Se almacena en el siguiente archivo" +"Default language?","Idioma default?" +"Established by implementation","Establecido por la implementación" +"Show executed commands, no output","Mostrar comandos ejecutados, sin salida" +"Show executed commands and output","Mostrar comandos ejecutados y salida" +"Do not show executed commands or output","No mostrar comandos ejecutados o salida" +"select EDITOR default","Seleccionar EDITOR predeterminado" +"The project name already exists in this directory.","El nombre del proyecto ya existe en este directorio." +"Verify","Verificar" +"Enter the project name","Ingresar nombre del proyecto" +"Project name","Nombre del proyecto" +"The entered value can only contain letters or numbers.","El valor ingresado solo puede contener letras o números." +"We are excited about the upcoming release!","¡Estamos entusiasmados con el próximo lanzamiento!" +"Our team is hard at work to bring you the latest features and improvements.","Nuestro equipo está trabajando arduamente para brindarle las últimas funciones y mejoras." +"Stay tuned for updates and follow the projects progress on","Manténgase atento a las actualizaciones y siga el progreso del proyecto en" +"Thank you for your patience, and remember to check back for the latest developments.","Gracias por su paciencia y recuerde volver a consultar las últimas novedades." +"Configuring upstream for branch","Configurando rama principal" +"Up to date!","Actualizado a la fecha!" +"There is an update available!","¡Hay una actualización disponible!" +"Do you want to download the new version?","¿Quieres descargar la nueva versión?" +"Updated!","¡Actualizado!" +"Install for ","Instalación para " \ No newline at end of file diff --git a/console/efde/i18n/pt_PT b/console/efde/i18n/pt_PT new file mode 100644 index 0000000..83ae4ae --- /dev/null +++ b/console/efde/i18n/pt_PT @@ -0,0 +1,37 @@ +"Select an option","Selecione uma opção" +"Coming Soon","Em breve" +"Settings and configurations","Configurações" +"Show project EFDE","Mostrar projeto EFDE" +"Efde Global Settings","Configurações globais do EFDE" +"Show shortcuts","Mostrar atalhos" +"Report Bug | Improvements | New Features | others","Reportar erro | Melhorias | Novas funcionalidades | outros" +"Check update and downloads","Verificar atualizações e downloads" +"Uninstall from computer","Desinstalar do computador" +"Set config","Configurar" +"Your first time with EFDE?","Sua primeira vez com o EFDE?" +"We will create the basic configurations","Vamos criar as configurações básicas" +"The translation configuration has been applied, we need to restart EFDE","A configuração de tradução foi aplicada, precisamos reiniciar o EFDE" +"Run on your console","Executar no seu console" +"This is your EFDE configuration","Esta é a sua configuração do EFDE" +"It is stored in the following file","Está armazenado no seguinte arquivo" +"Default language?","Idioma padrão?" +"Established by implementation","Estabelecido pela implementação" +"Show executed commands, no output","Mostrar comandos executados, sem saída" +"Show executed commands and output","Mostrar comandos executados e saída" +"Do not show executed commands or output","Não mostrar comandos executados ou saída" +"select EDITOR default","Selecionar EDITOR padrão" +"The project name already exists in this directory.","O nome do projeto já existe neste diretório." +"Verify","Verificar" +"Enter the project name","Digite o nome do projeto" +"Project name","Nome do projeto" +"The entered value can only contain letters or numbers.","O valor inserido só pode conter letras ou números." +"We are excited about the upcoming release!","Estamos animados com o próximo lançamento!" +"Our team is hard at work to bring you the latest features and improvements.","Nossa equipe está trabalhando duro para trazer as últimas funcionalidades e melhorias." +"Stay tuned for updates and follow the projects progress on","Fique ligado para atualizações e acompanhe o progresso do projeto em" +"Thank you for your patience, and remember to check back for the latest developments.","Obrigado pela sua paciência e lembre-se de verificar as últimas novidades." +"Configuring upstream for branch","Configurando upstream para o ramo" +"Up to date!","Atualizado!" +"There is an update available!","Há uma atualização disponível!" +"Do you want to download the new version?","Você quer baixar a nova versão?" +"Updated!","Atualizado!" +"Install for ","Instalar para " \ No newline at end of file diff --git a/console/efde/props/menu b/console/efde/props/menu index 16821a6..25bf0e3 100644 --- a/console/efde/props/menu +++ b/console/efde/props/menu @@ -41,8 +41,8 @@ set -euo pipefail ) _mod_CONFIG_SET_LANGUAGE=( - "shortcut:off, es_ES, es_ES, Spanish" "shortcut:off, en_US, en_US, English" + "shortcut:off, es_ES, es_ES, Spanish" "shortcut:off, pt_PT, pt_PT, Portuguese" ) } \ No newline at end of file diff --git a/console/efde/tasks/config b/console/efde/tasks/config index 43be48b..a8791f1 100644 --- a/console/efde/tasks/config +++ b/console/efde/tasks/config @@ -10,18 +10,25 @@ _mod_.set_run_cli_efde(){ } _mod_.check_config() { + _mod_.set_run_cli_efde if ! common.tasks.file.exists "$CONFIG_PATH_FILE"; then _mod_.create_config fi _mod_.load_config - - _mod_.set_run_cli_efde } _mod_.create_config() { common.tasks.message.info "Your first time with EFDE?" common.tasks.message.info "We will create the basic configurations" _mod_.set_config + + + if [ "${GLOBAL_EFDE_CONFIG['LANGUAGE_DEFAULT']}" != "$(efde.tasks.config.get_var "EFDE_LANGUAGE")" ]; then + common.core.generate_transactions + common.tasks.message.info "The translation configuration has been applied, we need to restart EFDE" + common.tasks.message.success "Run on your console \n$ $GLOBAL_RUN_EFDE" + exit # Reload for translations + fi } _mod_.set_config(){ @@ -102,15 +109,19 @@ _mod_.set_config_version() { } _mod_.load_config() { - local EFDE_CONFIGS=( - "HOST_SO" "HOST_EDITOR_DEFAULT" - "CLI_DEFAULT" "CLI_SHOW_CLI" "CLI_SHOW_OUTPUT" - "EFDE_MODE_DEBUG" "EFDE_MODE_DEVELOP" - ) - - for KEY in "${EFDE_CONFIGS[@]}"; do + mapfile -t EFDE_CONFIG < <(grep -o '^[^=]\+' "$CONFIG_PATH_FILE") + for KEY in "${EFDE_CONFIG[@]}"; do GLOBAL_EFDE_CONFIG["$KEY"]=$(_mod_.get_var "$KEY") done + + if [[ "${GLOBAL_EFDE_CONFIG['EFDE_MODE_DEBUG']}" = "true" ]]; then + common.tasks.message.debug "#######################################################################" + common.tasks.message.debug "# LOAD CONFIG " + common.tasks.message.debug "-----------------------------------------------------------------------" + for clave in "${!GLOBAL_EFDE_CONFIG[@]}"; do + common.tasks.message.tree "$clave: ${GLOBAL_EFDE_CONFIG[$clave]}" 1 0 debug + done + fi } _mod_.get_var(){ diff --git a/console/efde/tasks/implemention b/console/efde/tasks/implemention index 59042ed..d274aa2 100644 --- a/console/efde/tasks/implemention +++ b/console/efde/tasks/implemention @@ -86,7 +86,7 @@ _mod_.project_name(){ if ! [[ "$value" =~ ^[[:alnum:][:space:]]+$ ]]; then common.tasks.message.danger "The entered value can only contain letters or numbers." - common.tasks.message.info "Cancel to [ctrl + c] " + common.tasks.message.info "Cancel to [ctrl + c]" _mod_.project_name fi diff --git a/console/efde/tasks/main b/console/efde/tasks/main index 4c78e4d..461b721 100644 --- a/console/efde/tasks/main +++ b/console/efde/tasks/main @@ -7,9 +7,9 @@ set -euo pipefail } _mod_.coming_soon(){ - common.tasks.message.warning "We're excited about the upcoming release!" + common.tasks.message.warning "We are excited about the upcoming release!" common.tasks.message.warning "Our team is hard at work to bring you the latest features and improvements." - common.tasks.message.warning "Stay tuned for updates and follow the project's progress on $URL_REPOSITORY." + common.tasks.message.warning "Stay tuned for updates and follow the projects progress on $URL_REPOSITORY." common.tasks.message.warning "Thank you for your patience, and remember to check back for the latest developments." } diff --git a/console/implemention/laravel/i18n/es_ES b/console/implemention/laravel/i18n/es_ES new file mode 100644 index 0000000..4b65c26 --- /dev/null +++ b/console/implemention/laravel/i18n/es_ES @@ -0,0 +1,19 @@ +"Select an option","Seleccione una opción" +"Settings established in the project","Establecer configuraciones del proyecto" +"Dockerization management in the project","Gestionar dockerizacion en el proyecto" +"Apply permissions","Aplicar permisos" +"Database Manager","Gestión de base de datos" +"Use latest version available","Usar ultima versión" +"Clone from","Clonar desde" +"See versions compatibility","Ver compatibilidad de versiones" +"This version works from PHP","Esta versión funciona desde PHP" +"Enter the url of your repository","Ingresar la url de su repositorio" +"Enter URL (https):","Ingresar URL (https):" +"Project installed successfully, check the url","Proyecto instalado correctamente, verifique la URL" +"Write the command or press ENTER to search","Escriba el comando o presione ENTER para buscar" +"Do you want to run another command?","¿Quieres ejecutar otro comando?" +"Write the value to search or press ENTER for the full list","Escriba el valor a buscar o presione ENTER para ver la lista completa" +"Find another value or ENTER:","Busque otro valor o ENTRAR:" +"This runs","Esto ejecuta" + + diff --git a/console/implemention/laravel/i18n/pt_PT b/console/implemention/laravel/i18n/pt_PT new file mode 100644 index 0000000..acd30ee --- /dev/null +++ b/console/implemention/laravel/i18n/pt_PT @@ -0,0 +1,19 @@ +"Select an option","Selecione uma opção" +"Settings established in the project","Configurações estabelecidas no projeto" +"Dockerization management in the project","Gestão de dockerização no projeto" +"Apply permissions","Aplicar permissões" +"Database Manager","Gerenciador de banco de dados" +"Use latest version available","Usar a versão mais recente disponível" +"Clone from","Clonar de" +"See versions compatibility","Ver compatibilidade de versões" +"This version works from PHP","Esta versão funciona a partir do PHP" +"Enter the url of your repository","Digite a URL do seu repositório" +"Enter URL (https):","Digite a URL (https):" +"Project installed successfully, check the url","Projeto instalado com sucesso, verifique a URL" +"Write the command or press ENTER to search","Digite o comando ou pressione ENTER para pesquisar" +"Do you want to run another command?","Deseja executar outro comando?" +"Write the value to search or press ENTER for the full list","Digite o valor a ser pesquisado ou pressione ENTER para ver a lista completa" +"Find another value or ENTER:","Encontre outro valor ou ENTER:" +"This runs","Isso executa" + + diff --git a/console/implemention/symfony/i18n/es_ES b/console/implemention/symfony/i18n/es_ES new file mode 100644 index 0000000..c4355cb --- /dev/null +++ b/console/implemention/symfony/i18n/es_ES @@ -0,0 +1,21 @@ +"Select an option","Seleccione una opción" +"Settings established in the project","Establecer configuraciones del proyecto" +"Dockerization management in the project","Gestionar dockerizacion en el proyecto" +"Apply permissions","Aplicar permisos" +"Database Manager","Gestión de base de datos" +"Use latest version available","Usar ultima versión" +"Clone from","Clonar desde" +"See versions compatibility","Ver compatibilidad de versiones" +"This version works from PHP","Esta versión funciona desde PHP" +"Default will install symfony for microservice projects or apis","De forma predeterminada se instalará Symfony para proyectos de microservicios o API." +"Do you want to install the packages for webapp?","¿Quieres instalar los paquetes para la aplicación web?" +"Enter the url of your repository","Ingresar la url de su repositorio" +"Enter URL (https):","Ingresar URL (https):" +"Project installed successfully, check the url","Proyecto instalado correctamente, verifique la URL" +"Write the command or press ENTER to search","Escriba el comando o presione ENTER para buscar" +"Do you want to run another command?","¿Quieres ejecutar otro comando?" +"Write the value to search or press ENTER for the full list","Escriba el valor a buscar o presione ENTER para ver la lista completa" +"Find another value or ENTER:","Busque otro valor o ENTRAR:" +"This runs","Esto ejecuta" + + diff --git a/console/implemention/symfony/i18n/pt_PT b/console/implemention/symfony/i18n/pt_PT new file mode 100644 index 0000000..4aff1eb --- /dev/null +++ b/console/implemention/symfony/i18n/pt_PT @@ -0,0 +1,20 @@ +"Select an option","Selecione uma opção" +"Settings established in the project","Configurações estabelecidas no projeto" +"Dockerization management in the project","Gestão de dockerização no projeto" +"Apply permissions","Aplicar permissões" +"Database Manager","Gerenciador de banco de dados" +"Use latest version available","Usar a versão mais recente disponível" +"Clone from","Clonar de" +"See versions compatibility","Ver compatibilidade de versões" +"This version works from PHP","Esta versão funciona a partir do PHP" +"Default will install symfony for microservice projects or apis","Por padrão, o Symfony será instalado para projetos de microsserviços ou APIs." +"Do you want to install the packages for webapp?","Você deseja instalar os pacotes para a aplicação web?" +"Enter the url of your repository","Digite a URL do seu repositório" +"Enter URL (https):","Digite a URL (https):" +"Project installed successfully, check the url","Projeto instalado com sucesso, verifique a URL" +"Write the command or press ENTER to search","Digite o comando ou pressione ENTER para pesquisar" +"Do you want to run another command?","Deseja executar outro comando?" +"Write the value to search or press ENTER for the full list","Digite o valor a ser pesquisado ou pressione ENTER para ver a lista completa" +"Find another value or ENTER:","Encontre outro valor ou ENTER:" +"This runs","Isso executa" + diff --git a/console/implemention/wordpress/i18n/es_ES b/console/implemention/wordpress/i18n/es_ES new file mode 100644 index 0000000..45b8602 --- /dev/null +++ b/console/implemention/wordpress/i18n/es_ES @@ -0,0 +1,18 @@ +"Select an option","Seleccione una opción" +"Settings established in the project","Establecer configuraciones del proyecto" +"command line","linea de comandos" +"Dockerization management in the project","Gestionar dockerizacion en el proyecto" +"Apply permissions","Aplicar permisos" +"Database Manager","Gestión de base de datos" +"Use latest version available","Usar ultima versión" +"Clone from","Clonar desde" +"See versions compatibility","Ver compatibilidad de versiones" +"Coming Soon","Proximamente" +"Enter the url of your repository","Ingresar la url de su repositorio" +"Enter URL (https):","Ingresar URL (https):" +"Project installed successfully, check the url","Proyecto instalado correctamente, verifique la URL" +"Write the command or press ENTER to search","Escriba el comando o presione ENTER para buscar" +"Do you want to run another command?","¿Quieres ejecutar otro comando?" +"Write the value to search or press ENTER for the full list","Escriba el valor a buscar o presione ENTER para ver la lista completa" +"Find another value or ENTER:","Busque otro valor o ENTRAR:" +"This runs","Esto ejecuta" \ No newline at end of file diff --git a/console/implemention/wordpress/i18n/pt_PT b/console/implemention/wordpress/i18n/pt_PT new file mode 100644 index 0000000..ad5e0a1 --- /dev/null +++ b/console/implemention/wordpress/i18n/pt_PT @@ -0,0 +1,18 @@ +"Select an option","Selecione uma opção" +"Settings established in the project","Configurações estabelecidas no projeto" +"command line","linha de comando" +"Dockerization management in the project","Gestão de dockerização no projeto" +"Apply permissions","Aplicar permissões" +"Database Manager","Gerenciador de banco de dados" +"Use latest version available","Usar a versão mais recente disponível" +"Clone from","Clonar de" +"See versions compatibility","Ver compatibilidade de versões" +"Coming Soon","Em breve" +"Enter the url of your repository","Digite a URL do seu repositório" +"Enter URL (https):","Digite a URL (https):" +"Project installed successfully, check the url","Projeto instalado com sucesso, verifique a URL" +"Write the command or press ENTER to search","Digite o comando ou pressione ENTER para pesquisar" +"Do you want to run another command?","Deseja executar outro comando?" +"Write the value to search or press ENTER for the full list","Digite o valor a ser pesquisado ou pressione ENTER para ver a lista completa" +"Find another value or ENTER:","Encontre outro valor ou ENTER:" +"This runs","Isso executa" \ No newline at end of file diff --git a/console/init b/console/init index 18e68cb..c63e11f 100644 --- a/console/init +++ b/console/init @@ -3,7 +3,7 @@ set -euo pipefail DIRECTORY_TMP="$PATH_BIN/.tmp" -create_folder_tmp() { +create_folder_tmp(){ [[ "${GLOBAL_EFDE_CONFIG['EFDE_MODE_DEVELOP']}" = "true" ]] && rm -rf $DIRECTORY_TMP [ ! -d $DIRECTORY_TMP ] && mkdir -p $DIRECTORY_TMP; chmod +x $DIRECTORY_TMP @@ -14,10 +14,10 @@ create_construct(){ MODULE_NAME="common" IMPORT_FILE="core" PATH_SOURCE="$PATH_CONSOLE/$MODULE_NAME/$IMPORT_FILE" - PATH_TARGET="$DIRECTORY_TMP/$IMPORT_FILE" + PATH_TARGET="$DIRECTORY_TMP/$MODULE_NAME.$IMPORT_FILE" if [ "${GLOBAL_EFDE_CONFIG['EFDE_MODE_DEVELOP']}" = "true" ] || [ ! -f "$PATH_TARGET" ]; then - sed "/sed/! s/_mod_/$MODULE_NAME/g" "$PATH_SOURCE" > "$PATH_TARGET" + sed "/sed/! s/_mod_/$MODULE_NAME.$IMPORT_FILE/g" "$PATH_SOURCE" > "$PATH_TARGET" fi load_scripts "$PATH_TARGET" @@ -41,7 +41,7 @@ load_modules(){ } load_scripts(){ - local FUNCTION_LOAD="common.load_module" + local FUNCTION_LOAD="common.core.load_module" if [ "$(type -t "$FUNCTION_LOAD")" = "function" ] ; then ${FUNCTION_LOAD} "$@" else @@ -53,7 +53,6 @@ main() { create_folder_tmp create_construct load_modules $PATH_CONSOLE - common.generate_shortcuts_file } main diff --git a/console/service/docker/i18n/es_ES b/console/service/docker/i18n/es_ES new file mode 100644 index 0000000..b961c01 --- /dev/null +++ b/console/service/docker/i18n/es_ES @@ -0,0 +1,26 @@ +"Select an option","Seleccione una opción" +"Build or Re-Build the project containers","Construir o reconstruir los contenedores del proyecto" +"Show (start) containers of project","Mostrar (iniciar) contenedores del proyecto" +"Start containers of project","Iniciar contenedores del proyecto" +"Stop containers of project","Detener contenedores del proyecto" +"Inspect environment logs","Inspeccionar logs del ambiente" +"Enter the indicated container","Ingresar al contenedor" +"Run command in container. Example: bash, cp, rm","Ejecute el comando en el contenedor. Ejemplo: bash, cp, rm" +"Stops all containers running on the computer","Detiene todos los contenedores que se ejecutan en el ordenador" +"Apache2 stop service","Detiene servicio de apache2" +"Destroy all project containers and networks","Destruye todos los contenedores y redes del proyecto" +"See recipe docker-compose.yml","Ver receta docker-compose.yml" +"There are no containers running at this time","No hay contenedores en ejecución en este momento" +"APACHE2 is ON, do you want to turn it OFF?","APACHE2 está activado, ¿quieres desactivarlo?" +"Do you want to remove services from the project?","¿Quieres eliminar servicios del proyecto?" +"Enter value to search or press ENTER for show all","Ingrese el valor para buscar o presione ENTER para ver todos" +"Find another value or ENTER","Busca otro valor o ENTER" +"Log monitor","Monitor de log" +"Enter service name:","Ingresar el nombre del servicio" +"You want to open a new instance? RUN=Y or EXEC=N","¿Quieres abrir una nueva instancia? RUN=Y o EXEC=N" +"What command do you want to run?","¿Que comando deseas ejecutar?" +"Do you want to run another command?","¿Quieres ejecutar otro comando?" + + + + diff --git a/console/service/docker/i18n/pt_PT b/console/service/docker/i18n/pt_PT new file mode 100644 index 0000000..e3ac2c8 --- /dev/null +++ b/console/service/docker/i18n/pt_PT @@ -0,0 +1,25 @@ +"Select an option","Selecione uma opção" +"Build or Re-Build the project containers","Construir ou reconstruir os contêineres do projeto" +"Show (start) containers of project","Mostrar (iniciar) contêineres do projeto" +"Start containers of project","Iniciar contêineres do projeto" +"Stop containers of project","Parar contêineres do projeto" +"Inspect environment logs","Inspeccionar logs do ambiente" +"Enter the indicated container","Entrar no contêiner indicado" +"Run command in container. Example: bash, cp, rm","Executar comando no contêiner. Exemplo: bash, cp, rm" +"Stops all containers running on the computer","Para todos os contêineres em execução no computador" +"Apache2 stop service","Parar serviço Apache2" +"Destroy all project containers and networks","Destruir todos os contêineres e redes do projeto" +"See recipe docker-compose.yml","Ver receita docker-compose.yml" +"There are no containers running at this time","Não há contêineres em execução no momento" +"APACHE2 is ON, do you want to turn it OFF?","APACHE2 está ATIVO, deseja DESATIVÁ-LO?" +"Do you want to remove services from the project?","Deseja remover os serviços do projeto?" +"Enter value to search or press ENTER for show all","Digite o valor para buscar ou pressione ENTER para mostrar tudo" +"Find another value or ENTER","Encontre outro valor ou ENTER" +"Log monitor","Monitor de logs" +"Enter service name:","Digite o nome do serviço:" +"You want to open a new instance? RUN=Y or EXEC=N","Deseja abrir uma nova instância? EXEC=N ou EXEC=N" +"What command do you want to run?","Qual comando deseja executar?" +"Do you want to run another command?","Deseja executar outro comando?" + + + diff --git a/console/service/docker/tasks/main b/console/service/docker/tasks/main index e40a888..73240fd 100644 --- a/console/service/docker/tasks/main +++ b/console/service/docker/tasks/main @@ -61,7 +61,7 @@ _mod_.dp_logs(){ COMMAND_RUN="${GLOBAL_DOCKER_COMPOSE_COMMAND} logs -f" VALUES="" MSG=( - [MAIN]=$(common.tasks.message.msg_color warning 'Enter value to search or press ENTER for all:') + [MAIN]=$(common.tasks.message.msg_color warning 'Enter value to search or press ENTER for show all:') [NEXT]=$(common.tasks.message.msg_color warning 'Find another value or ENTER:') ) diff --git a/console/service/mysql/i18n/es_ES b/console/service/mysql/i18n/es_ES new file mode 100644 index 0000000..7a28775 --- /dev/null +++ b/console/service/mysql/i18n/es_ES @@ -0,0 +1,19 @@ +"Select an option","Seleccione una opción" +"Show values in ./.env file","Ver valores del archivo ./.env" +"Run custom query on your database","Ejecutar query personalizada en database" +"Export Database in ./dumps","Exportar Database en ./dumps" +"Import Database from ./dumps","Importar Database desde ./dumps" +"Apply DATABASE:USER privileges","Aplicar privilegios DATABASE:USER" +"Run command in database container","Ejecutar comandos en contenedor de database" +"MYSQL AND PHPMYADMIN Variables","Variables MYSQL y PHPADMIN" +"Do you want to set variables for DATABASE","Quieres configurar las variable para DATABASE" +"Enter value for variable [VALUE]","Ingrese un valor para la variable [VALUE]" +"You must enter a value greater than 4 characters","Debes ingresar un valor mayor a 4 caracteres" +"Enter query example: show tables\nPress ENTER or Q to exit","Ingresar consulta ejemplo: show tables\nPress ENTER or Q to exit" +"The database was exported","La base fue exportada" +"Directory not found","El directorio no existe" +"No files with .sql extension were found","Archivos con extension .sql no encontrados" +"Confirm this action by writing","Confirmar esta accion escribiendo" +"We are about to delete the directory","Estamos a punto de eliminar el directorio" +"Aborted action","Operacion abortada" +"The privileges will be applied with the following data","Los privilegios se aplicarán con los siguientes datos" \ No newline at end of file diff --git a/console/service/mysql/i18n/pt_PT b/console/service/mysql/i18n/pt_PT new file mode 100644 index 0000000..6fc36e8 --- /dev/null +++ b/console/service/mysql/i18n/pt_PT @@ -0,0 +1,19 @@ +"Select an option","Selecione uma opção" +"Show values in ./.env file","Mostrar valores no arquivo ./.env" +"Run custom query on your database","Executar consulta personalizada no seu banco de dados" +"Export Database in ./dumps","Exportar banco de dados em ./dumps" +"Import Database from ./dumps","Importar banco de dados de ./dumps" +"Apply DATABASE:USER privileges","Aplicar privilégios DATABASE:USER" +"Run command in database container","Executar comando no contêiner do banco de dados" +"MYSQL AND PHPMYADMIN Variables","Variáveis MYSQL e PHPADMIN" +"Do you want to set variables for DATABASE","Você quer definir variáveis para o BANCO DE DADOS" +"Enter value for variable [VALUE]","Digite um valor para a variável [VALUE]" +"You must enter a value greater than 4 characters","Você deve inserir um valor maior que 4 caracteres" +"Enter query example: show tables\nPress ENTER or Q to exit","Digite um exemplo de consulta: show tables\nPressione ENTER ou Q para sair" +"The database was exported","O banco de dados foi exportado" +"Directory not found","Diretório não encontrado" +"No files with .sql extension were found","Nenhum arquivo com extensão .sql foi encontrado" +"Confirm this action by writing","Confirme esta ação escrevendo" +"We are about to delete the directory","Estamos prestes a excluir o diretório" +"Aborted action","Ação abortada" +"The privileges will be applied with the following data","Os privilégios serão aplicados com os seguintes dados" \ No newline at end of file diff --git a/console/service/mysql/props/menu b/console/service/mysql/props/menu index e18b0fc..c863a61 100644 --- a/console/service/mysql/props/menu +++ b/console/service/mysql/props/menu @@ -12,6 +12,6 @@ "mysql:db:import, $PATH_MENU.database_import, Import database, Import Database from ./dumps" "mysql:db:permissions, $PATH_MENU.permissions, Apply privileges, Apply DATABASE:USER privileges" "mysql:container, $PATH_MENU.container_entry, Entry container," - "mysql:run:script, docker.tasks.menu.command, Run command line, Run command in 'database' container" + "mysql:run:script, docker.tasks.menu.command, Run command line, Run command in database container" ) } diff --git a/console/service/mysql/tasks/main b/console/service/mysql/tasks/main index af889e3..e540e3c 100644 --- a/console/service/mysql/tasks/main +++ b/console/service/mysql/tasks/main @@ -12,7 +12,7 @@ set -euo pipefail local KEYS=("MYSQL_ROOT_PASSWORD" "MYSQL_USER" "MYSQL_PASSWORD" "MYSQL_DATABASE") common.tasks.message.info "\n${MESSAGES['INTRO']}" - if common.tasks.prompt.confirm_default_yes "${MESSAGES['DEFAULT']}" ; then + if ! common.tasks.prompt.confirm_default_no "${MESSAGES['DEFAULT']}" ; then GLOBAL_SETUP_IMPLEMENTION['MYSQL_ROOT_PASSWORD']=toor GLOBAL_SETUP_IMPLEMENTION['MYSQL_USER']=efdeuser GLOBAL_SETUP_IMPLEMENTION['MYSQL_PASSWORD']=efdepassword diff --git a/docs/developer.md b/docs/developer.md index 3d67e20..7a2c846 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -85,3 +85,14 @@ If you want to add a new feature you must keep the following rules in mind - Determines whether the launch directory in the `efde` command console has a project created by it or not (search for `$PATH/.efde/`) - Is TRUE, loads the implementation menu according to what is established in the `$PATH/.efde/.env` file variable `EFDE_PROJECT_IMPLEMENTION` - Is FALSE, load the default menu to configure `efde` or install implementations + +## Translations +- Translations must be incorporated into each implementation with the **i18n** directory +- The languages available so far are + - en_US (Default) + - es_ES + - pt_PT +- They must follow the following pattern ``` +"text_en_us","text_translations"``` +- Considerations + - You cannot use characters like ```\ \"``` \ No newline at end of file diff --git a/i18n/en_US b/i18n/en_US deleted file mode 100644 index e69de29..0000000 diff --git a/i18n/es_ES b/i18n/es_ES deleted file mode 100644 index e69de29..0000000