Uncountable product of separable spaces is separable? [duplicate]

A product $X=\prod_{\alpha\in A}X_\alpha$ of non-trivial separable spaces is separable if and only if $|A|\le 2^\omega=\mathfrak{c}$. (By non-trivial I mean that a space does not have the indiscrete topology; for $T_1$ spaces this simply means that it has at least two points.) This is the countable case of the Hewitt-Marczewski-Pondiczery theorem. Hewitt’s original paper can be found here. This result itself is Theorem $16.4$c in Willard’s General Topology; it is also proved here at Ask a Topologist by Henno Brandsma.

Added: Here’s a sketch of the construction of a countable dense subset of $X$ when $|A|\le 2^\omega$. Without loss of generality assume that $|A|=2^\omega$, and identify $A$ with $\Bbb R$. For $\alpha\in\Bbb R$ let $D_\alpha=\{y_\alpha(k):k\in\Bbb N\}$ be a countable dense subset of $X_\alpha$. Let $F=\{q_1,\ldots,q_n\}$ be any finite set of rational numbers with $q_1<\ldots<q_n$, and let $\sigma=\langle m_0,\ldots,m_n\rangle\in\Bbb N^{n+1}$ be any $(n+1)$-tuple of natural numbers. Define a point $x^{F,\sigma}=\langle x_\alpha^{F,\sigma}:\alpha\in\Bbb R\rangle\in X$ as follows:

$$x_\alpha^{F,\sigma}=\begin{cases} y_\alpha(m_0),&\text{if }\alpha<q_1\\ y_\alpha(m_k),&\text{if }q_k\le\alpha<q_{k+1}\text{ for some }k\in\{1,\ldots,n-1\}\\ y_\alpha(m_n),&\text{if }q_n\le\alpha\;. \end{cases}$$

Then

$$D=\left\{x^{F,\sigma}:F\subseteq\Bbb Q\text{ is finite and }\sigma\in\Bbb N^{|F|+1}\right\}$$

is a countable dense subset of $X$.