summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfox <[email protected]>2019-03-01 11:33:41 +0000
committerfox <[email protected]>2019-03-01 11:33:41 +0000
commit8cd3c68934269df205a62daee44cca8fc638ff54 (patch)
tree51d1b3c9dd1e74f3b53874a30e17ad2b987b73ba
parent91333eff5149c09bca95788ad20937885e9748b8 (diff)
Update page 'MakingPlugins'
-rw-r--r--MakingPlugins.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/MakingPlugins.md b/MakingPlugins.md
index 9303115..1b7d001 100644
--- a/MakingPlugins.md
+++ b/MakingPlugins.md
@@ -11,3 +11,13 @@ 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
+
+- Plugin translations are placed in a separate Gettext domain (name equals to lowercase plugin class).
+- Translation (.po) file in ``(plugin dir)/locale/LANG/`` name should correspond to Gettext domain name.
+- 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.
+