Facebook has apologised for a technical error that led to a vulgar translation of the Chinese president’s name.

Chinese leader Xi Jinping’s name has been translated as “Mr Shithole” in Facebook posts translated into English from Burmese.

The issue was revealed during a visit by the president to Myanmar, where Xi and state counsellor Aung San Suu Kyi signed agreements for massive Beijing-backed infrastructure plans.

An official statement on Suu Kyi’s official Facebook page became littered with references to “Mr Shithole” when translated to English. Additionally, a headline in local news outlet the Irrawaddy appeared as “Dinner honors president shithole”.

Facebook says it rushed to fix the mistake.

“We fixed a technical issue that caused incorrect translations from Burmese to English on Facebook. This should not have happened and we are taking steps to ensure it doesn’t happen again. We sincerely apologize for the offense this has caused,” Facebook said in a statement.

Facebook says its translation system did not have President Xi Jinping’s name in its Burmese database, causing it to guess at the translation.

The company said translation tests of similar words in Burmese produced “shithole”.

It is not the first time Facebook has struggled with translation from Burmese.

An investigation in 2017 found an anti-Rohingya post advocating killing Muslims was translated into English as “I shouldn’t have a rainbow in Myanmar”.