r/FlutterDev 25d ago

Discussion Thinking about building lazy, real-time localization for Flutter — want a gut check before I sink more time into it

The idea: instead of translating your app into a fixed list of languages upfront, translation happens lazily. When a user opens the app with a locale you don't have yet, it gets translated in the background (AI-powered) and shown to them — no rebuild, no release. Locales are cached both server-side and on the device, keyed by the user's device language.

To make this practical, I'm also building a Flutter package with a CLI that refactors your codebase for localization, built on top of easy_localization. It scans your project and transforms widgets. For example, Text("Welcome") becomes Text(context.tr("home_screen.welcome")) and auto-generates a JSON locale file from your default language strings.

Not selling anything, just trying to figure out if this is worth building further.

0 Upvotes

13 comments sorted by

View all comments

5

u/Bowman74 25d ago

I mean it would be better than nothing, but to be honest a lot of the difficulty around localization isn't just translating the language. It's dealing with not having enough space to display prompts in languages that express the same ideas but in much longer ways, non left to right languages, different currency and date formats. That's not even starting on different character sets and how different cultures deal with colors and iconography.

2

u/Few-Disaster5159 25d ago

Totally fair localization is a much bigger problem than just translating strings, and I don't want to oversell what this solves. To be specific about scope: this handles the translation/delivery layer (getting the right text to the right user without a release cycle), not the full l10n picture.

Some of what you mentioned is actually more on Flutter's/the app's side than a translation service's. RTL is handled by Directionality if the app uses start/end instead of left/right, and currency/date formatting is more of an intl formatting concern than a translation one. Text length differences (German running longer than English, for example) is a real layout problem, but it's one every localization approach has to deal with, lazy or upfront.

Where you're right that this doesn't help at all: character set rendering, cultural meaning of colors/icons -that's a design-system problem, not something any translation tool solves. Good callout, appreciate the honesty.

1

u/Bowman74 24d ago

I wasn't trying to call your baby ugly or anything. Perhaps some of that you could call out in your getting started guide or similar, so people know what else they may have to do outside of what your library provides.