Skip to content

Commit 5bca131

Browse files
Docu cleanup
Minor cleanups across the codebase: switch current_user.get_last_language() to current_user.last_language to use the attribute directly; fix indentation in app mail init comment; correct typo in module-base.js comment; add IntersectionObserver root comment in tiles.js; small content/metadata and formatting edits in several nihongo lesson markdown files (add keywords, correct kana/phrasing, remove extraneous separators and fix trailing newlines); and add a brief comment in the lesson-directory template. These changes improve readability, searchability, and correctness. Signed-off-by: Rishi Sahasrabuddhe <149483886+Rishi-Sahasrabuddhe@users.noreply.github.com>
1 parent c81af8c commit 5bca131

8 files changed

Lines changed: 20 additions & 21 deletions

File tree

lingual/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def create_app():
6262
login_manager.init_app(app)
6363
migrate.init_app(app, db)
6464
if app.config.get('ALLOW_SEND_EMAILS'):
65-
# Mail is only initialised if email sending is allowed
66-
# to avoid unnecessary setup in environments where email is not used.
65+
# Mail is only initialised if email sending is allowed
66+
# to avoid unnecessary setup in environments where email is not used.
6767
mail.init_app(app)
6868

6969
# Register all blueprints

lingual/main/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def account():
539539
flash(f"{target_language.app_name} removed from your account.", "success")
540540

541541
# If deleted current language, redirect to app directory
542-
if current_user.get_last_language() == action_language_code:
542+
if current_user.last_language == action_language_code:
543543
return redirect(url_for('main.app_directory'))
544544
else: # Otherwise, redirect to account
545545
return redirect(url_for('main.account'))

lingual/modules/nihongo/data/grammar/lessons/setting-expectations.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ In this lesson, we will learn how to express expectations and assumptions in Jap
1111
## Formation
1212
The structure for using はず is as follows:
1313

14-
---
15-
1614
:::blockquote Verb (plain form, any tense) + はずだ :::
1715

1816
-[まい][にち][べん][きょう]する**はずだ** → I am expected to study every day.
1917
- 遅くならない**はずだ** → I expect not to be late.
2018
-[かれ]は来[]れる**はずだ** → I expect that he can come.
2119

22-
---
23-
2420
:::blockquote Adjective (plain form, any tense) + はずだ :::
2521

2622
- この映[えい][]は面[おも][しろ]**はずだった** → I expected this movie to be interesting.
@@ -29,16 +25,12 @@ The structure for using はず is as follows:
2925

3026
/i Note that the な from な adjective is retained before はずだ. \
3127

32-
---
33-
3428
:::blockquote Noun + の + はずだ :::
3529

3630
-[かれ]は医者[いしゃ]**はずだ** → He is expected to be a doctor.
3731
- 今日は休[きゅう]みの**はずだ** → Today is expected to be a holiday.
3832
-[かれ][じょ]は学生[がくせい]**はずだ** → She is expected to be a student.
3933

40-
---
41-
4234
If the noun is in the past tense, use だった before はずだ.
4335

4436
:::blockquote Noun + だった + はずだ :::
@@ -47,6 +39,4 @@ If the noun is in the past tense, use だった before はずだ.
4739
- 昨日[きのう]は晴[]れだった**はずだ** → Yesterday was expected to be sunny.
4840
-[かれ][じょ]は友達[ともだち]だった**はずだ** → She was expected to be a friend.
4941

50-
---
51-
5242
~quizzes:setting-expectations:quiz?shuffle&limit=5~

lingual/modules/nihongo/data/grammar/lessons/using-kata.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22

3-
title: "Using ~方[かた]"
4-
summary: "Learn how to use the ~方[かた] construction in Japanese to express 'the way of doing something.'"
3+
title: "Using ~方"
4+
summary: "Learn how to use the ~方 construction in Japanese to express 'the way of doing something.'"
5+
keywords:
6+
- kata
7+
- かた
58

69
---
710

@@ -18,10 +21,10 @@ This is used to describe how to do something or the method of performing an acti
1821

1922
For example:
2023

21-
- 日本[にほん][]の勉強[べんきょう]の仕方[しかた]を教[おし]えてください。→ Please teach me the way of studying Japanese (Please teach me how you study Japanese).
22-
- この料理[りょう][]の作[つく]り方[かた]を知[]っていますか。→ Do you know how to make this dish?
24+
- [][ほん][]の勉強[べんきょう]し方[かた]を教[おし]えてください。→ Please teach me the way of studying Japanese (Please teach me how you study Japanese).
25+
- この料[りょう][]の作[つく]り方[かた]を知[]っていますか。→ Do you know how to make this dish?
2326
- パソコンの使[つか]い方[かた]を学[まな]びたいです。→ I want to learn how to use a computer.
2427

25-
/w Note that 方[かた] is pronounced かた, NOT ほう! \
28+
/w is pronounced かた, NOT ほう, in this structure. \
2629

27-
~quizzes:using-kata:quiz?shuffle&limit=5~
30+
~quizzes:using-kata:quiz?shuffle&limit=5~

lingual/modules/nihongo/data/grammar/lessons/using-komaru.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
title: Using ~困る to Express Difficulty
44
summary: Learn how to use the ~こまる construction in Japanese to express difficulty or trouble in doing something.
5+
keywords:
6+
- komaru
7+
- komarimasu
58

69
---
710

@@ -13,8 +16,9 @@ To express that you are troubled, annoyed, or having difficult time doing someth
1316
/t Our て-Form lesson covers て-Form conjugations of both [verbs](grammar:te-form) and [adjectives](grammar:te-form#-form-of-adjectives) \
1417

1518
Here are some examples of how to use the ~困[こま]る construction in sentences:
19+
1620
- ネットが遅[おそ]くて困[こま]る。→ The internet is slow, and it's causing me trouble.
1721
- 仕事に行かないといけなくて、雨[あめ]が降[]って困[こま]る。→ I have to go to work, and the rain is making it difficult.
1822
- 日本語が難[むずか]しくて困[こま]る。 → Japanese is difficult, and I'm having trouble with it.
1923

20-
~quizzes:using-komaru:quiz?shuffle~
24+
~quizzes:using-komaru:quiz?shuffle~

lingual/static/js/module-base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function initResponsiveNav() {
8282
return shouldCollapse;
8383
};
8484

85-
/** Update nav bar state dependaing on overflow */
85+
/** Update nav bar state depending on overflow */
8686
const updateNav = () => {
8787
const wasOpen = nav.classList.contains('nav-open');
8888
const shouldCollapse = isOverflowing();

lingual/static/js/tiles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class BaseTilePage {
119119
});
120120
},
121121
{
122+
// Use the tiles list as the root for intersection to trigger when tiles come into view within the list, with some margin to trigger slightly before they are fully in view.
122123
root: this.list,
123124
rootMargin: '60px',
124125
threshold: 0.2

lingual/templates/lesson-directory-macro.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h3 class="lesson-title">{{ lesson.title | sanitise | safe }}</h3>
5050

5151
<script src="https://cdn.jsdelivr.net/npm/fuse.js@7.0.0/dist/fuse.min.js">
5252
// Import Fuse.js for fuzzy searching
53+
// Allows for the zero-dependency library to work
5354
</script>
5455

5556
<script>

0 commit comments

Comments
 (0)