Confusion about conditional だと used in article about beetle


I was reading this
[article](https://www3.nhk.or.jp/news/easy/k10011476591000/k10011476591000.html)
and I am not too sure about sentence I came across.

> 男の子は「... 珍しいカブトムシ **だとわかってとてもうれしいです** 」と話していました。

I have a few problem areas here. I read it as: The boy said 'If the beetle is
rare then understand and very happy'

I believe だと is being used a a conditional here. So to me the part 珍しいカブトムシだと
means: If/When the beetle is rare. But After that it falls a part as I'm not
sure how わかってとてもうれしい should be handled




だと is not being used as a conditional. In fact, と is being using as a
quotation particle. When using the verb わかる to express that you understand a
statement, you use the form:

`statement + とわかる`.

In this case the statement would be 珍しいカブトムシだ (i.e. it’s a rare beetle).

In this case we also have わかる in its て form to produce the compound sentence:

The boy said ‘I know that it’s a rare beetle _and_ I’m very happy about it’.

(Or something along those lines)




だと is not being used as a conditional. In fact, と is being using as a
quotation particle. When using the verb わかる to express that you understand a
statement, you use the form:

`statement + とわかる`.

In this case the statement would be 珍しいカブトムシだ (i.e. it’s a rare beetle).

In this case we also have わかる in its て form to produce the compound sentence:

The boy said ‘I know that it’s a rare beetle _and_ I’m very happy about it’.

(Or something along those lines)

