blob: f116beeeaff8e933f1b808a15ed87e866083fe6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
Sorry, plugin API documentation is not written yet. You can use example
plugins bundled with tt-rss and other finished plugins as a starting
point. Ask on the forums if you need help with anything specific.
Plugins may render new preference panes or embed themselves into several
existing one, store data using simple key -\> value data or directly in
the database, modify how articles are rendered, alter feed data, and
many more things.
List of hooks you can use is available in <code>classes/pluginhost.php</code>.
Some javascript hooks are also available <code>(js/PluginHost.js)</code>.
Some example plugins are available in the [samples](https://git.tt-rss.org/git/tt-rss-samples) repository.
## Localization support
See ``time_to_read`` plugin for a complete example here: https://git.tt-rss.org/fox/ttrss-time-to-read
### How to implement
- Plugin translations are placed in a separate Gettext domain (name equals lowercase plugin class).
- Translation (.po) file in ``(plugin dir)/locale/LANG/`` name should correspond to Gettext domain name.
### How to use
- On the PHP side, either use ``P__``, ``P__ngettext``, etc. shortcut functions defined in ``classes/pluginhost.php`` or call ``_dgettext`` group of functions directly.
- On the Javascript side, translations are combined together, so you can use the usual ``__()`` shortcut function.
|