[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Internationalization

From: Nala Ginrut
Subject: Re: Internationalization
Date: Wed, 16 Dec 2020 23:22:09 +0800
User-agent: mu4e 1.4.13; emacs 27.1

Hey folks!
I'm sorry to break your experiment, but Artanis is so special to use
gettext-like stuffs for i18n.

IIRC, gettext is available for fork-based server, but the default
server-core Ragnarok of Artanis is co-routine based. That is to say, all
tasks are running on the same procedure, so gettext doesn't work at all,
otherwise you will always get the same locale.

There're two alternative ways for i18n in Artanis:
1. maintain a bunch of json for different locale on server side
2. take advantage of existing JS i18n modules, say, do i18n on frontend.

Few years ago, in my real case product development, I have chosen the
2ed way. In my opinion, we don't have to do everything on server
side. It's a good practice to reuse the mature JS contributions.

Of course, the 1st way is also good for server rendered template. I'm
willing to provide APIs to help this approach. But I still don't have
any idea about what should be provided.

I think it's good to make brainstorm before coding.
Comments are always welcome.

Best regards.

pelzflorian (Florian Pelz) writes:

> On Wed, Dec 16, 2020 at 11:03:16AM +0100, Jérémy Korwin-Zmijowski wrote:
>> As I am reading about ways to provide translations of my first webapp.
>> What is your workflow ?
> This is not for Artanis, but for the Guix website I wrote gettext-like
> macros for marking non-string s-expressions.  See the usage of G_ on
> It gets turned into a gettext POT file:
> However I imagine it is difficult to apply in Artanis, because sexps
> marked with G_ are replaced by the macro expander with an sexp using
> translations for all their strings and possibly reordering the sub
> expressions.  In a dynamic web server, which replacement is used
> should be decided at runtime, not compile time.  So each module would
> have to be expanded once for each locale and the right expansion would
> have to be used somehow.  But I am not experienced with Artanis.
> Regards,
> Florian

GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]