Q: How can I change the displayed name of an app on the app grid?

Q: How can I change the displayed name of an app on the app grid?
In other words, where is the name of the app’s icon on the app grid located in the translation file?

I searched in /usr/share/translations, found all the language files for the apps, but don’t know where the displayed name on app grid is located in the file.
How does the syntax resp. the system of these language files work?

Hmm, just changing: /usr/share/applications/APPNAME.desktop Name attribute works for me?

1 Like

Doesn’t require restarting lipstick either. Almost immediately picked up when flicking back and forth …

1 Like

Had a look into /usr/share/applications and found the app starter files of the app grid.

There are the english names of the starter icons defined. But my problem is, that I can’t find the german name and change it.

Hence I imagine the german app name somewhere in the translation files in /usr/share/translations/.

It’s the SMS app which is labelled in german ‘Nachrichten’, that i want to change into ‘SMS’ or ‘S.M.S.’ for better readability at the first glance.

One defines the names all in desktop file.
maybe they are just not translated.
look into olive-does…desktop. This is translated to german. There you should see them

1 Like

It’s in the Name[de] key of the .desktop file.
Note that files in ~/.local/share/applications may override the system .desktop file, so look in there as well.

What does work is copying the file from the system dir to ~/.local, commenting out the translation key and giving whatever Name or Name[de].
Problem is you then you get two appicons on the launcher (and probably in the open with dialog as well). One could hide the duplicates in a launcher folder though.

Some apps might use a key X-MeeGo-Translation-Catalog= and translations will then be in .qm files which you can’t change.

If you reallly want to change it, you could use lconvert do disassemble .qm files to .ts, edit that, compile it again with lrelease and replace the shipped .qm file.

If you want to do that,
X-MeeGo-Translation-Catalog=foo means the translation for German are in /usr/share/translations/foo-de.qm and X-MeeGo-Logical-Id=bar is the key in the decompiled .ts file.



Here an example for the messages application in German:

# install the necessary tool
pkcon install qt5-qttools-linguist 
### find the keys in the .desktop file:
grep X-MeeGo- /usr/share/applications/jolla-messages.desktop
X-MeeGo-Logical-Id=messages-ap-name
X-MeeGo-Translation-Catalog=messages

Let’s start with creating a working directory:

mkdir ~/Documents/language-override
pushd !$

Convert the qm file into an editable format:

lconvert -target-language de /usr/share/translations/messages-de.qm -o my-messages.ts

Now, edit the .ts file deleting all but the key you want to change, taking care to keep the file valid XML. E.g.:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
    <name></name>
    <message>
        <source>messages-ap-name</source>
        <translation>Nachrichten</translation>
    </message>
 </context>
</TS>

Rename the key and put your new translation:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
    <name></name>
    <message>
        <source>messages-ap-name-custom</source>
        <translation>Nchrchtn</translation>
    </message>
 </context>
</TS>

Compile the ts file into an qm file again:

lrelease my-messages.ts -qm my-messages-de.qm

Combine the custom qm with the original into messages-override:

lconvert -o messages-override-de.qm  /usr/share/translations/messages-de.qm  my-messages-de.qm

Copy the custom .qm file (this might work with ~/.local/share/translations, haven’t tried that):

devel-su cp messages-override-de.qm  /usr/share/translations/
# or this, taking care of permissions:
# devel-su install -o root -g root -m 0644 messages-override-de.qm /usr/share/translations/messages-override-de.qm

Now you have a custom translation catalog, with a custom key with your translation inside. Final step is to edit the .desktop file to use it:

[Desktop Entry]
Type=Application
Name=Messages
# original:
#X-MeeGo-Logical-Id=messages-ap-name
#X-MeeGo-Translation-Catalog=messages
# custom translation:
X-MeeGo-Logical-Id=messages-ap-name-custom
X-MeeGo-Translation-Catalog=messages-custom

Note that this will of course break multilanguage support for any other languages including plain English unless you do the same steps for the other languages as well.
Fortunately only the app you edited the .desktop file of will be affected.

8 Likes

@nephros wrote: Some apps might use a key X-MeeGo-Translation-Catalog= and translations will then be in .qm files which you can’t change.

Yes, the X-MeeGo… Entry is present in the SMS (‘Nachrichten’) global desktop file:

Name=Messages
X-MeeGo-Logical-Id=messages-ap-name
X-MeeGo-Translation-Catalog=messages
Icon=icon-launcher-messaging

and there are no related entries present in /home/defaultuser’s hidden dir’s.

Why can’t i change a .qm file? Want to try at least! What file is it?

I have edited my post above with some hints well it’s become an actual guide now ;).

1 Like

Oh, irony that the Canadian would make a German Weather Service app and never test (well, not entirely true) the localization.

I have :

Name=German Weather Service
Name[de]=Deutscher Wetter Dienst
That does not seem to work. I always assumed it would and have really only tested date timestring translation.

All the news has:

Name=All the News
Name[de]=allthenews

Don’t ask why! WIP, etc. But this works. In the German locale, it’s allthenews in the grid. The stubborn Weather Service remains, German. Strange.

So, sometimes setting Name[de] works and sometimes it does not. sigh.

