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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:05:02+00:00 2026-05-31T05:05:02+00:00

I have a visualization web application (small project) that creates charts and graphs from

  • 0

I have a visualization web application (small project) that creates charts and graphs from a database and presenting them in a html/css template. All the strings are currently hardcoded in English inside the code (not in a special place/array/container, but echo’ed or < p >’ed as we go along). What do you think is the best way to offer localized version of my web app? I estimate that I have around 60-70 small strings.

I think I should create a lang.en.php file with the strings as constants strings variables, and include the file in my config.php (contains stuff like DB info etc) which is then is already included/required() in all the pages I use. Inside the pages, I will replace all the strings with their constant, eg TOP_10_WHATEVER_CHART.

If someone wants to create a new language, he copies the lang.en.php file, renames it and changes all the strings inside it. He then just has to change the include statement in config.php and everything is set.

Sounds good? Some of the other solutions I have seen seem a little overkill. If there is a more “standardized” or scalable way but still simple, let me know please.

  • 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-31T05:05:03+00:00Added an answer on May 31, 2026 at 5:05 am

    What you describe is a pretty standard way that I have seen it done especially for smaller projects. The only issue with this approach is that you need N instances per language of your framework (unless you are doing something dynamically that I did not catch in the description above). You may want to create a function that takes in the string constant you are looking for and the language. The function returns the translated string. The language can be chosen based upon the http request and if you don’t support that language the function can return a default language.

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

Sidebar

Related Questions

my web application is based on dojo 1.6.0. The problem that I have is
Have a n-tire web application and search often times out after 30 secs. How
I'm building a web application with various visualization components, made up of Backbone.js Models
I am developing a web application that manages a population of plants. One feature
I have a Google Chart (using the Google Visualization API , not Google Charts
I have a web service that uses Python's SimpleJSON to serialize JSON, and a
I am working on a ProcessingJS visualization, and I have been noticing that the
I have an ASP.NET application that executes a WMI call to a remote system.
I'm currently building a SmartGWT-based web application (using the Portlet Layout). So I have
I am to build a web app and I have realized that my domain

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.