From ebca10662d5f0f1915ac0152d69d7cfb7d69950a Mon Sep 17 00:00:00 2001 From: A3 Date: Mon, 20 May 2024 13:25:29 +0200 Subject: [PATCH] Update README.md How to add comments --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 0a6ae5c..80328bd 100644 --- a/README.md +++ b/README.md @@ -87,3 +87,20 @@ Finally save the changes: ```python T.save('translations') ``` +## Adding comments +You can add comments to the original language by using a comment marker. +This can be useful if you want to translate a specific section. + +Initialise the Translator with the marker you want to use (default is None): +```python +T = Translator('translations', comment_marker="##") +``` +Use it like this: +```python +msg = T("Beginner's Guide to Python## Title chapter 1") +``` +If there is no translation available it will show only the part before the marker. +```python +>>> print(msg) +Beginner's Guide to Python +```