Skip to content

Commit

Permalink
Track strings even when failing to translate them
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Dec 6, 2024
1 parent de854f4 commit e0ea443
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,16 @@ def __call__(self, untranslated):
This is the function which is called when a plugin runs _()"""
if untranslated.__class__ is InternationalizedString:
untranslated = untranslated._original
originalUntranslated = untranslated._original
else:
originalUntranslated = untranslated

normalizedUntranslated = normalize(untranslated, True)
normalizedUntranslated = normalize(originalUntranslated, True)
try:
string = self._translate(normalizedUntranslated)
return self._addTracker(string, untranslated)
except KeyError:
return untranslated
string = untranslated
return self._addTracker(string, untranslated)

def _translate(self, string):
"""Translate the string.
Expand Down

0 comments on commit e0ea443

Please sign in to comment.