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

  • Home
  • SEARCH
  • 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 7074251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:01:48+00:00 2026-05-28T06:01:48+00:00

I have joined a project recently and now I’m working on its Internationalization improvement.

  • 0

I have joined a project recently and now I’m working on its Internationalization improvement. Technologies used are PHP/MySQL/Zend Framework/Dojo. I18n is implemented using gettext almost as described here link to SO question in the second answer.

But I encountered one problem. Some part of the information specific to certain DB tables is stored within those tables in the enum type columns. For example there is a field usr_online_status in the table “user” which could be one of either ‘online’ or ‘offline’. There are many such tables with enum fields which contain info like (‘yes’ ,’no’) ,(‘download’, ‘upload’) and so on. Of course this info is displayed in English regardless of the current Language chosen by user.

I would like to solve this inconvenience. But don’t know what is the best way to do this in terms of performance and ease of implementation.
I see two possible options:
1) Make language specific dictionary tables for each table which uses such enums.
2) Download all the info from enums. Translate it. Make a script which could on demand alter every table and replace those enums with the required translations.

But there may be simpler or better solutions for this problem.

What would you do ?

Thanks for your answers.

UPD1
Important remark. Info from the enums is not only displayed at the GUI but is used in search. For example – there is a grid on a webpage which contains info about users. You can type ‘line’ in a search field and the result will be only those users with the word ‘%line%’ in their info, for example ‘online’ status.

  • 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-28T06:01:49+00:00Added an answer on May 28, 2026 at 6:01 am

    You definitly want dictionary tables: Only with these can 2 different users of the app work in different languages at the same time.

    I recommend to put some of these dictionary tables into PHP though, as this has proven to be quite an unintrusive and performant way of doing it – e.g.

    $translation=array('yes'=>'Ja','no'=>'Nein', ..)
    
    //...
    
    $row=mysql_fetch_row($qry);
    //$row[1] has yes/no
    $row[1]=$translation[$row[1]];
    
    //...
    

    $translation could be require_once()‘ed depending on the current user’s language preferences, the URL or whatever

    Basically you trade some RAM for speed and easyness.

    UPDATE:

    With Gior312 adding the info about search, here is my solution for it: Have the reverse translation in a DB table (you even might use it to create $translation per a script):

    CREATE TABLE translations (
      id INT PRIMARY KEY AUTO_INCREMENT,
      languageid INT NOT NULL,
      enumword VARCHAR(m) NOT NULL,
      langword VARCHAR(n) NOT NULL,
      -- n and m to your needs
      INDEX(languageid)
      -- other indices to your needs
    )
    

    Now when the search up until now was

    $line=... //Maybe coming from $_POST['line'] via mysql_real_escape_string()
    $sql="SELECT * FROM sometable WHERE somefield LIKE '%$line%'";
    

    What you now do is

    $line=... //Maybe coming from $_POST['line'] via mysql_real_escape_string()
    $sql="SELECT enumword FROM translations WHERE languageid=$currentlanguageid AND langword LIKE '%$line%'";
    //fetch resulting enumwords into array $enumwords
    $enumlist=implode("','",$enumwords);
    //This assumes, that the field enumwords contains nothing, that needs to be escaped
    $sql="SELECT * FROM sometable WHERE somefield IN ('$enumlist')";
    

    The rationale behind treating forward and back translation differently is:

    • There will be many more lines in the code where you display, than where you search, so the unintrusiveness of the forward translation is more important
    • The forward trnslation has to be done PER ROW (with a join), the reverse only PER QUERY, so the performance of the forward translation is more important than the performance of the reverse translation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently joined a team that is working on a ASP.NET MVC project.. they
I have joined a project which has been already developed and its a legacy
Friends, Previously I have worked with EJB-WEBSTART CLIENT project, and Now i have joined
In my current project in PHP and MySQL, I have a database of user
I have recently joined a project that is using multiple different projects. A lot
I have recently joined a new developing project building a thick client application using
I am working on localizing a ASP.net project. I have joined half way and
I have just joined a project which require working on ARM based micro-controllers.. i
I have joined Standford online course on Algorithms design and now I'm solving the
I used the mapping solution from this question to have a joined component. But

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.