diff --git a/wiki-to-md-images.py b/wiki-to-md-images.py index 2036281..095bf06 100644 --- a/wiki-to-md-images.py +++ b/wiki-to-md-images.py @@ -68,9 +68,18 @@ def generate_markdown(topic, download_images): default='yes', help="Specify whether to download images (yes or no).", ) +parser.add_argument( + "--lang", + type=str, + default="en", + help="The 2-letter language code for the Wikipedia page (default: 'en')." +) args = parser.parse_args() +# Set the language for Wikipedia if provided +wikipedia.set_lang(args.lang) + topic = f"{args.topic}" download_images = args.dl_image == 'yes' diff --git a/wiki-to-md.py b/wiki-to-md.py index c190193..80490f1 100644 --- a/wiki-to-md.py +++ b/wiki-to-md.py @@ -47,9 +47,19 @@ def generate_markdown(topic): type=str, help="The topic to generate a markdown file for.", ) +parser.add_argument( + "--lang", + type=str, + default="en", + help="The 2-letter language code for the Wikipedia page (default: 'en')." +) args = parser.parse_args() +# Set the language for Wikipedia if provided +wikipedia.set_lang(args.lang) + topic = f"{args.topic}" generate_markdown(topic) +