Have that problem with a custom library.
Try to use global concepts, that apply to several programming languages, and make documentation for that. If a concept exist in your original programming language, but not in the second, find an alternative concept.
Do a (U.M.L.) design of your (original and first programming language) source code, just as it is, without removing current bugs, without adding enhacements, just the way the code is.
By design, I mean, document your namespaces, classes, global functions, variables, etc.
Then, make a new version of your design, by copying original. Try to migrate your first language source code to the second programming language source code. (Example: C++, Java)
If you have to make changes to the new source code like new classes or new methods,
you may have to document that, and modify the source code with the first programming language.
The following real world example worths reading, maybe not applying.
My first programming language (Dephi) source code, uses properties.
In my second programming language (C++) source code, properties doesn't exist.
I have documented in a U.M.L. that my clases have properties.
I change my second programming language (C++) source code, add new virtual methods ("getProperty", "setProperty"), that allow me to emulate properties.
Update the Documentation, so the new virtual methods are included.
Update the first programming language, so it includes the new virtual methods.
Then, I migrate to a third programming language (C#). Wait. I use global libraries with global variables and global methods. C# doesn't have that concepts. But, I can use static classes or the singleton pattern.
I emulate the libraries with the singleton pattern. And it can be done, in the previous languages. So I document the changes, and replace the libraries code, in the first and second languages with the singleton pattern.
Now, my code works in 3 similar, but not equal languages. The documentation helps me makes changes, add enhacement, fix bugs on all of them.
Repeat the process, with other programming languages.
It's complicated, but it's done in the real world.