add language_code argument to get_tag_choices method
from django.conf import settings
-from django.utils.translation import get_language
import json
import os
@@ -167,19 +166,20 @@ def get_tag_names(language_code: str, tag_field: dict):
return tag_names
-def get_tag_choices():
+def get_tag_choices(language_code: str="en"):
"""
Function that gets all the tags, preferably translated to the user's preferred
language, otherwise the default language
Parameters
----------
+ language_code: str
+ The language code the user has selected on TWL's settings
Returns
-------
tuple
"""
- language_code = get_language()
tag_choices = []
tag_names_default = _read_translation_file("en", "tag_names")
tag_names_lang = _read_translation_file(language_code, "tag_names")
