From c68dafda4fad60cca25f5ec006524d9b297e2108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Wed, 14 Feb 2024 11:35:47 +0100 Subject: [PATCH] qsgen2: Updated function _msg to enable localization. en_US, es_ES and nb_NO available. --- include/qsgen2/lang/en_US | 220 ++++++++++++++++++++------------------ include/qsgen2/lang/es_ES | 180 +++++++++++++++++++------------ include/qsgen2/lang/nb_NO | 178 +++++++++++++++++++----------- qsgen2 | 69 +++++++----- 4 files changed, 379 insertions(+), 268 deletions(-) diff --git a/include/qsgen2/lang/en_US b/include/qsgen2/lang/en_US index 7728841..363ad4e 100644 --- a/include/qsgen2/lang/en_US +++ b/include/qsgen2/lang/en_US @@ -1,106 +1,114 @@ - # Usage: _msg "" - _msg info "Usage: qsgen2 add \"Site Name\" \"/path/to/project\"" - _msg sub "- Forced Update: Generating Everything" - _msg debug "* ${0:t} cannot parse this site. Exiting. *" - _msg other "Please install Pandoc." - _msg other "https://github.com/jgm/pandoc/releases" - _msg debug "No valid generator found. Are you sure you've selected the correct generator in 'config'?" -if (${globaldebug}); then _msg debug "Using the ${generator} engine for files: ${file_ext}"; fi - if ${debug}; then _msg debug "_list_pages: No Pages found with ext ${file_ext}."; fi - if ${debug}; then _msg debug "_list_pages: Adding file to array: ${file}"; fi - if ${debug}; then _msg debug "_list_blogs: No blog files found."; fi - if ${debug}; then _msg debug "_list_blogs: Adding file to array: $file"; fi - if (${debug}) _msg debug "_blog_cache: HASH VALUE: ${blog_cache[${name}]}" - if (${debug}) _msg debug "1. _blog_cache: ${blog_file}" - if (${debug}) _msg debug "2. _blog_cache: current_cache: ${current_hash}" - if (${debug}) _msg debug "3. _blog_cache: new_cache_file: ${blog_file}$" - if (${debug}) _msg debug "4. _blog_cache: new_current_cache: ${current_hash}" - if (${debug}) _msg debug "PAGES HASH VALUE: ${pages_cache[${name}]}" - if (${debug}) _msg debug "1. pages_cache: ${pages_cache[$file]}" - if (${debug}) _msg debug "1. _pages_cache: current_cache: ${current_hash}" - if (${debug}) _msg debug "2. _pages_cache: pages_file: ${pages_cache[$file]}" - if (${debug}) _msg debug "2. _pages_cache: current_cache: ${current_hash}" - if (${debug}); then _msg debug "_last_updated: Setting date and version in footer"; fi - if (${debug}); then _msg debug "_last_updated: ${upd_msg}"; fi - local upd_msg="Last updated ${today} by ${QSGEN} ${VERSION}" - -e "s|#updated|${upd_msg}|") - if (${debug}); then _msg debug "_f_last_updated: Setting date and version in footer of file ${1}"; fi - if (${debug}); then _msg debug "_f_last_updated: ${upd_msg}"; fi - local upd_msg="Last updated ${today} by ${QSGEN} ${VERSION}" - -e "s|#updated|${upd_msg}|" \ - if (${debug}) _msg debug "_pages: Running function _pages_cache" - _msg sub "* You do not have any pages *" - _msg main "Generating Pages" - if (${debug}) _msg debug "_pages: pages_array is not empty" - if (${debug}) _msg debug "_pages: Setting Pages template" - _msg info "Unable to find the Pages template: ${pages}" - if (${debug}) _msg debug "_pages: Reading Pages template into pages_tpl" - _msg std "- Generating Page: ${pages_in_array%.*}.html" - if (${debug}) _msg debug "_pages: Loading page_content once - ${pages_in_array}" - if (${debug}) _msg debug "_pages: Grepping for page_title" - if (${debug}) _msg debug "_pages: ${page_title}" - if (${debug}) _msg debug "_pages: Removing #title line from page_content" - if (${debug}) _msg debug "_pages: Running engine on ${pages_in_array}" - if (${debug}) _msg debug "_pages: Checking for #link, #showimg and #ytvideo in page_content" - if (${debug}) _msg debug "_pages: #link is present, run _link: page_content" - if (${debug}) _msg debug "_pages: #showimg is present, run _image: page_content" - if (${debug}) _msg debug "_pages: #ytvideo is present, run _youtube: page_content" - if (${debug}) _msg debug "_pages: Replacing BODY with page_content in pages_tpl" - if (${debug}) _msg debug "_pages: Replacing #pagetitle, #tagline and #sitename in pages_tpl" - if (${debug}) _msg debug "_pages: _last_updated in pages_tpl" - if (${debug}) _msg debug "_pages: Lowercase filnames, always" - if (${debug}) _msg debug "_pages: Running _cleanup" - # _msg std "Writing ${www_root}/${pages_title_lower%.*}.html to disk." - if (${debug}) _msg sub "- Parsing ${pages_in_array}" - if (${debug}) _msg sub "- blog_in_index = ${blog_in_index}" - if (${debug}) _msg sub "- Listing blog temp file:" - _msg std "Updating index.html with new blog posts" - if (${debug}) _msg sub "- Parsing ${pages_in_array}" - if (${debug}) _msg sub "- blog_in_index = ${blog_in_index}" - if (${debug}) _msg sub "- Listing blog temp file:" - _msg sub "- No new or updated Pages found" - if (${debug}) _msg debug "_blogs: Running function _list_blogs" - _msg sub "* You do not have any blogs *" - _msg main "Generating Blogs" - if (${debug}) _msg debug "_blogs: Running function _blog_cache" - _msg info "Unable to find theme template for Blogs." - if (${debug}) _msg debug "_blogs: Processing pre-data for ${blog}" - _msg debug "_blogs: DATE metadata missing in ${blog}." - if (${debug}) _msg debug "_blogs: Adding data for ${blog} to array to export" - if (${debug}) _msg debug "_blogs: Processing ${blog}" - _msg std "- Generating Blog: ${blog_index}.html" - if (${debug}) _msg debug "_blogs: Processing substitutes in ${blog}" - if (${debug}) _msg debug "_blogs: Running function $engine for ${blog}" - if (${debug}) _msg debug "_blogs: Checking for #link, #showimg and #ytvideo in blog_content" - if (${debug}) _msg debug "_blogs: #link is present, run _link: blog_content" - if (${debug}) _msg debug "_blogs: #showimg is present, run _link: blog_content" - if (${debug}) _msg debug "_blogs: #ytvideo is present, run _link: blog_content" - if (${debug}) _msg debug "_blogs: Replacing tagline, sitename and pagetitle" - if (${debug}) _msg debug "_blogs: Creating directoty ${www_root}/${blog_dir}" - if (${debug}) _msg debug "_blogs: Writing blog to disk: ${www_root}${blog_url}" - _msg sub "- No new or updated Blogs found" - if (${debug}) _msg sub "* _blogs: Running _blog_idx_for_index" - if (${debug}) _msg sub "* _blogs: Running _blog_index" - _msg sub "- Populating ${project_dir}/blog/index.tmp.html" - if (${debug}) _msg debug "_blog_idx_for_index: Initiating function" - if (${debug}) _msg debug "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" - if (${debug}) _msg debug "_blog_idx_for_index: meta_str from BLOG_META_STR_ARRAY from _blogs" - if (${debug}) _msg debug "_blog_idx_for_index: ${meta_str}" - if (${debug}) _msg debug "_blog_idx_for_index: Iterate over each component and extract information" - if (${debug}) _msg debug "_blog_idx_for_index: Running ${engine} on content to catch QStags in Ingress" - if (${debug}) _msg debug "_blog_idx_for_index: Writing _blog_idx_for_index to file: ${project_dir}/blog/index.tmp.html" - if (${debug}) _msg debug "_blog_idx_for_index: blog_list_content = ${blog_list_content}" - if (${debug}) _msg debug "Running function _blog_index" - if (${debug}) _msg debug "_blog_index: blog_in_index = ${blog_in_index}" - _msg std "- Generating the Blog index file" - if (${debug}) _msg debug "_add_blog_list_to_index: Inserting blog list to index.html" - _msg main "Generating Sitemap" - if (${debug}); then _msg debug "Sitemap generated at ${sitemap_file}"; fi - if (${debug}) _msg debug "_link: URL_MAIN(line): ${line}" - if (${debug}) _msg debug "_link_ URL: ${url_dest}" - if (${debug}) _msg debug "_link: Text: ${url_txt}" - if (${debug}) _msg debug "_image: Processing line: ${line}" - if (${debug}) _msg debug "_youtube: Processing line: ${line}" - if (${debug}) _msg debug "_cleanup: Cleaning up tags in content" - _msg debug "_html: Converting QStags in content" - _msg debug "_html: Converting QStags in content" +typeset -A localization +localization=( +_msg_msg_1 "Usage: qsgen2 add \\"Site Name\\" \\"/path/to/project\\"" +_msg_msg_2 "- Forced Update: Generating Everything" +_msg_msg_3 "* %SCRIPT_NAME% cannot parse this site. Exiting. *" +_msg_msg_4 "Please install Pandoc." +_msg_msg_5 "https://github.com/jgm/pandoc/releases" +_msg_msg_6 "No valid generator found. Are you sure you\'ve selected the correct generator in \'config\'?" +_msg_msg_7 "Using the ${generator} engine for files: ${file_ext}" +_list_pages_msg_1 "_list_pages: No Pages found with ext ${file_ext}." +_list_pages_msg_2 "_list_pages: Adding file to array: ${file}" +_list_blogs_msg_3 "_list_blogs: No blog files found." +_list_blogs_msg_4 "_list_blogs: Adding file to array: $file" +_blog_cache_msg_1 "_blog_cache: HASH VALUE: ${blog_cache[${name}]}" +_blog_cache_msg_2 "1. _blog_cache: ${blog_file}" +_blog_cache_msg_3 "2. _blog_cache: current_cache: ${current_hash}" +_blog_cache_msg_4 "3. _blog_cache: new_cache_file: ${blog_file}$" +_blog_cache_msg_5 "4. _blog_cache: new_current_cache: ${current_hash}" +_pages_cache_msg_1 "PAGES HASH VALUE: ${pages_cache[${name}]}" +_pages_cache_msg_2 "1. pages_cache: ${pages_cache[$file]}" +_pages_cache_msg_3 "1. _pages_cache: current_cache: ${current_hash}" +_pages_cache_msg_4 "2. _pages_cache: pages_file: ${pages_cache[$file]}" +_pages_cache_msg_5 "2. _pages_cache: current_cache: ${current_hash}" +_last_updated_msg_1 "_last_updated: Setting date and version in footer" +_last_updated_msg_1 "_last_updated: ${upd_msg}" +_f_last_updated_msg_1 "_f_last_updated: Setting date and version in footer of file ${1}" +_f_last_updated_msg_2 "_f_last_updated: ${upd_msg}" +_f_last_updated_msg_3 "_f_last_updated: File \'${1}\' not found." +_pages_msg_1 "_pages: Running function _pages_cache" +_pages_msg_2 "* You do not have any pages *" +_pages_msg_3 "Generating Pages" +_pages_msg_4 "_pages: pages_array is not empty" +_pages_msg_5 "_pages: Setting Pages template" +_pages_msg_6 "Unable to find the Pages template: ${pages}" +_pages_msg_7 "_pages: Reading Pages template into pages_tpl" +_pages_msg_8 "- Generating Page: ${pages_in_array%.*}.html" +_pages_msg_9 "_pages: Loading page_content once - ${pages_in_array}" +_pages_msg_10 "_pages: Finding page_title" +_pages_msg_11 "_pages: ${page_title}" +_pages_msg_12 "_pages: Removing #title line from page_content" +_pages_msg_13 "_pages: Running engine on ${pages_in_array}" +_pages_msg_14 "_pages: Checking for #link, #showimg and #ytvideo in page_content" +_pages_msg_15 "_pages: #link is present, run _link: page_content" +_pages_msg_16 "_pages: #showimg is present, run _image: page_content" +_pages_msg_17 "_pages: #ytvideo is present, run _youtube: page_content" +_pages_msg_18 "_pages: Replacing #pagetitle, #tagline and #sitename in pages_tpl" +_pages_msg_19 "_pages: Replacing BODY with page_content in pages_tpl" +_pages_msg_20 "_pages: _last_updated in pages_tpl" +_pages_msg_21 "_pages: Lowercase filnames, always" +_pages_msg_22 "_pages: Running _cleanup" +_pages_msg_23 "- Parsing ${pages_in_array}" +_pages_msg_24 "- blog_in_index = ${blog_in_index}" +_pages_msg_25 "- Listing blog temp file:" +_pages_msg_26 "Updating index.html with new blog posts" +_pages_msg_27 "- Parsing ${pages_in_array}" +_pages_msg_28 "- blog_in_index = ${blog_in_index}" +_pages_msg_29 "- Listing blog temp file:" +_pages_msg_30 "- No new or updated Pages found" +_blogs_msg_1 "_blogs: Running function _list_blogs" +_blogs_msg_2 "* You do not have any blogs *" +_blogs_msg_3 "Generating Blogs" +_blogs_msg_4 "_blogs: Running function _blog_cache" +_blogs_msg_5 "Unable to find theme template for Blogs." +_blogs_msg_6 "_blogs: Processing pre-data for ${blog}" +_blogs_msg_7 "_blogs: Looking for DATE: Found" +_blogs_msg_8 "_blogs: Looking for BLOG_TITLE: Found" +_blogs_msg_9 "* _blogs: DATE metadata missing in ${blog}." +_blogs_msg_10 "* _blogs: BLOG_TITLE metadata missing in ${blog}." +_blogs_msg_11 "_blogs: Adding data for ${blog} to array to export" +_blogs_msg_12 "_blogs: Processing ${blog}" +_blogs_msg_13 "- Generating Blog: ${blog_index}.html" +_blogs_msg_14 "_blogs: Processing substitutes in ${blog}" +_blogs_msg_15 "_blogs: Running function $engine for ${blog}" +_blogs_msg_16 "_blogs: Checking for #link, #showimg and #ytvideo in blog_content" +_blogs_msg_17 "_blogs: #link is present, run _link: blog_content" +_blogs_msg_18 "_blogs: #showimg is present, run _link: blog_content" +_blogs_msg_19 "_blogs: #ytvideo is present, run _link: blog_content" +_blogs_msg_20 "_blogs: Replacing tagline, sitename and pagetitle" +_blogs_msg_21 "_blogs: Creating directory ${www_root}${blog_dir}" +_blogs_msg_22 "_blogs: Writing blog to disk: ${www_root}${blog_url}" +_blogs_msg_23 "_blogs: new_updated_blogs=true" +_blogs_msg_24 "- No new or updated Blogs found" +_blogs_msg_25 "* _blogs: Running _blog_idx_for_index" +_blogs_msg_26 "* _blogs: Running _blog_index" +_blog_idx_for_index_msg_1 "- Populating ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_2 "_blog_idx_for_index: Initiating function" +_blog_idx_for_index_msg_3 "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" +_blog_idx_for_index_msg_4 "_blog_idx_for_index: meta_str from BLOG_META_STR_ARRAY from _blogs" +_blog_idx_for_index_msg_5 "_blog_idx_for_index: ${meta_str}" +_blog_idx_for_index_msg_6 "_blog_idx_for_index: Iterate over each component and extract information" +_blog_idx_for_index_msg_7 "_blog_idx_for_index: Running ${engine} on content to catch QStags in Ingress" +_blog_idx_for_index_msg_8 "_blog_idx_for_index: Writing _blog_idx_for_index to file: ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_9 "_blog_idx_for_index: blog_list_content = ${blog_list_content}" +_blog_index_msg_1 "_blog_index: blog_in_index=${blog_in_index}" +_blog_index_msg_2 "_blog_index: new_updated_blogs=${new_updated_blogs}" +_blog_index_msg_3 "_blog_index: Running function _blog_index" +_blog_index_msg_4 "_blog_index: blog_in_index = ${blog_in_index}" +_blog_index_msg_5 "- Generating Page: ${www_root}/blog/index.html" +_blog_index_msg_6 "_blog_index: Replacing sitename and tagline" +_blog_index_msg_7 "_blog_index: Replacing BODY with content of ${project_dir}/blog/index.tmp.html" +_blog_index_msg_8 "_blog_index: Writing ${www_root}/blog/index.html" +_blog_index_msg_9 "_blog_index: Content length of blog_index_content: ${#blog_index_content}" +_add_blog_list_to_index_msg_1 "_add_blog_list_to_index: Inserting blog list to index.html" +_sitemap_msg_1 "Generating Sitemap" +_sitemap_msg_2 "Sitemap generated at ${sitemap_file}" +_link_msg_1 "_link: URL_MAIN(line): ${line}" +_link_msg_2 "_link_ URL: ${url_dest}" +_link_msg_3 "_link: Text: ${url_txt}" +_image_msg_1 "_image: Processing line: ${line}" +_youtube_msg_1 "_youtube: Processing line: ${line}" +_cleanup_msg_1 "_cleanup: Cleaning up tags in content" +_html_msg_1 "_html: Converting QStags in content" +_zhtml_msg_1 "_zhtml: Converting QStags in content" +) diff --git a/include/qsgen2/lang/es_ES b/include/qsgen2/lang/es_ES index 8303845..3fb8f00 100644 --- a/include/qsgen2/lang/es_ES +++ b/include/qsgen2/lang/es_ES @@ -1,68 +1,112 @@ - - -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Uso: _msg "" ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - - _msg info "Uso: qsgen2 add \"Nombre del Sitio\" \"/ruta/al/proyecto\"" - _msg sub "- Actualización Forzada: Generando Todo" - _msg debug "* ${0:t} no puede analizar este sitio. Saliendo. *" - _msg other "Por favor, instale Pandoc." - _msg other "https://github.com/jgm/pandoc/releases" - - - - -_msg debug "No se encontró ningún generador válido. ¿Estás seguro de haber seleccionado el generador correcto en 'config'?" -if (${globaldebug}); then _msg debug "Usando el motor ${generator} para archivos: ${file_ext}"; fi if ${debug}; then _msg -debug "_list_pages: No se encontraron páginas con extensión ${file_ext}."; fi if ${debug}; then _msg debug "_list_pages: -Agregando archivo al array: ${file}"; fi if ${debug}; then _msg debug "_list_blogs: No se encontraron archivos de blogs."; -fi if ${debug}; then _msg debug "_list_blogs: Agregando archivo al array: $file"; fi if (${debug}) _msg debug "_blog_cache: -VALOR HASH: ${blog_cache[${name}]}" if (${debug}) _msg debug "1. _blog_cache: ${blog_file}" if (${debug}) _msg debug "2. -_blog_cache: current_cache: ${current_hash}" if (${debug}) _msg debug "3. _blog_cache: new_cache_file: ${blog_file}$" if -(${debug}) _msg debug "4. _blog_cache: new_current_cache: ${current_hash}" if (${debug}) _msg debug "VALOR HASH DE PÁGINAS: -${pages_cache[${name}]}" if (${debug}) _msg debug "1. pages_cache: ${pages_cache[$file]}" if (${debug}) _msg debug "1. -_pages_cache: current_cache: ${current_hash}" if (${debug}) _msg debug "2. _pages_cache: pages_file: ${pages_cache[$file]}" -if (${debug}) _msg debug "2. _pages_cache: current_cache: ${current_hash}" if (${debug}); then _msg debug "_last_updated: -Estableciendo fecha y versión en el pie de página"; fi if (${debug}); then _msg debug "_last_updated: ${upd_msg}"; fi local -upd_msg="Última actualización ${today} por ${QSGEN} ${VERSION}" -e -"s|#updated|${upd_msg}|") if (${debug}); then _msg debug "_f_last_updated: Estableciendo fecha y versión en el pie de página -del archivo ${1}"; fi if (${debug}); then _msg debug "_f_last_updated: ${upd_msg}"; fi local upd_msg="Última actualización -${today} por ${QSGEN} ${VERSION}" -e "s|#updated|${upd_msg}|" -if (${debug}) _msg debug "_pages: Ejecutando función _pages_cache" _msg sub "* No tienes ninguna página " _msg main -"Generando Páginas" if (${debug}) _msg debug "_pages: pages_array no está vacío" if (${debug}) _msg debug "_pages: -Estableciendo plantilla de Páginas" _msg info "No se pudo encontrar la plantilla de Páginas: ${pages}" if (${debug}) _msg -debug "_pages: Leyendo plantilla de Páginas en pages_tpl" _msg std "- Generando Página: ${pages_in_array%.}.html" if -(${debug}) _msg debug "_pages: Cargando page_content una vez - ${pages_in_array}" if (${debug}) _msg debug "_pages: Buscando -page_title en page_content" if (${debug}) _msg debug "_pages: ${page_title}" if (${debug}) _msg debug "_pages: Eliminando -línea #title de page_content" if (${debug}) _msg debug "_pages: Ejecutando motor en ${pages_in_array}" if (${debug}) _msg -debug "_pages: Comprobando #link, #showimg y #ytvideo en page_content" if (${debug}) _msg debug "_pages: #link está -presente, ejecutar _link: page_content" if (${debug}) _msg debug "_pages: #showimg está presente, ejecutar _image: -page_content" if (${debug}) _msg debug "_pages: #ytvideo está presente, ejecutar _youtube: page_content" if (${debug}) _msg -debug "_pages: Reemplazando BODY con page_content en pages_tpl" if (${debug}) _msg debug "_pages: Reemplazando #pagetitle, -#tagline y #sitename en pages_tpl" if (${debug}) _msg debug "_pages: _last_updated en pages_tpl" if (${debug}) _msg debug -"_pages: Nombres de archivo en minúsculas, siempre" if (${debug}) _msg debug "_pages: Ejecutando _cleanup" # _msg std -"Escribiendo ${www_root}/${pages_title_lower%.}.html en el disco." if (${debug}) _msg sub "- Analizando ${pages_in_array}" -if (${debug}) _msg sub "- blog_in_index = ${blog_in_index}" if (${debug}) _msg sub "- Listando archivo temporal de blog:" -_msg std "Actualizando index.html con nuevas entradas de blog" if (${debug}) _msg sub "- Analizando ${pages_in_array}" if -(${debug}) _msg sub "- blog_in_index = ${blog_in_index}" if (${debug}) _msg sub "- Listando archivo temporal de blog:" _msg -sub "- No se encontraron Páginas nuevas o actualizadas" if (${debug}) _msg debug "_blogs: Ejecutando función _list_blogs" -_msg sub " No tienes ningún blog " _msg main "Generando Blogs" if (${debug}) _msg debug "_blogs: Ejecutando función -_blog_cache" _msg info "No se pudo encontrar la plantilla de tema para Blogs." if (${debug}) _msg debug "_blogs: Procesando -pre-datos para ${blog}" _msg debug "_blogs: Falta metadatos de FECHA en ${blog}." if (${debug}) _msg debug "_blogs: -Agregando datos para ${blog} al array para exportar" if (${debug}) _msg debug "_blogs: Procesando ${blog}" _msg std "- -Generando Blog: ${blog_index}.html" if (${debug}) _msg debug "_blogs: Procesando sustituciones en ${blog}" if (${debug}) -_msg debug "_blogs: Ejecutando función $engine para ${blog}" if (${debug}) _msg debug "_blogs: Comprobando #link, #showimg y -#ytvideo en blog_content" if (${debug}) _msg debug "_blogs: #link está presente, ejecutar _link: blog_content" if (${debug}) -_msg debug "_blogs: #showimg está presente, ejecutar _link: blog_content" if (${debug}) _msg debug "_blogs: #ytvideo está -presente, ejecutar _link: blog_content" if (${debug}) _msg debug "_blogs: Reemplazando tagline, sitename y pagetitle" if -(${debug}) _msg debug "_blogs: Creando directorio ${www_root}/${blog_dir}" if (${debug}) _msg debug "_blogs: Escribiendo -blog en disco: ${www_root}${blog_url}" _msg sub "- No se encontraron Blogs nuevos o actualizados" if (${debug}) _msg sub " -_blogs: Ejecutando _blog_idx_for_index" if (${debug}) _msg sub "* _blogs: Ejecutando _blog_index" _msg sub "- Poblando -${project_dir}/blog/index.tmp.html" if (${debug}) _msg debug "_blog_idx_for_index: Iniciando función" if (${debug}) _msg -debug "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" if (${debug}) _msg debug "_blog_idx_for_index: -meta_str de BLOG_META_STR_ARRAY de _blogs" if (${debug}) _msg debug "_blog_idx_for_index: ${meta_str}" if (${debug}) _msg -debug "_blog_idx_for_index: Iterar sobre cada componente y extraer información" if (${debug}) _msg debug -"_blog_idx_for_index: Ejecutando ${engine} en contenido para capturar QStags en Ingress" if (${debug}) _msg debug -"_blog_idx_for_index \ No newline at end of file +typeset -A localization +localization=( +_msg_msg_1 "Uso: qsgen2 add \"Nombre del Sitio\" \"ruta/al/proyecto\"" +_msg_msg_2 "- Actualización forzada: Generando todo" +_msg_msg_3 "* %SCRIPT_NAME% no puede analizar este sitio. Saliendo. *" +_msg_msg_4 "Por favor instala Pandoc." +_msg_msg_5 "No se encontró un generador válido. ¿Estás seguro de haber seleccionado el generador correcto en 'config'?" +_msg_msg_6 "Usando el motor ${generator} para archivos: ${file_ext}" +_list_pages_msg_1 "_list_pages: No se encontraron páginas con extensión ${file_ext}." +_list_pages_msg_2 "_list_pages: Añadiendo archivo al array: ${file}" +_list_blogs_msg_3 "_list_blogs: No se encontraron blogs." +_list_blogs_msg_4 "_list_blogs: Añadiendo archivo al array: $file" +_blog_cache_msg_1 "_blog_cache: VALOR HASH: ${blog_cache[${name}]}" +_blog_cache_msg_2 "1. _blog_cache: ${blog_file}" +_blog_cache_msg_3 "2. _blog_cache: caché actual: ${current_hash}" +_blog_cache_msg_4 "3. _blog_cache: nuevo archivo en caché: ${blog_file}$" +_blog_cache_msg_5 "4. _blog_cache: nuevo caché actual: ${current_hash}" +_pages_cache_msg_1 "VALOR HASH DE PÁGINAS: ${pages_cache[${name}]}" +_pages_cache_msg_2 "1. pages_cache: ${pages_cache[$file]}" +_pages_cache_msg_3 "1. _pages_cache: caché actual: ${current_hash}" +_pages_cache_msg_4 "2. _pages_cache: archivo de páginas: ${pages_cache[$file]}" +_pages_cache_msg_5 "2. _pages_cache: caché actual: ${current_hash}" +_last_updated_msg_1 "_last_updated: Estableciendo fecha y versión en el pie de página" +_last_updated_msg_1 "_last_updated: ${upd_msg}" +_f_last_updated_msg_1 "_f_last_updated: Estableciendo fecha y versión en el pie de página del archivo ${1}" +_f_last_updated_msg_2 "_f_last_updated: ${upd_msg}" +_f_last_updated_msg_3 "_f_last_updated: Archivo '${1}' no encontrado." +_pages_msg_1 "_pages: Ejecutando función _pages_cache" +_pages_msg_2 "* No tienes ninguna página *" +_pages_msg_3 "Generando Páginas" +_pages_msg_4 "_pages: el array de páginas no está vacío" +_pages_msg_5 "_pages: Estableciendo plantilla de Páginas" +_pages_msg_6 "No se pudo encontrar la plantilla de Páginas: ${pages}" +_pages_msg_7 "_pages: Leyendo la plantilla de Páginas en pages_tpl" +_pages_msg_8 "- Generando Página: ${pages_in_array%.*}.html" +_pages_msg_9 "_pages: Cargando contenido de página una vez - ${pages_in_array}" +_pages_msg_10 "_pages: Encontrando título de página" +_pages_msg_11 "_pages: ${page_title}" +_pages_msg_12 "_pages: Eliminando línea #title del contenido de página" +_pages_msg_13 "_pages: Ejecutando motor en ${pages_in_array}" +_pages_msg_14 "_pages: Comprobando #link, #showimg y #ytvideo en contenido de página" +_pages_msg_15 "_pages: #link presente, ejecutar _link: contenido de página" +_pages_msg_16 "_pages: #showimg presente, ejecutar _image: contenido de página" +_pages_msg_17 "_pages: #ytvideo presente, ejecutar _youtube: contenido de página" +_pages_msg_18 "_pages: Reemplazando #pagetitle, #tagline y #sitename en pages_tpl" +_pages_msg_19 "_pages: Reemplazando BODY con contenido de página en pages_tpl" +_pages_msg_20 "_pages: _last_updated en pages_tpl" +_pages_msg_21 "_pages: Nombres de archivos en minúsculas, siempre" +_pages_msg_22 "_pages: Ejecutando _cleanup" +_pages_msg_23 "- Analizando ${pages_in_array}" +_pages_msg_24 "- blog_in_index = ${blog_in_index}" +_pages_msg_25 "- Listando archivo temporal de blog:" +_pages_msg_26 "Actualizando index.html con nuevas publicaciones de blog" +_pages_msg_27 "- Analizando ${pages_in_array}" +_pages_msg_28 "- blog_in_index = ${blog_in_index}" +_pages_msg_29 "- Listando archivo temporal de blog:" +_pages_msg_30 "- No se encontraron Páginas nuevas o actualizadas" +_blogs_msg_1 "_blogs: Ejecutando función _list_blogs" +_blogs_msg_2 "* No tienes ningún blog *" +_blogs_msg_3 "Generando Blogs" +_blogs_msg_4 "_blogs: Ejecutando función _blog_cache" +_blogs_msg_5 "No se pudo encontrar la plantilla temática para Blogs." +_blogs_msg_6 "_blogs: Procesando datos previos para ${blog}" +_blogs_msg_7 "_blogs: Buscando FECHA: Encontrada" +_blogs_msg_8 "_blogs: Buscando TÍTULO DEL BLOG: Encontrado" +_blogs_msg_9 "* _blogs: Falta metadatos de FECHA en ${blog}." +_blogs_msg_10 "* _blogs: Falta metadatos de TÍTULO DEL BLOG en ${blog}." +_blogs_msg_11 "_blogs: Añadiendo datos para ${blog} al array para exportar" +_blogs_msg_12 "_blogs: Procesando ${blog}" +_blogs_msg_13 "- Generando Blog: ${blog_index}.html" +_blogs_msg_14 "_blogs: Procesando sustituciones en ${blog}" +_blogs_msg_15 "_blogs: Ejecutando función $engine para ${blog}" +_blogs_msg_16 "_blogs: Comprobando #link, #showimg y #ytvideo en contenido del blog" +_blogs_msg_17 "_blogs: #link presente, ejecutar _link: contenido del blog" +_blogs_msg_18 "_blogs: #showimg presente, ejecutar _link: contenido del blog" +_blogs_msg_19 "_blogs: #ytvideo presente, ejecutar _link: contenido del blog" +_blogs_msg_20 "_blogs: Reemplazando tagline, sitename y pagetitle" +_blogs_msg_21 "_blogs: Creando directorio ${www_root}${blog_dir}" +_blogs_msg_22 "_blogs: Escribiendo blog en disco: ${www_root}${blog_url}" +_blogs_msg_23 "_blogs: new_updated_blogs=true" +_blogs_msg_24 "- No se encontraron Blogs nuevos o actualizados" +_blogs_msg_25 "* _blogs: Ejecutando _blog_idx_for_index" +_blogs_msg_26 "* _blogs: Ejecutando _blog_index" +_blog_idx_for_index_msg_1 "- Poblando ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_2 "_blog_idx_for_index: Iniciando función" +BODY_blog_idx_for_index_msg_3 "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" +_blog_idx_for_index_msg_4 "_blog_idx_for_index: meta_str de BLOG_META_STR_ARRAY de _blogs" +_blog_idx_for_index_msg_5 "_blog_idx_for_index: ${meta_str}" +_blog_idx_for_index_msg_6 "_blog_idx_for_index: Iterando sobre cada componente y extrayendo información" +_blog_idx_for_index_msg_7 "_blog_idx_for_index: Ejecutando ${engine} en contenido para capturar QStags en Ingress" +_blog_idx_for_index_msg_8 "_blog_idx_for_index: Escribiendo _blog_idx_for_index en archivo: ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_9 "_blog_idx_for_index: blog_list_content = ${blog_list_content}" +_blog_index_msg_1 "_blog_index: blog_in_index=${blog_in_index}" +_blog_index_msg_2 "_blog_index: new_updated_blogs=${new_updated_blogs}" +_blog_index_msg_3 "_blog_index: Ejecutando función _blog_index" +_blog_index_msg_4 "_blog_index: blog_in_index = ${blog_in_index}" +_blog_index_msg_5 "- Generando Página: ${www_root}/blog/index.html" +_blog_index_msg_6 "_blog_index: Reemplazando sitename y tagline" +_blog_index_msg_7 "_blog_index: Reemplazando BODY con contenido de ${project_dir}/blog/index.tmp.html" +_blog_index_msg_8 "_blog_index: Escribiendo ${www_root}/blog/index.html" +_add_blog_list_to_index_msg_1 "_add_blog_list_to_index: Insertando lista de blogs en index.html" +_sitemap_msg_1 "Generando Sitemap" +_sitemap_msg_2 "Sitemap generado en ${sitemap_file}" +_link_msg_1 "_link: LÍNEA PRINCIPAL DE URL: ${line}" +_link_msg_2 "_link_ URL: ${url_dest}" +_link_msg_3 "_link: Texto: ${url_txt}" +_image_msg_1 "_image: Procesando línea: ${line}" +_youtube_msg_1 "_youtube: Procesando línea: ${line}" +_cleanup_msg_1 "_cleanup: Limpiando etiquetas en contenido" +_html_msg_1 "_html: Convirtiendo QStags en contenido" +_zhtml_msg_1 "_zhtml: Convirtiendo QStags en contenido" +) diff --git a/include/qsgen2/lang/nb_NO b/include/qsgen2/lang/nb_NO index 0bc12ef..6651129 100644 --- a/include/qsgen2/lang/nb_NO +++ b/include/qsgen2/lang/nb_NO @@ -1,65 +1,113 @@ - - -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Usage: _msg "" ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - - _msg info "Bruk: qsgen2 add \"Nettstednavn\" \"/sti/til/prosjekt\"" - _msg sub "- Tvungen oppdatering: Genererer alt" - _msg debug "* ${0:t} kan ikke analysere dette nettstedet. Avslutter. *" - _msg other "Vennligst installer Pandoc." - _msg other "https://github.com/jgm/pandoc/releases" - - - - -_msg debug "Ingen gyldig generator funnet. Er du sikker på at du har valgt riktig generator i 'config'?" if -(${globaldebug}); then _msg debug "Bruker ${generator}-motoren for filer: ${file_ext}"; fi if ${debug}; then _msg debug -"_list_pages: Ingen sider funnet med filtype ${file_ext}."; fi if ${debug}; then _msg debug "_list_pages: Legger til fil i -array: ${file}"; fi if ${debug}; then _msg debug "_list_blogs: Ingen bloggfiler funnet."; fi if ${debug}; then _msg debug -"_list_blogs: Legger til fil i array: $file"; fi if (${debug}) _msg debug "_blog_cache: HASH-VERDI: ${blog_cache[${name}]}" -if (${debug}) _msg debug "1. _blog_cache: ${blog_file}" if (${debug}) _msg debug "2. _blog_cache: current_cache: -${current_hash}" if (${debug}) _msg debug "3. _blog_cache: new_cache_file: ${blog_file}$" if (${debug}) _msg debug "4. -_blog_cache: new_current_cache: ${current_hash}" if (${debug}) _msg debug "SIDER HASH-VERDI: ${pages_cache[${name}]}" if -(${debug}) _msg debug "1. pages_cache: ${pages_cache[$file]}" if (${debug}) _msg debug "1. _pages_cache: current_cache: -${current_hash}" if (${debug}) _msg debug "2. _pages_cache: pages_file: ${pages_cache[$file]}" if (${debug}) _msg debug "2. -_pages_cache: current_cache: ${current_hash}" if (${debug}); then _msg debug "_last_updated: Setter dato og versjon i -bunnteksten"; fi if (${debug}); then _msg debug "_last_updated: ${upd_msg}"; fi local upd_msg="Sist oppdatert ${today} av ${QSGEN} ${VERSION}" -e "s|#updated|${upd_msg}|") if (${debug}); then _msg -debug "_f_last_updated: Setter dato og versjon i bunnteksten til filen ${1}"; fi if (${debug}); then _msg debug -"_f_last_updated: ${upd_msg}"; fi local upd_msg="Sist oppdatert ${today} av ${QSGEN} ${VERSION}" -e "s|#updated|${upd_msg}|" -if (${debug}) _msg debug "_pages: Kjører funksjonen _pages_cache" _msg sub "* Du har ingen sider " _msg main "Genererer -Sider" if (${debug}) _msg debug "_pages: pages_array er ikke tom" if (${debug}) _msg debug "_pages: Setter Sider-malen" _msg -info "Kan ikke finne Sider-malen: ${pages}" if (${debug}) _msg debug "_pages: Leser inn Sider-malen i pages_tpl" _msg std "- -Genererer Side: ${pages_in_array%.}.html" if (${debug}) _msg debug "_pages: Laster inn sideinnhold én gang - -${pages_in_array}" if (${debug}) _msg debug "_pages: Grep etter side_tittel" if (${debug}) _msg debug "_pages: -${page_title}" if (${debug}) _msg debug "_pages: Fjerner #tittel-linjen fra sideinnholdet" if (${debug}) _msg debug "_pages: -Kjører motoren på ${pages_in_array}" if (${debug}) _msg debug "_pages: Sjekker etter #link, #showimg og #ytvideo i -sideinnholdet" if (${debug}) _msg debug "_pages: #link er tilstede, kjør _link: sideinnholdet" if (${debug}) _msg debug -"_pages: #showimg er tilstede, kjør _image: sideinnholdet" if (${debug}) _msg debug "_pages: #ytvideo er tilstede, kjør -_youtube: sideinnholdet" if (${debug}) _msg debug "_pages: Erstatter BODY med sideinnholdet i pages_tpl" if (${debug}) _msg -debug "_pages: Erstatter #sidetittel, #tagline og #nettstednavn i pages_tpl" if (${debug}) _msg debug "_pages: _last_updated -i pages_tpl" if (${debug}) _msg debug "_pages: Filnavn i små bokstaver, alltid" if (${debug}) _msg debug "_pages: Kjører -_cleanup" # _msg std "Skriver ${www_root}/${pages_title_lower%.}.html til disk." if (${debug}) _msg sub "- Analyserer -${pages_in_array}" if (${debug}) _msg sub "- blog_in_index = ${blog_in_index}" if (${debug}) _msg sub "- List opp -midlertidig bloggfil:" _msg std "Oppdaterer index.html med nye blogginnlegg" if (${debug}) _msg sub "- Analyserer -${pages_in_array}" if (${debug}) _msg sub "- blog_in_index = ${blog_in_index}" if (${debug}) _msg sub "- List opp -midlertidig bloggfil:" _msg sub "- Ingen nye eller oppdaterte Sider funnet" if (${debug}) _msg debug "_blogs: Kjører -funksjonen _list_blogs" _msg sub " Du har ingen blogger " _msg main "Genererer Blogger" if (${debug}) _msg debug "_blogs: -Kjører funksjonen _blog_cache" _msg info "Kan ikke finne temamalen for Blogger." if (${debug}) _msg debug "_blogs: Behandler -pre-data for ${blog}" _msg debug "_blogs: DATO-metadata mangler i ${blog}." if (${debug}) _msg debug "_blogs: Legger til -data for ${blog} i array for eksport" if (${debug}) _msg debug "_blogs: Behandler ${blog}" _msg std "- Genererer Blogg: -${blog_index}.html" if (${debug}) _msg debug "_blogs: Behandler erstatninger i ${blog}" if (${debug}) _msg debug "_blogs: -Kjører funksjonen $engine for ${blog}" if (${debug}) _msg debug "_blogs: Sjekker etter #link, #showimg og #ytvideo i -blogginnholdet" if (${debug}) _msg debug "_blogs: #link er tilstede, kjør _link: blogginnholdet" if (${debug}) _msg debug -"_blogs: #showimg er tilstede, kjør _link: blogginnholdet" if (${debug}) _msg debug "_blogs: #ytvideo er tilstede, kjør -_link: blogginnholdet" if (${debug}) _msg debug "_blogs: Erstatter tagline, nettstednavn og sidetittel" if (${debug}) _msg -debug "_blogs: Oppretter katalogen ${www_root}/${blog_dir}" if (${debug}) _msg debug "_blogs: Skriver blogg til disk: -${www_root}${blog_url}" _msg sub "- Ingen nye eller oppdaterte Blogger funnet" if (${debug}) _msg sub " _blogs: Kjører -_blog_idx_for_index" if (${debug}) _msg sub "* _blogs: Kjører _blog_index" _msg sub "- Fyller -${project_dir}/blog/index.tmp.html" if (${debug}) _msg debug "_blog_idx_for_index: Starter funksjonen" if (${debug}) _msg -debug "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" if (${debug}) _msg debug "_blog_idx_for_index: -meta_str fra BLOG_META_STR_ARRAY fra _blogs" if (${debug}) _msg debug "_blog_idx_for_index: ${meta_str}" if (${debug}) _msg -debug "_blog_idx_for_index: Gå gjenn \ No newline at end of file +typeset -A localization +localization=( +_msg_msg_1 "Bruk: qsgen2 add \"Nettstedsnavn\" \"sti/til/prosjekt\"" +_msg_msg_2 "- Tvungen oppdatering: Genererer alt" +_msg_msg_3 "* %SCRIPT_NAME% kan ikke analysere dette nettstedet. Avslutter. *" +_msg_msg_4 "Vennligst installer Pandoc." +_msg_msg_5 "https://github.com/jgm/pandoc/releases" +_msg_msg_6 "Ingen gyldig generator funnet. Er du sikker på at du har valgt riktig generator i 'config'?" +_msg_msg_7 "Bruker ${generator}-motoren for filer: ${file_ext}" +_list_pages_msg_1 "_list_pages: Ingen sider funnet med utvidelse ${file_ext}." +_list_pages_msg_2 "_list_pages: Legger til fil i array: ${file}" +_list_blogs_msg_3 "_list_blogs: Ingen blogginnlegg funnet." +_list_blogs_msg_4 "_list_blogs: Legger til fil i array: $file" +_blog_cache_msg_1 "_blog_cache: HASH VERDI: ${blog_cache[${name}]}" +_blog_cache_msg_2 "1. _blog_cache: ${blog_file}" +_blog_cache_msg_3 "2. _blog_cache: nåværende cache: ${current_hash}" +_blog_cache_msg_4 "3. _blog_cache: ny cache-fil: ${blog_file}$" +_blog_cache_msg_5 "4. _blog_cache: ny nåværende cache: ${current_hash}" +_pages_cache_msg_1 "SIDERS HASH VERDI: ${pages_cache[${name}]}" +_pages_cache_msg_2 "1. pages_cache: ${pages_cache[$file]}" +_pages_cache_msg_3 "1. _pages_cache: nåværende cache: ${current_hash}" +_pages_cache_msg_4 "2. _pages_cache: sidefil: ${pages_cache[$file]}" +_pages_cache_msg_5 "2. _pages_cache: nåværende cache: ${current_hash}" +_last_updated_msg_1 "_last_updated: Setter dato og versjon i bunntekst" +_last_updated_msg_1 "_last_updated: ${upd_msg}" +_f_last_updated_msg_1 "_f_last_updated: Setter dato og versjon i bunntekst for fil ${1}" +_f_last_updated_msg_2 "_f_last_updated: ${upd_msg}" +_f_last_updated_msg_3 "_f_last_updated: Filen '${1}' ble ikke funnet." +_pages_msg_1 "_pages: Kjører funksjon _pages_cache" +_pages_msg_2 "* Du har ingen sider *" +_pages_msg_3 "Genererer Sider" +_pages_msg_4 "_pages: sidearray er ikke tom" +_pages_msg_5 "_pages: Setter Opp Sider-mal" +_pages_msg_6 "Kan ikke finne Sidemalen: ${pages}" +_pages_msg_7 "_pages: Leser Sidemalen inn i pages_tpl" +_pages_msg_8 "- Genererer Side: ${pages_in_array%.*}.html" +_pages_msg_9 "_pages: Laster sideinnhold en gang - ${pages_in_array}" +_pages_msg_10 "_pages: Finne sidetittel" +_pages_msg_11 "_pages: ${page_title}" +_pages_msg_12 "_pages: Fjerner #tittel linje fra sideinnhold" +_pages_msg_13 "_pages: Kjører motor på ${pages_in_array}" +_pages_msg_14 "_pages: Sjekker for #link, #showimg og #ytvideo i sideinnhold" +_pages_msg_15 "_pages: #link er til stede, kjør _link: sideinnhold" +_pages_msg_16 "_pages: #showimg er til stede, kjør _image: sideinnhold" +_pages_msg_17 "_pages: #ytvideo er til stede, kjør _youtube: sideinnhold" +_pages_msg_18 "_pages: Erstatter #sidetittel, #tagline og #sidenavn i pages_tpl" +_pages_msg_19 "_pages: Erstatter BODY med sideinnhold i pages_tpl" +_pages_msg_20 "_pages: _last_updated i pages_tpl" +_pages_msg_21 "_pages: Filnavn i små bokstaver, alltid" +_pages_msg_22 "_pages: Kjører _cleanup" +_pages_msg_23 "- Analyserer ${pages_in_array}" +_pages_msg_24 "- blog_in_index = ${blog_in_index}" +_pages_msg_25 "- Lister opp blogg midlertidig fil:" +_pages_msg_26 "Oppdaterer index.html med nye blogginnlegg" +_pages_msg_27 "- Analyserer ${pages_in_array}" +_pages_msg_28 "- blog_in_index = ${blog_in_index}" +_pages_msg_29 "- Lister opp blogg midlertidig fil:" +_pages_msg_30 "- Ingen nye eller oppdaterte Sider funnet" +_blogs_msg_1 "_blogs: Kjører funksjon _list_blogs" +_blogs_msg_2 "* Du har ingen blogger *" +_blogs_msg_3 "Genererer Blogger" +_blogs_msg_4 "_blogs: Kjører funksjon _blog_cache" +_blogs_msg_5 "Kan ikke finne tema mal for Blogger." +_blogs_msg_6 "_blogs: Behandler forhåndsdata for ${blog}" +_blogs_msg_7 "_blogs: Leter etter DATO: Funnet" +_blogs_msg_8 "_blogs: Leter etter BLOGGTITTEL: Funnet" +_blogs_msg_9 "* _blogs: DATO-metadata mangler i ${blog}." +_blogs_msg_10 "* _blogs: BLOGGTITTEL-metadata mangler i ${blog}." +_blogs_msg_11 "_blogs: Legger til data for ${blog} til array for eksport" +_blogs_msg_12 "_blogs: Behandler ${blog}" +_blogs_msg_13 "- Genererer Blogg: ${blog_index}.html" +_blogs_msg_14 "_blogs: Behandler erstatninger i ${blog}" +_blogs_msg_15 "_blogs: Kjører funksjon $engine for ${blog}" +_blogs_msg_16 "_blogs: Sjekker for #link, #showimg og #ytvideo i blogginnhold" +_blogs_msg_17 "_blogs: #link er til stede, kjør _link: blogginnhold" +_blogs_msg_18 "_blogs: #showimg er til stede, kjør _link: blogginnhold" +_blogs_msg_19 "_blogs: #ytvideo er til stede, kjør _link: blogginnhold" +_blogs_msg_20 "_blogs: Erstatter tagline, sitenavn og sidetittel" +_blogs_msg_21 "_blogs: Oppretter katalog ${www_root}${blog_dir}" +_blogs_msg_22 "_blogs: Skriver blogg til disk: ${www_root}${blog_url}" +_blogs_msg_23 "_blogs: new_updated_blogs=true" +_blogs_msg_24 "- Ingen nye eller oppdaterte Blogger funnet" +_blogs_msg_25 "* _blogs: Kjører _blog_idx_for_index" +_blogs_msg_26 "* _blogs: Kjører _blog_index" +_blog_idx_for_index_msg_1 "- Fyller ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_2 "_blog_idx_for_index: Starter funksjon" +_blog_idx_for_index_msg_3 "_blog_idx_for_index: BLOG_META_STR_ARRAY: ${BLOG_META_STR_ARRAY[@]}" +_blog_idx_for_index_msg_4 "_blog_idx_for_index: meta_str fra BLOG_META_STR_ARRAY fra _blogs" +_blog_idx_for_index_msg_5 "_blog_idx_for_index: ${meta_str}" +_blog_idx_for_index_msg_6 "_blog_idx_for_index: Går gjennom hver komponent og trekker ut informasjon" +_blog_idx_for_index_msg_7 "_blog_idx_for_index: Kjører ${engine} på innhold for å fange QStags i Ingress" +_blog_idx_for_index_msg_8 "_blog_idx_for_index: Skriver _blog_idx_for_index til fil: ${project_dir}/blog/index.tmp.html" +_blog_idx_for_index_msg_9 "_blog_idx_for_index: blog_list_content = ${blog_list_content}" +_blog_index_msg_1 "_blog_index: blog_in_index=${blog_in_index}" +_blog_index_msg_2 "_blog_index: new_updated_blogs=${new_updated_blogs}" +_blog_index_msg_3 "_blog_index: Kjører funksjon _blog_index" +_blog_index_msg_4 "_blog_index: blog_in_index = ${blog_in_index}" +_blog_index_msg_5 "- Genererer Side: ${www_root}/blog/index.html" +_blog_index_msg_6 "_blog_index: Erstatter sitenavn og tagline" +_blog_index_msg_7 "_blog_index: Erstatter BODY med innhold fra ${project_dir}/blog/index.tmp.html" +_blog_index_msg_8 "_blog_index: Skriver ${www_root}/blog/index.html" +_add_blog_list_to_index_msg_1 "_add_blog_list_to_index: Setter inn bloggliste i index.html" +_sitemap_msg_1 "Genererer Nettsidekart" +_sitemap_msg_2 "Nettsidekart generert på ${sitemap_file}" +_link_msg_1 "_link: HOVED URL-LINJE: ${line}" +_link_msg_2 "_link_ URL: ${url_dest}" +_link_msg_3 "_link: Tekst: ${url_txt}" +_image_msg_1 "_image: Behandler linje: ${line}" +_youtube_msg_1 "_youtube: Behandler linje: ${line}" +_cleanup_msg_1 "_cleanup: Renser opp i merker i innhold" +_html_msg_1 "_html: Konverterer QStags i innhold" +_zhtml_msg_1 "_zhtml: Konverterer QStags i innhold" +) diff --git a/qsgen2 b/qsgen2 index 400ce22..8636e32 100755 --- a/qsgen2 +++ b/qsgen2 @@ -19,9 +19,10 @@ QSGEN="Quick Site Generator 2" globaldebug=false # Use Zsh fpath to set the path to some extra functions -fpath=(${HOME}/bin/include/common ${HOME}/.config/qsgen2/plugins $fpath) +fpath=(${HOME}/bin/include/common ${HOME}/.config/qsgen2/lang $fpath) # In this case, let's load the 'include' function autoload include +autoload ${language} # Including some colors to the script include common/colors @@ -126,34 +127,44 @@ blog_cache_file="${project_dir}/.blog_cache" pages_cache_file="${project_dir}/.pages_cache" function _msg() { - # Use this function to write out messages based on their type - # Types are: std=green - info=yellow - debug=red other=bold_yellow - # Usage: _msg "" - - case ${1} in - std) - echo "${yellow}${2}${end}" - ;; - info) - echo "${green}${2}${end}" - ;; - debug) - echo "${red}${2}${end}" - ;; - other) - echo "${bold_yellow}${2}${end}" - ;; - sub) - echo "${magenta}${2}${end}" - ;; - main) - echo "${white}${green_bg} ${2} ${end}" - ;; - *) - echo "${2}" - ;; - esac - + # Usage: _msg "key" + local type=$1 + local key=$2 + local msg=${localization[$key]} + + # Check if message exists for the key + if [[ -z "$msg" ]]; then + echo "Localization key '$key' not found." + return + fi + + # Dynamic replacement for known placeholders + msg=${msg//"%SCRIPT_NAME%"/${0:t}} + + # Apply color formatting based on type + case ${type} in + std) + echo -e "${green}${msg}${end}" + ;; + info) + echo -e "${yellow}${msg}${end}" + ;; + debug) + echo -e "${red}${msg}${end}" + ;; + other) + echo -e "${bold_yellow}${msg}${end}" + ;; + sub) + echo -e "${magenta}${msg}${end}" + ;; + main) + echo -e "${white}${green_bg} ${msg} ${end}" + ;; + *) + echo -e "${msg}" + ;; + esac } case ${1} in