473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Multilingual db

Hi,

I'm new to SQL/PostgreSQL programming so forgive me if my questions are
to dumb?

I'm designing a multilingual db and I don't know if I'm on the right track.
Please advise.

The basic structure of the tables:

Common Info
| id | ...

localize info
| id | lang | country | ...
Now here is what I came up with.

1. let the client do all the work of getting the right localize info:

SELECT * FROM table_name
WHERE id=1 AND ((lang='en' AND (country='US' OR country='')) OR
(lang='' AND country=''))
ORDER BY lang DESC, country DESC LIMIT 1;
2. Add function for retrieving the localized info:
get_local_info(id, table_name, lang, country);

Retrieve by:
SELECT * FROM get_local_info(1, 'table_name', 'en', 'US') AS (id
integer, lang char(2), country char(2), ...);
Q1. Is it possible somehow to use table definition as column definition
list in AS clause?

Q2. I'd like to simplify the query from section 1 to
SELECT * FROM table_name WHERE id=1 AND lang='en' AND
country='US' ;
For that purpose I need to trap the select query and handle it
by myself. Is it possible?

Q3. Is there a better way to approach the subject?

Thanks.
Yaniv.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
0 1257

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ed | last post by:
I want to create a multilingual website in ASP. Is the Dictionary object created with the application-level scope the way to go?
0
by: Corobori | last post by:
I am developping a multilingual application. I would like to find an installer integrated with .NET allowing me to develop a multilingual interface as well as including the NET Framework in those...
2
by: charliewest | last post by:
Building Multilingual Portal I have been assigned a new project to build a multilingual portal using ASP and/or ASP.NET and the expected Microsoft technologies including ADO and SQL Server 2000....
0
by: Charles | last post by:
Hi, I'm looking for best practices for building a multilingual database. It is for an multilingual application that will use a persistence layer. I would like to know what are the different...
7
by: J?rg Keller | last post by:
Hi all I have to localize an Access 2002 application: The application using several form, tables etc. is currently only in English. Now the frontend has to be bilingual, so the user can choose...
5
by: HALLES | last post by:
HI ! Is there a way to write append rewrite a XML Multilingual file. Two parallele aims Multilingual and Xml File format or Xml Lile file Format. Is there an editor to do that. HALLES .
0
by: JoanneC | last post by:
When developing dynamic web content for the global market place using ASP.NET, VB.NET and MS-Access, why should one install MS-Windows 2000 Server (mulitlanguage/multilingual), and is it necessary...
0
by: JoanneC | last post by:
When developing dynamic web content for the global market place using ASP.NET, VB.NET and MS-Access, why should one install MS-Windows 2000 Server (mulitlanguage/multilingual), and is it necessary...
4
by: Jim Adams | last post by:
Anyone have any insights into this? I'm planning an upgrade to an existing ASP.Net project to support multiple display languages (e.g. English, Spanish, ...). I'd like to use a solution that...
64
by: Manfred Kooistra | last post by:
I am building a website with identical content in four different languages. On a first visit, the search engine determines the language of the content by the IP address of the visitor. What the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.