From 17c6d842690ebff3ca6beb2713606f2df5a73067 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Aug 2023 07:41:14 +0530 Subject: [PATCH] Document using ngettext in plugins --- manual/creating_plugins.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manual/creating_plugins.rst b/manual/creating_plugins.rst index 419e612e5d..38689a1b10 100644 --- a/manual/creating_plugins.rst +++ b/manual/creating_plugins.rst @@ -292,6 +292,11 @@ with the ``CALIBRE_OVERRIDE_LANG`` environment variable set. For example:: Replace ``de`` with the language code of the language you want to test. +For translations with plurals, use the ``ngettext()`` function instead of +``_()``. For example:: + + ngettext('Delete a book', 'Delete {} books', num_books).format(num_books) + The plugin API --------------------------------