There is a definite east asian tradition that states "several years". It can be found in translations of texts from India. I'm not going to cite them all here, though, but here is some (Lamotte, Traite, Vol II, pg. 776), highlighting some key passages I discuss below:
[1. Yaśodharā’s lengthy pregnancy].435 – Moreover, in the Lo heou lo mou pen cheng king (Rāhulamātṛijātaka): The Bodhisattva Śākyamuni had two wives: the first was called K’iu p’i ye (Gopiya or Gopā), the second Ye chou t’o lo (Yaśodharā) or Ye chou t’o lo heou lo mou (Yaśodharā Rāhulamātā). Gopā, being sterile (bandhya), had no children. Yaśodharā knew she was pregnant (garbhiṇī) the same night that the Bodhisattva left home (pravrajita). After his departure, the Bodhisattva practiced asceticism (duṣkaracaryā) for six years; Yaśodharā was pregnant also for six years without giving birth. The Śākyas asked her: “The Bodhisattva has left home; whose fruit are you bearing?” Yaśodharā said: “I have not committed adultery; the son that I bear in my womb is truly the descendant of the crown prince (Śākyamuni).” The Śākyas continued: “Why are you so long in giving birth?” She answered that she did not know [the reason]. In public discussion, the Śākyas asked the king [Śuddhodana]to inflict a suitable punishment on her. Gopā said to the king: ”I would like you to absolve Yaśodharā; I have always stayed with her, I am her witness (sākṣin) and I know that she has not committed any sin. Wait until her son is born and you will see whether or not he resembles his father; it will not be too late to punish her.” Then the king treated Yaśodharā with indulgence.
[In the meanwhile], the Buddha had completed his six years of austerities; the very night that he became Buddha, Yaśodharā gave birth to Rāhula. Seeing that he resembled his father, the king was overjoyed and forgot his anger; he said to his ministers: “Although my son has gone, today he has a son completely like him.” Although Yaśodharā had avoided the shame of punishment, her bad reputation had spread in the kingdom; she sought to wash way this bad name. When Śākyamuni, having attained Buddhahood, returned to Kia p’i lo p’o (Kapilavastu) to convert the Śākyas, king Śuddhodana and Yaśodharā invited him at once to come to dine at the palace. Then Yaśodarā took a potion-cake (modaka) of a hundred flavors and gave it to Rāhula to offer to the Buddha. [182c] At the same time, by his miraculous power (ṛddhibala), the Buddha created five hundred arhats who completely resembled. Rāhula, then seven years old, took the potion-cake, went directly to the Buddha and respectfully offered it to the Bhagavat [thus proving that he discovered his father among the five hundred arhats completely like the Buddha]. Then the Buddha suspended his miraculous power and the five hundred [bhikṣus] resumed their initial aspect: they were seated with empty bowls (dhautapātreṇa), whereas the bowl of the Buddha was the only one that contained a potion-cake. Yaśodharā said to the king: ”This proves that I have committed no sin.” Yaśodarā then asked the Buddha why she had been pregnant for six years.
--- Footnotes ---
435 For this episode, compare the following sources:
Mahāvastu, III, p. 142-143: Learning of Buddha’s return to Kapilavastu, Yaśodharā prepared a cake (modaka) and gave it to Rāhula, telling him to offer it to his father and reclaim the paternal heritage. The Buddha told him to enter the order and then he would receive the paternal heritage. This offer and promise prove that Rāhula is truly the son of the Buddha and that Yaśodharā is without blame.
Fo pen hing tsi king, T 190, k. 55, p. 906c (tr. Beal, Romantic Legend, p. 360): When the Buddha arrived in Kapilavastu, Yaśodharā sent Rāhula to greet his father, and Śuddhodana asked the Buddha if Rāhula is truly is his son. The Buddha answered: “Yaśodharā is perfectly pure and innocent: this one is indeed my son.”
Tsa pao tsang king, T 203, no. 117, k. 10, p. 496b seq. Summarized in Chavannes, Contes, III, p. 136): As a result of her prolonged pregnancy, Yaśodharā was suspected of adultery by her father-oin-law and the Śākyas. They dug a ditch filled with flaming wood and threw Yaśodharā into it. She called upon the Buddha, the flaming ditch was instantaneously transformed into a pool of pure water, in the middle of which Yaśodharā with Rāhula in her arms was sitting on a lotus flower. The Śākyas were convinced of her innocence and Rāhula became the favorite of his grandfather. Six years later the Buddha returned to Kapilavastu and Rāhula recognized his father unheditatingly among the 1250 bhikṣus who resembled him perfectly. The Buddha caressed his sons’s head.
Finally, here is the transaltion of a passage from the Mūlasarv. Vin (T 1450, k. 12, p. 158c-150a): The Buddha was dwelling in Rājagṛha. At the time when the Bodhisattva left his (native) city, Yaśodharā was pregnant (garbhiṇī). When the Bodhisattva was practicing austerities (duṣkaracaryā) for six years, Yaśodharā was also practicing austerities in her palace; this is why her preganancy escaped being noticed. Then, understanding the futility of his ascetic practices, the Bodhisattva took his ease and breathed deeply as he pleased; he took good food and regained his strength; he anointed his body with oil and bathed in warm water. Hearing that, Yaśodarḥa in her palace also relaxed her physical and mental efforts to conform to the conduct of the Bodhisattva; her womb and belly began to develop and enlarge under her joyfulness. Seeing this, the Śākyas jeered at her and said: “While the Bodhisattva, away from the palace, gave himself up to austerities, you in your palace were secretly meeting another man. Now you are pregnant and your belly is getting big!” Yaśodharā swore that she was not guilty. Shortly afterwards, she gave birth to a son, at the very moment when the (demon) Rāhu was eclipsing the moon. Her retinue (parivāra) gathered together to congratulate her. They were invited to give a name to the baby, and being coonsulted, they said: At the moment when this child was born, Rāhu was holding the moon with his hand; he must be given the name of Rāhula.” The Śākyas, discussing together, claimed that this child was not the son of the Bodhisattva. Hearing that, Yaśodharḥa wept. Holding Rāhuula in her arms, she made an oath; she took Rāhula and set him down on the “Bodhisattva”, i.e., on a rock which was once in the palace and which [was consulted] to resolve enigmas. She set this “Bodhisattva” in the pool, making the following vow: “If this child is truly the son of the Bodhisattva, may he float; if he is not, may he sink to the bottom.” She spoke, and Rāhula as well as the rock on which he was placed floated easily. Then Yaśodharā said: “I wish that they go from this shore to the other shore and then come back here”, and it went according to her wish. Seeing that, the crowd cried out at the miracle. Taking up her son, she thought: “The Buddha Bhagavat has practiced austerities for six years; he has attained enlightenment and, since them six more years have passed. Twelve years having passed, he must return here. I will arrange it so that everyone will see the truth with their own eyes.” Then the Bhagavat returned to Kapilavastu; one day he dined in the king’s house; the next day he dined at the palace. Yaśodharā said to herself: Let us find a way that the Bhagavat will bend to my wishes.” At that time there was in the city a heretic woman skillful at making love potions. Yaśodaharā sent her five hundred pieces of gold, asking her to make a potion and bring it to her. This woman made a little cake (modaka) of unique nature and brought it to the palace. Rāhula’s mother took it, and before all the palace people, put it into Rāhula’s hands, saying to him: “My child, take this cake and give it to your father.” The Buddha, endowed with omniscience, understood in advance: he knew that by giving birth to Rāhula, Yaśodharā had been attacked; he wanted to put a stop that very day to the slander. Knowing that, the Bhagavat produced by metamorphosis (nirmāṇa) five hundred individuals looking exactly like himself. Holding the cake in his hands, Rāhula passed by all these, not offering them anything, but he stopped in front of the (true) Buddha and gave him the cake. The Buddha accepted it, then gave it back to Rāhula who took it and swallowed it. The Buddha knew that after having eaten it, he would be under the influence of a spell. {Actually), when the Buddha arose from his seat and went away, Rāhula went with him. The courtesans wanted to prevent him from leaving the palace, but Rāhula wept with anger; he insisted that he would go with the Buddha. On leaving, the Buddha thought: “I know that Rāhula will not take up another existence (punarbhava), that he will realize the fruits of the (Noble) Path (āryaphala) and that he will not want to live in the world.” Knowing that, the Buddha took him away with him. Thanks to his earlier vows (pūrvapraṇidhāna), Rāhula had been able to recognize the Bhagavat in the midst of the five hundred buddhas; he did not want to leave him. Then king Śuddhodhama, the palace people, the retinue and all the Śākyas, seeing this prodigy, were filled with respect for Yaśodharā. They understood the futility of the blame they had thrown on her previously. Free of all blame, Yaśodharā was satisfied.
The visit of the Buddha to Yaśodharā is represented on a stūpa discovered near the village of Goli, (Guntur District): cf. T. N. Ramadhandran, Buddhist Sculptures from a Stupa near the village of Goli, Bull Mus. Madras, a929, p. 5-7, pl. II(F). Rāhula, easily recognized by his head-dress, is represented three times in the same sculpture: on the right, he is respectfully receiving his mother’s orders; in the center, he carefully carries in his right hand the ‘cake potion’ (modaka) that Yaśodharā intended for the Buddha; on the left, he goes to welcome the Buddha who, clothed in the Roman manner with a nimbus and exhibiting the abhayamudrā, is at the gate of the women’s quarters. According to the interpretation of Ramachanran, the Rāhula of the center panel was playing ball; but the round object he holds seems rather to be the modaka that he was told to offer to his father according to the story of the Mahāvastu and the Mūlasarv. Vin. (l. c.)The text then proceeds with a Jataka explanation. Obviously, though the OP talks about it as if it were a "Chinese" version, it is very obviously an Indian version of the story. There were several versions around.
One of the interesting points is this: Here, the pregnancy begins just before Siddartha leaves home, and the birth occurs six years later when he attains Buddhahood. This differs from the Pali which states that the birth occurred before he left home.
My own personal theory to explain this runs as follows:
There is a passage in the Pali Udana (Ireland trs. pg. 29ff) on "Suppavasa the Koliyan daughter" (remember, Yasodhara is also a "Koliyan daughter", too), which states: "On that occasion Suppavasa the Koliyan daughter had been pregnant for seven years and for seven days had experienced difficult labor. (7)" The footnote #7 reads: "7. Mulhagabbha: difficulty in giving birth, "complications". Malalasekera suggests the "seven years" refers to a series of miscarriages."
Now, my thought is that this term "pregnant for X years" may just refer to "miscarriages for X years". And remember, Yasodhara and Siddartha are both maternal and paternal cousins, so these sorts of things are even more likely. They were married at age 16, and only had their first child at age 29. That's a fairly long gap in between. It could be that well before Siddartha left home, maybe 6-7 years, poor Yasodhara had been pregnant and miscarried several times, hence the idea that "Yasodhara was pregnant for 6-7 years". Then, finally she carries the child to full term, and Rahula is born. But, as soon as this happens, Siddartha leaves them both and becomes a renunciant. The Sakyas are really saddened, and probably looking for someone to blame. Why is it, they ask, that previously Yasodhara could not carry full term, but then she did, and Siddartha left? Is it that Siddartha is not the father? And, knowing this, he left? This would match the story above about the accusations of adultery perfectly. Later one, the Buddha returns, and she is proved innocent.
However, this story may have got a bit garbled. It would have been easy to match up "pregnant for 6-7 years" with the bodhisatta's "6-7 years of austerities", and put the two together. That is what the story above seems to do. Of course, this means that Yasodhara is actually pregnant for that long, which is rather over the top to say the least!
Any thoughts or criticisms on this little theory of mine? I like a bit of Dhammic detective work.
