[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: running gettext() in wasm
From: |
Bruno Haible |
Subject: |
Re: running gettext() in wasm |
Date: |
Sun, 22 Dec 2024 14:13:57 +0100 |
Vivien Kraus wrote:
> > * Your page says that the purpose is to run code "on Wasm GC-
> > capable
> > web browsers".
> > Whereas the .mo files were designed to run code on platforms with
> > a
> > POSIX file system, especially with mmap.
> >
> > How do you intend to map the file system to the web browser
> > model?
> > Will the server send the entire file system (with all *.mo files)
> > to the client? Or will the server only send the one or two
> > relevant
> > .mo files (say, fr_CA.mo and fr.mo for users in Quebec) to the
> > client?
> I am actually working on a compile-time Guile macro that will
> statically put all the known translation in the webassembly near each
> site where translation is requested:
>
> https://labo.planete-kraus.eu/guile-static-i18n.git
>
> So the translations end up in a similar way to resources that you would
> bundle in an executable. ...
> It is less flexible than Gettext, because I can’t update the
> translations without recompiling the program
Doing so ignores best practices of the software industry of the last 30 years.
The major benefits of NOT bundling localizations in the executable are:
* The user has the freedom to localize a package to their language.
Say, a Danish user sees that German translations are present, then
starts on Danish translations immediately without any further ado.
This user should be able to add their translations without doing
git checkouts and complicated builds — since users and translators
typically don't have programmer skills.
* When a company releases a product, they can schedule the translations
to happen between the product build and public release dates.
> Also, see how Gettext lets you embed
> translations in .desktop files for instance. You can’t change them
> without regenerating the .desktop file.
But since .desktop files are text files, a Danish user can add a Danish
localization by just adding 1 line to that file with a plain text editor.
Bruno