### Virtual Method

# Gimp PlugIn set_i18n

since: 3.0

#### Declaration [src]

    gboolean
    set_i18n (
      GimpPlugIn* plug_in,
      const gchar* procedure_name,
      gchar** gettext_domain,
      gchar** catalog_dir
    )

#### Description [src]

This method can be overridden by all plug-ins to customize internationalization of the plug-in.

This method will be called before initializing, querying or running `procedure_name` (respectively with `Gimp.PlugInClass.init_procedures`, `Gimp.PlugInClass.query_procedures` or with the `run()` function set in `gimp_image_procedure_new()`).

By default, GIMP plug-ins look up gettext compiled message catalogs in the subdirectory `locale/` under the plug-in folder (same folder as `gimp_get_progname()`) with a text domain equal to the plug-in name (regardless `procedure_name`). It is unneeded to override this method if you follow this localization scheme.

If you wish to disable localization or localize with another system, simply set the method to `NULL`, or possibly implement this method to do something useful for your usage while returning `FALSE`.

If you wish to tweak the `gettext_domain` or the `catalog_dir`, return `TRUE` and allocate appropriate `gettext_domain` and/or `catalog_dir` (these use the default if set `NULL`).

Note that `catalog_dir` must be a relative path, encoded as UTF-8, subdirectory of the directory of `gimp_get_progname()`. The domain names “gimp30-std-plug-ins”, “gimp30-script-fu” and “gimp30-python” are reserved and can only be used with a `NULL` `catalog_dir`. These will use the translation catalogs installed for core plug-ins, so you are not expected to use these for your plug-ins, except if you are making a core plug-in. More domain names may become reserved so we discourage using a gettext domain starting with “gimp30-“.

When localizing your plug-in this way, GIMP also binds `gettext_domain` to the UTF-8 encoding.

Available since: 3.0

#### Parameters

`procedure_name`

  Type: `const gchar*`

  Procedure name.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`gettext_domain`

  Type: `gchar**`

  Gettext domain. If `NULL`, it defaults to the plug-in name as determined by the directory the binary is called from.

  The argument will be set by the function.
  The argument can be set to `NULL` by the virtual function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`catalog_dir`

  Type: `gchar**`

  Relative path to a subdirectory of the plug-in folder containing the compiled Gettext message catalogs. If `NULL`, it defaults to “locale/”.

  The argument will be set by the function.
  The argument can be set to `NULL` by the virtual function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `gboolean`

`TRUE` if this plug-in will use Gettext localization. You may return `FALSE` if you wish to disable localization or set it up differently.