GIMP 3: How to set up localisation for my plug-in

I have a little plugin SnowCover.py with a directory structure like this:

~/.config/GIMP/3.0/plug-ins/SnowCover
.
├── locale
│   └── de
│       └── LC_MESSAGES
│           ├── SnowCover.mo
│           └── SnowCover.po
└── SnowCover.py -> /home/minty20/GIMP3-plugins/SnowCover.py

In foggify.py I found this as an example

def do_set_i18n(self, procname):
        return True, 'gimp30-python', None

What do I put instead of gimp30-python so my translation is found?

By default, GIMP will look for a locale/ directory under your plug-in folder, and the gettext domain would be the plug-in name.

In other words, you should be good to go here. Just don’t implement set_i18n at all and GIMP should find your .mo file.

You would implement it and replace "gimp30-python" by something else if for instance you were using another localization domain. For instance, set to "plop" if you had a plop.mo file instead of SnowCover.mo.

Thank you. It’s working now.
Thanks for clarifying.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.