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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:36:57+00:00 2026-05-19T11:36:57+00:00

My project should support different languages for the GUI (spanish, english, german, etc). I’m

  • 0

My project should support different languages for the GUI (spanish, english, german, etc). I’m using CodeIgniter, so I haven’t got any problem with PHP views using Language Class. I can load some previously defined vars on PHP to create views in different languages.

The problem comes here:

Some features (a lot of them actually) use Javascript: personalized context menu for some items, differents DIVs created dynamically, etc. The most of this features are created dynamically, so I can’t know the language selected (I can create a lot of duplicated code, one for each language, but this is too redundant).

I need to find a way to translate this content into the new language previously selected by user.

For example:

The user right-click and the context menu have the following options (created dynamically using Javascript):

  • Hi
  • Goodbye

When the user change the page language to ‘Spanish’, the context menu should show:

  • Hola
  • Adios

Is there any way to save some variables with all the names in different languages, and then load to create the menus?

Sorry for the big post. I hope everyone can help me or bring me a little tip.

  • 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-19T11:36:57+00:00Added an answer on May 19, 2026 at 11:36 am

    there are several systems to use when you want i18n (short for “internationalization”) to work in a server side language as well as in client side Javascript.

    this is an example I found for PHP and JavaScript: http://doc.silverstripe.org/sapphire/en/topics/i18n

    I’ve done this in PHP, Ruby and Python. In general there is one way this is done. You create a library of text. this library has pointers to specific pieces of that text. In your code you use that pointer to refer to that piece of text. What the example above does provide you a way to create a library in PHP that can be compiled to a JavaScript equivalent that you can call in JavaScript. Basically it completely separates copywriting and other text from the code.

    I hope this helps you on your way.

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

Sidebar

Related Questions

If I am starting a new project how should I pick between using YUI
I'm working on a multilanguage project with Zend Framework (German and English) where I
Requirements Project should contain 1 main application and some secondary sub applications (which uses
The workflow for my Django project should go like this: User specifies parameters for
This basic app which was given to me as an project should run quite
I'm working on a project in C#, it's about E-learning.This project should use plug-ins
I have a library project that should be the base for several web applications.
I am making a project that should compile on Windows and Linux. I have
I am currently working on a project that should be implemented as a WCF
Background : I have a asp.net webapplication project that should contain a public and

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.