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 3346144
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:16:08+00:00 2026-05-18T01:16:08+00:00

I would like to ask about best practices or the simplest way possible of

  • 0

I would like to ask about best practices or the simplest way possible of translating static content. E.g. translating, “search” or “save changes”.

My current idea is:

depending on users browser locale (maybe geolocation of IP address, but I prefer browser locale) choose a subdomain, e.g. “fr.myweb.com”. Set a cookie, session variable, depending on settings with the language. This part is fairly straightforward.

Now comes the translating part. Changing images depending on language wont be a problem, since a “_fr” prefix is enough. But translating strings like save changes, search, order items, etc. . Well, I am not sure here.

Since its all based on PHP and MySQL, I was thinking of something like:

Two tables:

  1. First one has list of all words in default language
  2. Second one has three columns (excluding auto increment) – language_id, translation, word_id

Get all words, cache the query or whatever and now calling trans(‘fr’, ‘search’) would translate the word. This should work, although I dont know if its the right approach or if there is a better way. Note: No google translations.

Also since I use js/ajax, I am not sure about this part either. Get the language from cookie and do a map of alerts, etc. and then just call “message[‘fr’]”, I am not sure about this part either.

Any ideas what would be ideal for both languages? I tried google, but wasnt satisfied with the results. Any advice/link is appreciated.

Regards

  • 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-18T01:16:09+00:00Added an answer on May 18, 2026 at 1:16 am

    Look up Gettext for PHP: http://php.net/manual/en/book.gettext.php. It’s the de facto standard for providing web content translations. Basically you build translation files (you can use for example Poedit), point PHP to them, set the locale to whatever is needed and use _( 'string to translate' ) to fetch the translations.

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

Sidebar

Related Questions

I would like to ask about the available (free or not) Static and Dynamic
I am currently testing this environment and would like to ask about the best
Good afternoon, I would ask some suggestion about the best way to monitor events
I would like to ask help on how and what is the best way
I would like to ask you about some advices about this code. It works,
I have been reading about unsafePerformIO lately, and I would like to ask you
I would like ask if there's a way to download an android layout from
What I would like ask is best illustrated by an example, so bear with
I would like to ask is there any way to achieve this functionality: I
I would like to ask which is the best solution for integrating google maps

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.