The credit rating of a nation is essentially an indicator of the ability of the government of the nation to repay its lenders and how likely it is to default on its debt obligations. The credit rating is assigned by credit rating agencies like Fitch, S&P, etc. after a close study of the economy of the nation. The present income and expenditure of the government is looked at and the factors that can change this figure studied to predict the risk that lenders are taking on.
When the currency of a nation depreciates, it is costlier for the nation to import goods and services from other nations; exports by the nation on the other hand are cheaper, which increases their competitive advantage. If a nation has a large deficit, as the currency depreciates, the value of imports increases at a rate faster than the the extra inflow of funds from an increase in exports. If the products being imported are essential and for which there is no local substitute, it leads to an increase in inflation in the economy. To counter the rising inflation, interest rates have to be increased, which in turn harms the growth prospects of the economy. Lower growth decreases the income of the government while its expenditure is constantly rising.
This could negatively impact the credit rating of the country.