i18n / translations

82 views
Skip to first unread message

Christopher Lemmer Webber

unread,
Feb 9, 2019, 8:56:59 AM2/9/19
to racket users
How are people currently translating their programs?
I expected to see a gettext library or something, but haven't.

I see that DrRacket is translated, but I did a few simple greps through
the DrRacket repo and couldn't figure out how.

Am I missing something? Or is this tooling that needs to be written?
- cwebb

Bogdan Popa

unread,
Feb 9, 2019, 9:42:26 AM2/9/19
to Christopher Lemmer Webber, racket users

> How are people currently translating their programs?

I was searching for a way to do l10n yesterday[1] and the best I could
find was SRFI 29[2] from srfi-lib.

[1]: https://github.com/Bogdanp/racket-webapp-template/commit/7647b2f2f460d1ede4f468e00f4dea62a541ee6e#diff-9978fbdfa51cde9daace605e88cc9c6c
[2]: https://srfi.schemers.org/srfi-29/srfi-29.html

Greg Trzeciak

unread,
Feb 9, 2019, 10:31:34 AM2/9/19
to Racket Users
look into: https://github.com/racket/string-constants
for the way DrRacket gets translations/internationalization

Roman Klochkov

unread,
Oct 1, 2019, 5:02:04 AM10/1/19
to Racket Users
Now we have gettext: https://docs.racket-lang.org/gettext/index.html

суббота, 9 февраля 2019 г., 18:56:59 UTC+5 пользователь cwebber написал:

Bogdan Popa

unread,
Oct 1, 2019, 5:11:22 AM10/1/19
to Roman Klochkov, Racket Users
This is great! Thank you.

Alexander Shopov

unread,
Oct 1, 2019, 7:06:35 AM10/1/19
to Bogdan Popa, Roman Klochkov, Racket Users
We should be able to convert to and from po format to racket's own one.

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/m2eezwvnik.fsf%40192.168.0.139.

Roman Klochkov

unread,
Oct 2, 2019, 6:42:58 AM10/2/19
to Racket Users
What is racket's own one? srfi-29? String-constants?

Neither of them support plurals and contexts. Or do you mean something else?

вторник, 1 октября 2019 г., 16:06:35 UTC+5 пользователь Alexander Shopov написал:
We should be able to convert to and from po format to racket's own one.

На вт, 1.10.2019 г. в 11:11 ч. Bogdan Popa <bog...@defn.io> написа:
This is great!  Thank you.

Roman Klochkov writes:

> Now we have gettext: https://docs.racket-lang.org/gettext/index.html
>
> суббота, 9 февраля 2019 г., 18:56:59 UTC+5 пользователь cwebber написал:
>>
>> How are people currently translating their programs?
>> I expected to see a gettext library or something, but haven't.
>>
>> I see that DrRacket is translated, but I did a few simple greps through
>> the DrRacket repo and couldn't figure out how.
>>
>> Am I missing something?  Or is this tooling that needs to be written?
>>  - cwebb
>>

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket...@googlegroups.com.

Alexander Shopov

unread,
Oct 2, 2019, 7:36:55 AM10/2/19
to Roman Klochkov, Racket Users
String constants:

I agree they do not support plurals and context, which should mean it would be possible to convert the s-expressions (of Racker messages, not the general case) to po-file and back again.
There are better tools to edit the translations in po-format compared to doing that directly as s-expressions.
Kind regards:
al_shopov

To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/3505fe7a-8383-476a-ac85-5b903b6cda40%40googlegroups.com.

Roman Klochkov

unread,
Oct 11, 2019, 4:10:29 AM10/11/19
to Racket Users
 It is not possible to translate po-file to string-constants, because
msgid "One file removed"
msgid_plural "%d files removed"
msgstr[0] "%d slika je uklonjena"
msgstr[1] "%d datoteke uklonjenih"
msgstr[2] "%d slika uklonjenih"
cannot be represented in string-constants.

And vice versa,
(dont-exit "Cancel")
(dont-quit "Cancel")
cannot be represented in gettext po-file, where english representation is the msgid.

I can easyly write one-way converter
(id "text") 
->
msgid "id"
msgstr "text"
but is it really useful?

среда, 2 октября 2019 г., 16:36:55 UTC+5 пользователь Alexander Shopov написал:

Alexander Shopov

unread,
Oct 12, 2019, 1:49:31 PM10/12/19
to Roman Klochkov, Racket Users
You're overgeneralising. Po-files support more things than string constants format however that is not important in the context of translating Racket. You can convert string constants to po, translate and then convert back.
Comments can become translator comments.
Pointers can be modelled with mshstr contexts.
Maintaining a translation in po is easier than as string constants file.
Regards:
al_shopov

Reply all
Reply to author
Forward
0 new messages