From a937fc96f3d5b4760fd2ee8414b2262ba67c6478 Mon Sep 17 00:00:00 2001 From: Julio Ruiz Date: Fri, 30 Jan 2026 17:07:30 -0500 Subject: [PATCH] Fixed translation indexer for typesense --- carpa_json_to_markdown/index.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/carpa_json_to_markdown/index.js b/carpa_json_to_markdown/index.js index fd8e18e..e7325ff 100644 --- a/carpa_json_to_markdown/index.js +++ b/carpa_json_to_markdown/index.js @@ -18,7 +18,7 @@ let jsonlData = ''; const DATA_INPUT_FOLDER = './input'; const DATA_OUTPUT_FOLDER = './output'; const TEMPLATES_FOLDER = './templates'; -const LOCALE = 'es'; +const LOCALE = 'pt'; function generateMarkdown(type) { const folderPath = `${DATA_INPUT_FOLDER}/${type}`; @@ -213,12 +213,12 @@ async function generateJson( type ) { nitem.duration = item.activities_id?.duration ?? 0; nitem.year = dayjs(item.activities_id?.date).year().toString() - nitem.month = item.year + " > " + (dayjs(item.activities_id?.date).month()+1).toString().padStart(2,"0") + nitem.month = nitem.year + " > " + (dayjs(item.activities_id?.date).month()+1).toString().padStart(2,"0") - nitem.menu_lvl0 = item.country - nitem.menu_lvl1 = item.country + " > " + item.state - nitem.menu_lvl2 = item.country + " > " + item.state + " > " + item.city - nitem.menu_lvl3 = item.country + " > " + item.state + " > " + item.city + " > " + item.place + nitem.menu_lvl0 = nitem.country + nitem.menu_lvl1 = nitem.country + " > " + nitem.state + nitem.menu_lvl2 = nitem.country + " > " + nitem.state + " > " + nitem.city + nitem.menu_lvl3 = nitem.country + " > " + nitem.state + " > " + nitem.city + " > " + nitem.place nitem.date = dayjs(item.activities_id?.date).unix() @@ -226,7 +226,7 @@ async function generateJson( type ) { } if( type == 'conferences_translations' ){ - nitem.id = item.conferences_id?.id + nitem.id = item.conferences_id?.id.toString() nitem.title = item.title nitem.body = he.decode(striptags(item.text_published)) || '' nitem.private = item.conferences_id?.public == 0 ? true : false; @@ -245,12 +245,12 @@ async function generateJson( type ) { nitem.duration = item.conferences_id?.duration ?? 0; nitem.year = dayjs(item.conferences_id?.date).year().toString() - nitem.month = item.year + " > " + (dayjs(item.conferences_id?.date).month()+1).toString().padStart(2,"0") + nitem.month = nitem.year + " > " + (dayjs(item.conferences_id?.date).month()+1).toString().padStart(2,"0") - nitem.menu_lvl0 = item.country - nitem.menu_lvl1 = item.country + " > " + item.state - nitem.menu_lvl2 = item.country + " > " + item.state + " > " + item.city - nitem.menu_lvl3 = item.country + " > " + item.state + " > " + item.city + " > " + item.place + nitem.menu_lvl0 = nitem.country + nitem.menu_lvl1 = nitem.country + " > " + nitem.state + nitem.menu_lvl2 = nitem.country + " > " + nitem.state + " > " + nitem.city + nitem.menu_lvl3 = nitem.country + " > " + nitem.state + " > " + nitem.city + " > " + nitem.place nitem.date = dayjs(item.conferences_id?.date).unix() @@ -334,5 +334,5 @@ function writeFile( jsonlData, type ){ // } //for( let year = 2021; year < 2027; year++){ - generateJson( 'conferences_translations' ); + generateJson( 'activities_translations' ); //} \ No newline at end of file