Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Translate Button Is Declarative; the Community Workflow Is Not

A translation button can make multilingual community chat look solved. The user clicks, translated text appears, and the implementation seems almost too easy to count as serious engineering. Then production asks the less photogenic questions: What if the message is deleted while translation is running? Does a retry create two competing translations? Can moderators inspect the original wording?…

The translate button in a multilingual community chat application may appear to solve language barriers, but the underlying workflow presents complex challenges. When a user requests translation, the system must record the request, handle failures, manage changes to the original message, and allow moderators to review the translation. The translation process itself is an imperative operation, distinct from the declarative nature of the user interface.

The tutorial demonstrates how to build a workflow around Tencent RTC's translation capability for a social messaging experience. The design adheres to six rules: recording translation requests, rejecting locally without invoking translation if the source is not eligible, handling translation failures by keeping the original message visible, discarding late results when the source changes, preserving machine translations and opening human review for disputed meanings, and labeling corrections as human corrections instead of rewriting history.

The architecture consists of an event-driven pipeline, where user commands are processed by pure decision functions, append domain events, and trigger imperative workers. Pure code determines the validity of requests and the UI display, while the imperative shell deals with operations that can fail, such as persisting events, invoking translation, and notifying moderators. This separation of pure and imperative code highlights where nondeterminism enters the system, making it clear where engineering judgment is needed.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I Found a P0 Auth Bypass by Testing What null Does to BCrypt

While building SCIP — a supply chain platform with 90+ Spring Boot REST endpoints — I was boundary-testing the auth flow when I noticed something that shouldn't have been possible.

  • Null password bypass authenticated with any password
  • SCIP supply chain platform with 90+ Spring Boot REST endpoints
  • Fix implemented by adding null guard before BCrypt execution

What will happen if Cloud database becomes too expensive ???

For most of the last fifteen years, "move it to the cloud" was the answer to almost every data infrastructure question. Storage was cheap, compute was elastic, and nobody had to rack a server again.

  • Cloud database expenses have tripled in two years despite unchanged data volume.
  • Organizations selectively migrate predictable workloads to cheaper infrastructure or on-premises.
  • Decoupling storage from compute and using open formats defend against cost lock-in.

More from Monday 24 August →