Only 2? Over the years, I've worked with Fortran, COBOL, the assembly languages for various platforms, LISP, FORTH, Smalltalk, Perl, Rexx, Javascript and Python. Just off the top of my head. Oh wait, also Pascal, Modula-2 and Ada (for college course work). I really should take a serious look at Kotlin, but there's no immediate compelling need. Hmmm. Forgot Java, ironically.
I've also had to be fluent in IBM mainframe Job Control Language (JCL), the linkage editor, and their equivalents on other systems. Plus scripting for several different OS command shells, such as Bash.
And Domain-Specific Languages (DSLs) such as YACC/Bison, Lexx, PCCTS/Antlr,
Ant, Maven, Gradle, and so forth.
I could stretch the definition even further if you include utilities like RCS, CVS, Mercurial, Subversion and git.
In short, it's a very rare time when I've only used a single "language" even on a single project.
So, in short, you just accept that you cannot be at peak in everything all the time. If you can be competent, that's all that really matters. You'll tend to catch up as you get back into a particular groove and tap into up-to-date reference materials. I used to also get a lot of help from paper tech magazines, but those have gone by the wayside, alas. Nothing like idly paging through a magazine to make discoveries that you might have otherwise missed.