Skip to content

Commit

Permalink
Merge pull request #19 from ubclaunchpad/fix-capital-letters
Browse files Browse the repository at this point in the history
Fixed capitilzation issue with error message
  • Loading branch information
AlexLuo602 authored Feb 4, 2025
2 parents 05ea9cc + 7171ef9 commit 7396940
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion i18nilize/src/internationalize/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def handle_invalid_file(self, language_file):
with open(language_location, "r") as file:
json.load(file)
except json.JSONDecodeError as e:
return "Invalid Language File, try fixing the json format."
return "Invalid language file, try fixing the json format."
except Exception as e:
print(f"Unexpected Error: {e}")
raise e
Expand Down
2 changes: 1 addition & 1 deletion i18nilize/tests/resources/error_handling/expected.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"invalid_file.json": "Invalid Language File, try fixing the json format.",
"invalid_file.json": "Invalid language file, try fixing the json format.",
"empty_keys.json": "Key is empty or contains only whitespace.",
"non_string_values.json": "Value is not a string.",
"combined_issues.json": "Value is not a string."
Expand Down
4 changes: 2 additions & 2 deletions i18nilize/tests/test_error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def test_combined_issues(self):

def test_invalid_file_individual(self):
language = "invalid_file.json"
self.assertEqual(self.handler.handle_invalid_file(language), "Invalid Language File, try fixing the json format.")
self.assertEqual(self.handler.handle_invalid_file(language), "Invalid language file, try fixing the json format.")

# ================== Test Error Handler ================================
def test_invalid_file(self):
print("invalid File Test: ")
language = "invalid_file.json"
self.assertEqual(self.handler.handle_error(language), "Invalid Language File, try fixing the json format.")
self.assertEqual(self.handler.handle_error(language), "Invalid language file, try fixing the json format.")

def test_non_string_values(self):
language = "non_string_values.json"
Expand Down

0 comments on commit 7396940

Please sign in to comment.