Salam alaikom
This is incorrect. No shia say "ما شاء علي".
We do say "يا علي". However, as was mentioned in an above post, when we shia say "Ya Ali", we don't mean it in the same way as we say "Ya Allah". When we say "Ya Ali", we know that Imam Ali (عليه السلام) relies on Allah (سُبْحَانَهُ وَ تَعَالَى) for everything. We're just asking him to intercede for us before Allah (سُبْحَانَهُ وَ تَعَالَى). Allah actually commands us to do this in the holy Quran:
يَا أَيُّهَا الَّذِينَ آمَنُوا اتَّقُوا اللَّهَ وَابْتَغُوا إِلَيْهِ الْوَسِيلَةَ
"O you who have faith! Be wary of Allah, and seek the means of recourse to Him." (Surah al-Ma'idah 5:35)
The "وسيلة" that Allah (سُبْحَانَهُ وَ تَعَالَى) mentions here means the prophets and imams.
I couldn't find the first hadeeth, but there is a chapter with a name similar to the second one you mentioned: "The Imams ((عليه السلام).) have with all the books that Allah, the Most Holy, the Most High, has revealed and that they know them even the language in them are different".
There is no problem in believing this and no, it is not shirk. It is not shirk because we believe that Allah (سُبْحَانَهُ وَ تَعَالَى) has granted the prophets (A) and imams (A) portions of His knowledge. The prophets and imams don't have this knowledge independently, rather they rely on Allah (سُبْحَانَهُ وَ تَعَالَى) for such knowledge.
Shirk would be if we said that the prophets and imams knew all the languages without Allah helping them. However, we believe that everything the prophets and imams knew or did was from the power of Allah (سُبْحَانَهُ وَ تَعَالَى).
لا حول ولا قوة الا بالله