general/other translatelocally added to my freebsd-nixpkgs project

translatelocally features:

Fast and secure translation on your local machine with a GUI, powered by marian and Bergamot.

translateLocally supports importing custom models.
translateLocally uses the Bergamot fork of marian.
As such, it supports the vast majority marian models out of the box.


It works with your gpu and translates as you type
but it only has a limited number of languages

you can add extra repositories to provide more languages but i have only found 3


My freebsd-nixpkgs project allows you to install application
with the nixpkgs package manager in a Podman container with cuda support

freebsd-nixpkgs project


translatelocally install



I have only managed to find these language model links

Bergamot: https://translatelocally.com/models.json

OpusMT: https://object.pouta.csc.fi/OPUS-MT-models/app/models.json

HPLT: https://raw.githubusercontent.com/hplt-project/bitextor-mt-models/refs/heads/main/models.json

Bergamot is the default and you have to add the other two


translateLocally use the same engine as Firefox uses for local translation

So in theory you should be able to get the links to the models Firefox use's for translation
and then use them with translateLocally

There is a Firefox models.json file but it not compatible with translateLocally
because it not in the same format as the above links



I wasted a couple of hours trying to get Gemini to create a python script to convert the firefox models.json file
into the correct format for translateLocally but it totally failed

I had to repeat the task every 2 minutes over 20 times before i gave up


Converting the Firefox models.json file into the correct format for translateLocally
would enable you to have a locally hosted translation powered by the gpu

Using either the gui or on the command line

Instead of using google translate on the web
or the translate-shell command line tool which use google and bing in the backend

Trying to convert the firefox models.json file which i think has 143 languages by hand would be a pain

I would have to try one language and then see if the format is correct and actually works
Before working my way through the file

But it would be much easier if it was possible to use python or something to convert file


Im British and we have mastered an advanced linguistic technique
that allows us to communicate with anyone in the world without knowing their language

Its called point and shout


But people in other countries havent mastered the technique yet
so having local translation could be useful for them



20260826_00h29m21s_grim.png
 
I have figured out how to use the Firefox models
and then package them so you can import them into translatelocally

I have written a guide on how you package the files
But i will have to add more languages to the guide that arent available with the default repo
 
Heres the English to Italian Translation

English:

I have created a English to Italian locally hosted translation tar.gz file
that works with translatelocally, it uses the firefox models for translation

It took a while to figure out how to repackage the models listed in the Firefox models.json file

I have added translatelocally to my freebsd-nixpgs project
and it translates as you type and uses the gpu

Next i need to create a Italian to English

But it mean you have self hosted translation without having to use Google Translate
or translate-shell on the command line

Very cool

Can you check how accurate the English to Italian translation is


Italian:

Ho creato un file di traduzione di tar.gz ospitato localmente in inglese
che funziona con translatelocalmente, utilizza i modelli firefox per la traduzione

Ci è voluto un po’ per capire come riconfezione dei modelli elencati nel file di Firefox models.json

Ho aggiunto translatelocalmente al mio progetto freebsd-nixpgs
e si traduce come si digita e utilizza il gpu

Successivamente ho bisogno di creare un italiano per l'inglese

Ma significa che hai la traduzione self hosted senza dover usare Google Translate
o tradurre-shell sulla riga di comando

Molto cool

Può verificare quanto è precisa la traduzione inglese a italiano


Screenshot:

20260826_19h05m14s_grim.png
 
Italian and French Translation done

English

FreeBSD is an operating system for a variety of platforms which focuses on features, speed, and stability. It is derived from BSD, the version of UNIX® developed at the University of California, Berkeley. It is developed and maintained by a large community.

to French

FreeBSD est un système d'exploitation pour une variété de plates-formes qui se concentre sur les fonctionnalités, la vitesse et la stabilité. Il est dérivé de BSD, la version d'UNIX® développée à l'Université de Californie à Berkeley. Il est développé et entretenu par une grande communauté.

Working on German next
 
Back
Top