Hello John, okay? thanks for the feedback.
I wanted to perform the translation options in a .js file (javascript).
From what I researched is impossible because javacript runs in the browser.
The solution was to bring the code to my .php file with <script> </ script> and run the selection of desired language.