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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:38:21+00:00 2026-06-10T06:38:21+00:00

I have data in different languages inserted into my db, such as chinese, french,

  • 0

I have data in different languages inserted into my db, such as chinese, french, english, malay, japanese, korean, etc.

How can I detect those languages and query the specific one. For example if I only want to query data in chinese and display it to users.

  • 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-06-10T06:38:22+00:00Added an answer on June 10, 2026 at 6:38 am

    If I were you, I’d have something like this to store the text that is displayed in your UI controls:

    create table ui_labels (
      control_id int,
      language varchar(2),
      label varchar(500),
      primary key (control_id, language)
    );
    

    There will be one unique control_id for each control (e.g. button) in your UI. Each control can have many labels, one for each language.

    Then, each UI control can have a different label for each language. (I’m assuming a two-letter ISO language code here, but you could also use a numeric ID or some other identification scheme.)

    This makes it easy to add new languages just by adding rows to the ui_labels table, and easy to switch the language displayed in the UI just by switching the language value that you use in your queries.

    The data for a button could look like this:

    insert into ui_labels (control_id, language, label)
      values (1, 'en', 'Read the article');
    insert into ui_labels (control_id, language, label)
      values (1, 'es', 'Leer el artículo');
    insert into ui_labels (control_id, language, label)
      values (1, 'tl', 'Bumasa ang balita');
    

    As an alternative to this approach, though, you may want to look into gettext, which is a standard way to do translation in PHP. It doesn’t use your database. If it’s a requirement to put the strings in the database (for example, if an end-user has to be able to edit them), then this isn’t an option, but it may be something that you can consider. If you are interested in this, you might want to have a look at this blog post:

    http://verens.com/2008/04/03/translation-in-php/

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

Sidebar

Related Questions

I have a table which contains data in different languages. All fields are nvarchar(max).
I have a database that contains data in different languages. Some languages use accents
I have data from two different sources that I need to combine. Some data
I have 2 data contexts in my application (different databases) and need to be
I have some data which (quite reasonably) uses null and false for different meanings.
I have a page with two Listviews (with two different data sources). I have
I have multiple classes that will store similar data for different uses and I
I have several similar user controls which display listviews of respectively different data entities.
Is it possible to have same table name on different schema with different data
I have multiple similar sites (same layout, just different data), and each of them

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.