When うち, (sometimes seen using the kanji 内(うち), or 裡(うち)) is paired with the 格助詞(かくじょし) (case marking particle)
に, it expresses a period/space ‘within’ which something else will/should happen/exist. It quite often (but not always) carries the nuance of (A) being the ‘best’, or the ‘optimal’ time/space within which (B) could occur/exist. In English,
うちに can simply be translated as ‘while’, or ‘during’.
うちに may be paired with the ている form of verbs, the plain form of
い-Adjectives, nouns followed by の, or
な-Adjectives that are followed by な.
-
彼(かれ)と毎日(まいにち)会(あ)っているうちに、だんだんと彼(かれ)の事(こと)が好(す)きになってきた。
As I've been meeting with him everyday, I have gradually come to like him. (As I spend more time with him every day, I have grown to like him)
熱(あつ)いうちに食(た)べて!
Eat it while it's hot!
お爺(じい)ちゃんがまだ元気(げんき)なうちに家族(かぞく)皆(みんな)で旅行(りょこう)に行(い)こう!
Let's all go on a family trip while grandpa is still healthy!
今(いま)のうちに明日(あした)の準備(じゅんび)をしておこう。
Let's get ready for tomorrow while we have time. (Before it is too late)
Unlike
間(あいだ)に,
うちに expresses something that can happen/exist anywhere ‘within’ the span of (A), and is therefore non-specific as to where (B) is located.
-
運転(うんてん)している間(あいだ)に眠(ねむ)くなったので、コンビニで休憩(きゅうけい)をした。
I got sleepy while driving, so I took a break at a convenience store. (While in the process of driving)
運転(うんてん)しているうちに眠(ねむ)くなったので、コンビニで休憩(きゅうけい)をした。
I got sleepy while driving, so I took a break at a convenience store. (At one point while driving)
The kanji 裡(うち) refers literally to the inner walls/lining of something, and anything that is enclosed within that space. This can be thought of as where the ‘non-specificity’ of うち comes from, in regard to where within that space something is.