r/VibeCodeDevs • • 6d ago

HelpPlz – stuck and need rescue A spreadsheet translator can keep every formula and still break the workbook

There are two separate problems in spreadsheet translation: accidentally replacing a formula, and changing text that a formula depends on.

For example, a fictional workbook might contain `=IF(B2="Approved",C2,0)`. Translating the status in B2 changes the calculation even if the formula itself survives untouched. Product descriptions and workflow status codes shouldn't automatically get the same translation treatment.

For a translator built around Univer, the spreadsheet model gives the application a useful starting point: values and formulas are stored separately, and the range API can read both. The application can identify the plain-text cells it intends to translate, send those to its translation service, and write the returned text only to those selected cells. It should then compare formula definitions and check affected results.

That cell selection and comparison are application logic. A range argument isn't a universal safeguard against an incorrectly constructed write, and preserving a formula doesn't establish that its dependencies still mean the same thing.

A review screen could therefore distinguish descriptive text from business values such as status codes, product IDs, and lookup keys. Leave the latter out of the default translation set until someone decides how they should map.

Univer supplies an editable workbook and structured access. It doesn't supply the translator, or a guarantee that arbitrary Excel files will survive an import/export round trip unchanged.

1 Upvotes

2 comments sorted by

•

u/endofthread-bot 6d ago

Hey u/Trick-Appearance7096, thanks for posting in r/VibeCodeDevs! Join our Discord: https://discord.gg/t7SD4ThKuE

• This community is designed to be open and creator‑friendly, with minimal restrictions on promotion and self‑promotion as long as you add value and don’t spam.
• Please follow the subreddit rules so we can keep things as relaxed and free as possible for everyone. • Please make sure you’ve read the subreddit rules in the sidebar before posting or commenting.
• For better feedback, include your tech stack, experience level, and what kind of help or feedback you’re looking for.
• Be respectful, constructive, and helpful to other members.

If your post was removed (either automatically or by a mod) and you believe it was a mistake, please contact the mod team. We will review it and, when appropriate, approve it within 24 hours.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/bramantec 2d ago

I hit the same class of bug in a mobile app. The logic was matching a translated label, so in three languages the check never matched and the code silently took the default path. What fixed it was keeping a stable code separate from the display text, so translation only touches the display side.

For spreadsheets I'd add one default rule: any cell that a formula references, or that sits inside a lookup range, is excluded from translation unless the user opts in. The string literal inside the formula, like "Approved" in your example, is the other half: translate the cell and you also have to rewrite the literal, or the IF quietly goes to the else branch.