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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:15:15+00:00 2026-05-19T09:15:15+00:00

I am having an implementation issue with this basic multilang design. Table content content_id

  • 0

I am having an implementation issue with this basic multilang design.

Table content

content_id bigint(20) NOT NULL,  
lang_id int(5) NOT NULL,   
word varchar (500) NOT NULL,  
created datatime,  

Now the issue is with implementing this. I assume in the application i am declaring each word on the page with the content_id like 1,2,3,4,5… where 1 = “Hello” 2 = “Welcome to xxxxx” etc. Right? So the problem is I give “Hello” = 1 in the code. So in the table it is like this
1, 23 (for english), Hello.

But now if i have a Spanish session, how will i find “Hello” in the table? Because I hardcoded 1 in the code to be “Hello” so the system will always lookup this up and find the english text. The only work around i see is to have separate tables per language?

  • 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-19T09:15:15+00:00Added an answer on May 19, 2026 at 9:15 am

    You need to make lang_id and content_id a composite primary key. You’ll end up with data that looks like this:

    1         Hello            1
    1         Hola             2
    2         Thanks           1
    2         Gracias          2
    2         Danke            3
    

    You might even want to break out the English translation into a separate table to make it easier for you as the developer (since you speak English)…then you know that WordId 1 is, canonically, “Hello”. Foreign key to language table, obviously. If you do this, you might want a surrogate key for the primary key as well…that simplifies updates.

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

Sidebar

Related Questions

I know this issue being mentioned before, but resolutions there didn't apply. I'm having
I like the idea of having Interfaces and Implementation separate. But how separate? Are
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having programmed through emacs and vi for years and years at this point, I
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
I'm having an issue with databinding to a service class in WPF. My service
I am having a really bad issue where no matter what I try, the
So i have this very basic ipad view controller and i was doing some
So I am having an issue with the TreeView. If I build a tree
I'm having something of an issue with trying to load externally defined classes in

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.