Elinvention / gnome-shell-extension-nasa-apod

Change your wallpaper daily to the NASA's astronomy picture of the day
https://extensions.gnome.org/extension/1202/nasa-apod/
GNU General Public License v3.0
120 stars 23 forks source link

How to translate a Glade UI? #30

Closed Elinvention closed 4 years ago

Elinvention commented 4 years ago

Currently the preferences window remains not translated. As always I can't find anything online regarding gnome shell extensions, so I have no clue how to fix this issue. If you know how, please tell me!

vav4eg commented 4 years ago

I am not a programmer and I'm sorry if my advice is stupid. But I had a problem translating to gnome shell extensions. Maybe this will help you somehow? https://github.com/home-sweet-gnome/dash-to-panel/issues/668

Elinvention commented 4 years ago

I finally made it work, thanks! The solution wasn't as simple as renaming a folder, but I compared my code with that extension's code and then I found this helpful page https://wiki.gnome.org/Projects/GnomeShell/Extensions/Writing. If you can translate in Russian, I'd be glad to add it. I can help you if you have issues with Poedit.

vav4eg commented 4 years ago

I am a new user in Linux. Could you tell us in more detail what I need to do. I found the nasa_apod.pot file through my search. I had it at a different address. I translate it into Russian, and then?

Elinvention commented 4 years ago

You can open Poedit, then click on "Create New Translation" and open the nasa_apod.pot file. Then choose language and you are ready to translate. When you are done save it in locale/ru/LC_MESSAGES/nasa-apod.po (I saw that other extensions put po files in po/, I'll probably do that too as it's easier).

vav4eg commented 4 years ago

Good afternoon, I made a translation in Poedit and saved it under the name nasa-apod.po and the nasa-apod.mo file itself was saved next to it. I do not quite understand where to save the nasa-apod.po file, I set the LC_MESSAGES folder through a search in the .local / folder, and here are the paths that were found with me: https://ibb.co/9Vdmmjn Please tell me where to save it and what needs to be done after saving? reboot?

The file nasa_apod.pot was at my address: .local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh/locale

vav4eg commented 4 years ago

How do you send a translation of localization into Russian?

vav4eg commented 4 years ago

I seem to understand what needs to be done. I created a new path for translation files .local / share / gnome-shell / extensions / nasa_apod @ elinvention.ovh / locale / ru / LC_MESSAGES and saved nasa-apod.po and nasa-apod.mo there Rebooted the system, but nothing has changed. I probably need to reinstall the application?

Elinvention commented 4 years ago

Yes that is correct. It should work that way. Note that it will work only for the extension's indicator, the settings will hopefully work when I will release the new version in the next few days.

Elinvention commented 4 years ago

By the way, you can send me the po file over here, if you don't know how to use git. I should probably set up a more translator friendly environment.

vav4eg commented 4 years ago

I do not know how to place the translation file here.

Do I understand correctly that the translation will work when updating the extension? Prior to the upgrade, doesn't it work?

vav4eg commented 4 years ago

I checked on the extension indicator. no changes.

vav4eg commented 4 years ago

I led in the locale terminal and it bothers me that the line is empty LANGUAGE = Maybe that's why my translation doesn’t work for me? locale

LANG=ru_RU.UTF-8
LANGUAGE=
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
Elinvention commented 4 years ago

You can upload by drag and drop: image

It's strange, the indicator should translate... I tested both Italian and Japanese. In my case I don't even have LANGUAGE, the important one is LANG. Maybe you can try to rename locale/ru to locale/ru_RU. Also you don't have to reboot your system. Use CTRL + F2 then type r and enter. This will reload all your extensions.

vav4eg commented 4 years ago

renamed locale / ru to locale / ru_RU, unchanged :-(

Here is the translation (thanks, now I know how to make an attachment) nasa-apod.zip

Elinvention commented 4 years ago

I set my language to Russian and tested with the file you gave me and it works. In the mean time, if you want, you can try testing the latest version of the extension, see README.md.

vav4eg commented 4 years ago
$ make
intltool-extract --type=gettext/glade Settings.ui
make: intltool-extract: Команда не найдена
make: *** [Makefile:34: Settings.ui.h] Ошибка 127
vav4eg commented 4 years ago

I solved the problem like this: sudo apt install intltool

make installworked.

Thank you so much! Everything works perfectly and in Russian !!! Thank you for resolving this issue!