Ah, location, location, location:

I had:

[root@Xperia10II defaultuser]# cat /usr/share/applications/harbour-dwd.desktop
[Desktop Entry]
Type=Application
Icon=harbour-dwd
X-Nemo-Application-Type=silica-qt5
Exec=harbour-dwd
Name=German Weather Service

X-Desktop-File-Install-Version=0.26

[X-Sailjail]
OrganizationName=de.poetaster
ApplicationName=harbour-dwd
Permissions=Internet;Location

#[X-HarbourBackup]
#BackupPathList=.local/share/de.poetaster/harbour-dwd

Name[de]=Deutscher Wetter Dienst

Moving the [de] key such that it directly follows the first Name entry works.

2 Likes

@nephros , you gave me the right hint!

I did the following:

Copy file /usr/share/translations/messages-de.qm to computer,

Open it with GHex Hex editor,

Search for this near the beginning of the file:
…N.a.c.h.r.i.c.h.t.e.n…messages-ap-name…

Overwrite this way:
…S…M…S…messages-ap-name…

Simply overwrite unused letters with 00 and do not delete anything or change the length of the file!!!

Save back on computer.

(I have a File ~/Hacks on the phone)

SFTP to the phone, and
copy messages-de.qm to /home/defaultuser/Hacks to the phone

SSH to the phone and become devel-su

Make a safety copy of the file:
cp /usr/share/translations/messages-de.qm /usr/share/translations/messages-de.qm.bak

Copy modified file to it’s right place and confirm to overwrite:
cp /home/defaultuser/Hacks/messages-de.qm /usr/share/translations/messages-de.qm

restart GUI with Sailfish Utilities

Success!
Thank you so much for your help!

2 Likes

Hex editing, that’s oldschool! Nice that it worked out.

2 Likes

@Seven.of.nine, you may suggest this change at Jolla’s translation site: https://translate.sailfishos.org/

I believe most Germans will intuitively call this app “SMS-App”, but not something generic as “Nachrichten”, hence this change to “SMS” constitutes an improvement, due to not translating this term literally.
But I never have seen “Short Message Service” (though often only addressing an actual, single message) spelled as “S.M.S.” before (in line with Wikipedia).

Edit: As @nephros correctly pointed out, theoretically the messages app can handle other protocols, too. But in practice none of them is usable, except for SMS.

1 Like

In german in common speech we say ‘sms’ to the message itself, e.g. ‘Schreib mir eine SMS, wann du ankommen wirst!’ (‘Write a message when you will arrive’)

So the messages app can be labelled ‘S.M.S.’, like a drawer where the messages are inside, (was my idea for this tweak).

The three dots are for better optical appearence, because SMS without dots is much too narrow and doesn’t look good at the app grid.

@nephros wrote: Hex editing, that’s oldschool! Nice that it worked out.

… And its fun and interesting to have a deep look into the 1’es and zero’s and 0 to F and reveal the secrets :wink:

Is there another way to edit the language translation files?

There is.

  1. Convert the .qm file - lconvert <file_name>.qm -o <file_name>.ts
  2. Edit the .ts file in some text editor or QtLinguist, for example.
  3. Compile the .ts file back - lrelease <file_name>.ts or - lrelease -idbased <file_name>.ts if it’s id based.
3 Likes

Ah but Messages isn’t strictly an SMS application, it’s a Telepathy frontend.

Besides SMS it can send and receive other messages, XMPP is natively ( if baldy) supported, other Telepathy plugins could use it in theory.

2 Likes

On opening the Messages app I can only see my received SMS’es and have the only option to write a new one or after opening a SMS, to answer. In Settings/Apps/Messages are only some app settings and ‘download MMS automatically’. What else can I do with Messages? I’m curious for the hidden functions!

What is XMPP, what is Telepathy?

XMPP is a standardized chat protocol (and a bit more than that), sometimes known as Jabber. It should have become the protocol for instant messaging for the internet (and at one point it looked like it would, both Google and Facebook used it for their messengers. But later both moved away from it, implementing their own proprietary chat protocols.)

Telepathy is a framework which, through plugins, can in theory do all kinds of things like messaging, calling, video calling, and more.

Parts of SFOS use the Telepathy framework, e.g. calls. And SMS/MMS are handled through Telepathy plugins and show up in the Messages application.

In theory, any Telepathy plugin implementing a chat protocol that runs on SFOS (and there is currently AFAIK only the XMPP one), will be able to show messages in the Messaging application, and as a user I can reply through the respective protocol in the Messaging app.

(( Story: At one point I dabbled in getting the Jami software working, which is a mixture of SIP calling and XMPP messaging over obscure networking layers. I did at one point succeed in getting all the libraries etc. compiled and running, including the Telepathy plugin. Without having to do anything in the SFOS GUI, with just a daemon and its Telepathy plugin running in the background, I was able to receive, on the SFOS device, audio and video calls initiated from a Jami Android app . Meaning the daemon in the background just said “I have an incoming audio call, please present it to the user” to the Telepathy framework, and the SFOS GUI on the other side knew what to do and popped up an “incoming call” screen just like it does if you get a regular GSM/…/LTE call.))

2 Likes