External resources

GPU Fan Meister can download various third-party resources: plugins, documentation and localization. GPU Fan Meister searches for these resources in specific folders. The list of these folders depends on the operating system. A complete list of folders where GPU Fan Meister will search for resources can be obtained through the --dirs parameter of the command line. When trying to load a resource GPU Fan Meister searches in all search folders and tries to find the resource in a particular subfolder that matches the resource type. The process of searching and loading each resource type is described below.

Plugins

The process of searching and loading plugins is as follows:

  1. All folders are searched in the order returned by the CLI parameter --dirs.

  2. The plugin is searched in the folder <current search folder>/plugins/<plugin identifier>.

  3. If a plugin is found, then this plugin is loaded, and any plugin with the same name will not be loaded from all other search folders.

Example: If you have a search folder /usr/local/share/gpu-fan-meister and a plugin called amd-mesa, GPU Fan Meister will be able to load this plugin from /usr/local/share/gpu-fan-meister/plugins/amd-mesa.

To create your own plugin for GPU Fan Meister, see "Adding support for new video cards and drivers". You can find an example plugin here: https://github.com/alkatrazstudio/gpu-fan-meister/blob/master/plugins.

Documentation

The process of searching and loading a documentation is as follows:

  1. All folders are searched in the order returned by the CLI parameter --dirs.

  2. Look for the folder <current search folder>/docs/<language code>, where <language code> is IETF-code1 of the language of the system locale.

  3. If a folder is found, the documentation from this folder is used. All other folders are ignored.

  4. If no documentation is found in any folder to search for, the last element after the "-" sign is removed from <language code> (zh-TW => zh). The process is then repeated.

  5. If the last element of <language code> is removed and the documentation is still not found, GPU Fan Meister searches the search folders for documentation for the "en" language (which is guaranteed to be present in at least one search folder).

Example: If you have a search folder /usr/local/share/gpu-fan-meister and French Canadian is your system locale, GPU Fan Meister will search the documentation in /usr/local/share/gpu-fan-meister/docs/fr-CA, /usr/local/share/gpu-fan-meister/docs/fr and /usr/local/share/gpu-fan-meister/docs/en.

You can translate the GPU Fan Meister documentation into any language. The documentation is written in reStructuredText and built via Sphinx. The process of localization/internationalization in Sphinx is described here: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html. The script docs/src/build.sh already does a lot of job for you. In summary, you need to do the following:

  1. Clone the main repository:

    git clone https://github.com/alkatrazstudio/gpu-fan-meister

  2. Generate or update PO-files:

    docs/src/build.sh <language IETF-code> po

  3. Translate the PO-files.

  4. Run the documentation build script:

    docs/src/build.sh <language IETF-code>

  5. Move the generated documentation from the folder docs/<language IETF-code> to any search folder.

Localization

The process of searching and loading localization files is as follows:

  1. All folders are searched in the order opposite to the one returned by the CLI parameter --dirs.

  2. Localization files are searched in the <current search folder>/translations and loaded according to Qt rules: https://doc.qt.io/qt-5.12/qtranslator.html#load-1.

  3. If a localization file is found, the translation it contains is added to the already loaded localization files. If there are duplicates of translations, the priority will be given to the last loaded localization.

Example: If you have a search folder /usr/local/share/gpu-fan-meister and German is your system locale, GPU Fan Meister can search for files with translations in /usr/local/share/gpu-fan-meister/translations/de-DE.qm (or other de-*.qm files depending on the locale) and /usr/local/share/gpu-fan-meister/translations/de.qm.

To create your own translation for GPU Fan Meister, see the Qt Linguist Help: https://doc.qt.io/qt-5.12/linguist-translators.html.

Notes

1

Wikipedia article "IETF language tag": https://en.wikipedia.org/wiki/IETF_language_tag.