From 4b08b3d3deeae07de9a4f38bf317634c57222694 Mon Sep 17 00:00:00 2001 From: zdm Date: Wed, 14 Feb 2024 08:41:39 +0200 Subject: [PATCH] fix: tramslations --- lib/package/localization.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/package/localization.js b/lib/package/localization.js index f784cd82..e2cfce59 100644 --- a/lib/package/localization.js +++ b/lib/package/localization.js @@ -222,7 +222,7 @@ ${ JSON.stringify( message.translations, null, 4 ) } } // pre-translate single form - else if ( cloudTranslationApi && !message.translations?.[ 0 ] ) { + else if ( cloudTranslationApi && !message.isSingleFormTranslated ) { const res = await cloudTranslationApi.translate( poFile.language, message.id ); // error @@ -245,11 +245,7 @@ ${ JSON.stringify( message.translations, null, 4 ) } // translated from clous else { message.isFuzzy = true; - - const translations = message.translations || []; - translations[ 0 ] = res.data; - - message.setTranslations( translations ); + message.setSingleFormTranslation( res.data ); console.log( `Cloud translation: - [en]: ${ message.id }