Title: Code stopped working
Last modified: September 3, 2024

---

# Code stopped working

 *  Resolved [loribethnc](https://wordpress.org/support/users/loribethnc/)
 * (@loribethnc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/code-stopped-working-4/)
 * The code I was given last week to automatically translate my page from English
   to Portuguese has now stopped working. The page is back to automatically opening
   in English and you have to choose Portuguese every time.
 * Here is the code I was given and placed in my site’s theme.
 *     ```wp-block-code
       <script>if (!localStorage.getItem("ChangeLanguageFirstTime")) { document.cookie = 'googtrans=/en/pt'; localStorage.setItem("ChangeLanguageFirstTime", true);}</script>
       ```
   
 * I need our English site to automatically open in Portuguese every time without
   having to change anything on the GTranslate plugin on the screen.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-stopped-working-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [edo888](https://wordpress.org/support/users/edo888/)
 * (@edo888)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/code-stopped-working-4/#post-17994947)
 * Hi,
 * I have checked your website and I see it in Portuguese.
 * Thanks! 🙂
 *  Thread Starter [loribethnc](https://wordpress.org/support/users/loribethnc/)
 * (@loribethnc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/code-stopped-working-4/#post-17995023)
 * Did you have to choose Portuguese or did it open to already be in Portuguese?
   I’m seeing it still open in English.
 *  Plugin Author [edo888](https://wordpress.org/support/users/edo888/)
 * (@edo888)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/code-stopped-working-4/#post-17995027)
 * No. Keep in mind that the code works just once and it will not work if you choose
   other language.
 * Make tests in incognito window.
 * Thanks! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Code stopped working’ is closed to new replies.

 * ![](https://ps.w.org/gtranslate/assets/icon-256x256.png?rev=2595917)
 * [Translate Wordpress with GTranslate](https://wordpress.org/plugins/gtranslate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gtranslate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gtranslate/)
 * [Active Topics](https://wordpress.org/support/plugin/gtranslate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gtranslate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gtranslate/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [edo888](https://wordpress.org/support/users/edo888/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/code-stopped-working-4/#post-17995027)
 * Status: resolved