How do I go about translating my own version of Linux Mint?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Rejsi
Level 1
Level 1
Posts: 7
Joined: Fri Jun 24, 2016 1:54 pm

How do I go about translating my own version of Linux Mint?

Post by Rejsi » Fri Jun 24, 2016 3:04 pm

I feel dumb asking this question, but how would I do this? I'm not talking about switching to an already translated version, I'm talking about starting from scratch. Some background: I'm a fan of constructed languages and interested in trying to do this for a particular constructed language. Again, I am not talking about already created translations like Esperanto.

Thanks!

(running 17.3 Cinnamon by the way)

User avatar
xenopeek
Level 24
Level 24
Posts: 24134
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How do I go about translating my own version of Linux Mint?

Post by xenopeek » Sat Jun 25, 2016 2:19 am

That would involve defining your own locale and providing a translation file for that locale for each and every program installed on your computer (for all the strings of text in those programs). Not all programs will the use same method here and for some programs (like popular web browsers) you may have to figure out how/where to add translations specifically for those. It's a huge undertaking.
Image

Rejsi
Level 1
Level 1
Posts: 7
Joined: Fri Jun 24, 2016 1:54 pm

Re: How do I go about translating my own version of Linux Mint?

Post by Rejsi » Sat Jun 25, 2016 3:02 am

xenopeek wrote:That would involve defining your own locale and providing a translation file for that locale for each and every program installed on your computer (for all the strings of text in those programs). Not all programs will the use same method here and for some programs (like popular web browsers) you may have to figure out how/where to add translations specifically for those. It's a huge undertaking.
Ok, well let's start with the basics. I'm just talking about the base Mint system right now, not every program on my computer. Where would I begin?

User avatar
xenopeek
Level 24
Level 24
Posts: 24134
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How do I go about translating my own version of Linux Mint?

Post by xenopeek » Sat Jun 25, 2016 3:18 am

Lot's of googling I think. You'll first have to define and create a new locale. I don't know how to do that.
Image

Rejsi
Level 1
Level 1
Posts: 7
Joined: Fri Jun 24, 2016 1:54 pm

Re: How do I go about translating my own version of Linux Mint?

Post by Rejsi » Sat Jun 25, 2016 3:23 am

xenopeek wrote:Lot's of googling I think. You'll first have to define and create a new locale. I don't know how to do that.
It looks like I can actually do it myself with a .po editor to edit .po files (translation files). gtranslator is a pretty basic one that I just installed. My problem is that I need a .po file of the English version of Linux Mint, which I have no idea how to get. I requested a download of one on the launchpad translation hub for Mint, and it said it should email it to me, but it did not do so.

Edit: Perhaps their servers are just under a bit of a load right now.

User avatar
xenopeek
Level 24
Level 24
Posts: 24134
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How do I go about translating my own version of Linux Mint?

Post by xenopeek » Sat Jun 25, 2016 3:41 am

Sure you can edit .po files; you'd normally create new .po files for an existing locale that doesn't have translations yet. So you can choose to misuse an existing locale for your purposes and just overwrite the translations for that one. I though you would have wanted to add your own locale first, so you don't need to overwrite anything. Any existing files you edit and overwrite will just be reverted back to their original if the software is updated. Hence the suggestion to create your own locale first, and then add translations for that locale and thus avoiding your work being thrown away on updates.
Image

Rejsi
Level 1
Level 1
Posts: 7
Joined: Fri Jun 24, 2016 1:54 pm

Re: How do I go about translating my own version of Linux Mint?

Post by Rejsi » Sat Jun 25, 2016 3:47 am

xenopeek wrote:Sure you can edit .po files; you'd normally create new .po files for an existing locale that doesn't have translations yet. So you can choose to misuse an existing locale for your purposes and just overwrite the translations for that one. I though you would have wanted to add your own locale first, so you don't need to overwrite anything. Any existing files you edit and overwrite will just be reverted back to their original if the software is updated. Hence the suggestion to create your own locale first, and then add translations for that locale and thus avoiding your work being thrown away on updates.
Oh, I didn't know that updates can potentially wipe my progress if I just overwrite an existing language! Thanks for the heads up!

Is it even possible to add something like that? What sort of search terms would you suggest I use? A preliminary search only reveals people adding locales that are already "in existence" to their systems.

User avatar
xenopeek
Level 24
Level 24
Posts: 24134
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How do I go about translating my own version of Linux Mint?

Post by xenopeek » Sat Jun 25, 2016 4:01 am

Quick search for "create new Linux locale" finds me few relevant links. Looks like you'll need to create a Glibc locale file.

Tips on creating a new system locale on Ubuntu:
http://askubuntu.com/questions/653008/h ... tem-locale

Wiki page on Glibc locales which covers what is in a Glibc locale file:
https://sourceware.org/glibc/wiki/Locales

A web editor with which you can interactively edit locales and export them to Glibc format. You could use an existing locale as your template:
http://lh.2xlibre.net/locales/
Image

Rejsi
Level 1
Level 1
Posts: 7
Joined: Fri Jun 24, 2016 1:54 pm

Re: How do I go about translating my own version of Linux Mint?

Post by Rejsi » Sat Jun 25, 2016 4:04 am

Ah, thank you very much! You've been very helpful! It looks like I've got some material to read. :)

User avatar
Pjotr
Level 21
Level 21
Posts: 13725
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How do I go about translating my own version of Linux Mint?

Post by Pjotr » Sat Jun 25, 2016 5:03 am

It's actually very simple. I'm a Dutch translator myself, so I know how the system works. My approach would be:

1. Download the .po files of all translatable packages, from an existing language like "English (United Kingdom)":
https://translations.launchpad.net/linu ... lang/en_GB

2. Then edit them with Gedit or another simple text editor. In the .po files, you find the source text (American English) and the translation (in this case: UK English). Just replace the UK English strings by your own language.

3. When you're done, transform the .po files to .mo files with poedit:

Code: Select all

sudo apt-get install poedit
4. Then put the .mo files in the right places. Most of them are in: /usr/share/locale/YourLanguage/LC_MESSAGES
.... and some in: /usr/share/locale-langpack/YourLanguage/LC_MESSAGES.

5. Then select your new language and reboot.

I regularly create my own .mo files for Dutch, in order to test my translations before I upload them to Launchpad. That way, I can check whether there are errors in my translations before I "go live" with them. :)
Tip: 10 things to do after installing Linux Mint 19.2 Tina
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

Post Reply

Return to “Newbie Questions”