Skip to content

Commit

Permalink
Merge pull request #77 from ttsukagoshi/fix-empty-cell
Browse files Browse the repository at this point in the history
Add process to skip translation of empty cells
  • Loading branch information
ttsukagoshi authored May 20, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
2 parents a98be43 + 4635769 commit d7f8daa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sheetsl.ts
Original file line number Diff line number Diff line change
@@ -271,6 +271,9 @@ export function translateRange(): void {

const translatedText = sourceTextArr.map((row) =>
row.map((cellValue: string | number | boolean) => {
if (cellValue === '') {
return '';
}
if (getBlobBytes(encodeURIComponent(cellValue)) > THRESHOLD_BYTES) {
throw new Error(
`[${ADDON_NAME}] Cell content is too long. Please consider splitting the content into multiple cells:\n${cellValue}`

0 comments on commit d7f8daa

Please sign in to comment.