Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6364371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:09:18+00:00 2026-05-25T00:09:18+00:00

I have a website that I am translating into different languages. I have the

  • 0

I have a website that I am translating into different languages. I have the content translated and stored in a database. I also wrote, into the php files, different mechanisms that will display the language based on a global define I set high in the code. I am happy with all of this. My question is how do I control this global define?

I currently have a javascript toggle that sets a cookie and then reloads the current page. And every subsequent page just reads that cookie to set the global define. It works very well, however I am running into two big problems. (1) I can’t just can’t have a url to send to somebody that has the language in it (I could do something like domain.com/forwarder.php?lan=spanish&gotopage=page.php that would set a cookie and then forward, but that’s ugly). And (2), search engines can’t view the multiple languages since they don’t really use cookies and javascript.

So how do I solve this? Does anybody have experience in this? Can you share your experiences?

I’m leaning towards just using the url and dropping the cookie; that seems popular among various international sites I’ve seen. So I’m guessing the urls would be:

domain.com/page       (for english, equivalent to domain.com/en/page)
domain.com/es/page    (for spanish)
domain.com/fr/page    (for french)
etc ......

Is this a good idea? I will have to go through my code and prepend all my href’s with the language code, which might be a pain.

So does anybody have any comments on this? Is this a good plan? Am I neglecting to realize something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:09:19+00:00Added an answer on May 25, 2026 at 12:09 am

    It’s been a long time, but can’t you use the $_SERVER[“HTTP_ACCEPT_LANGUAGE”] and set it automatically. And prior to writing the cookie for the first time, leave message on the screen in either english or another language in the array asking if this is the correct language, with a drop down of available languages? Once it is selected, store that as default website language.

    You can use string constants in global resource files. Have only one website that calls those string constants based on the current language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a website that uses #include file command to roll info into some
I have a website that is deployed between 3 different environments - Dev, Stage,
I have a website that was originally developed using a SQL Express database in
We're getting ready to translate our PHP website into various languages, and the gettext
I have multi-language website in Drupal, but not all content is translated. I want
I have a website (Flash) localized into a dozen of languages and I want
I have a website that plays mp3s in a flash player. If a user
I have a website that I've just uploaded onto the Internet. When I browse
I have a website that is perfectely centered aligned. The CSS code works fine.
I have a Website that is really slow and feels really bad when using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.