1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

[Docs] Update Plugin Docs

This commit is contained in:
David Sangrey 2024-04-22 18:32:19 -04:00
parent c62592e95e
commit 10be2c2031
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC

View File

@ -1193,19 +1193,17 @@ widget if you need to display routine status information.
## Localisation
You can localise your plugin to one of the languages that EDMarketConnector
itself supports. Add the following boilerplate near the top of each source
itself supports. Add the following import near the top of each source
file that contains strings that needs translating:
```python
import l10n
import functools
_ = functools.partial(l10n.Translations.translate, context=__file__)
from l10n import translations as tr
```
Wrap each string that needs translating with the `_()` function, e.g.:
Wrap each string that needs translating with the `tr.tl()` function, e.g.:
```python
somewidget["text"] = _("Happy!")
somewidget["text"] = tr.tl("Happy!")
```
If you display localized strings in EDMarketConnector's main window you should