CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Needs idea how to create multilanguage site.

Print topic Send  topic

Author Message
Gena

Posts: 591
Posted: 06/28/2011, 5:52 AM

I know how to translate text resource using build-in functionality of CCS. But I need advice on how to implement different content for multilanguage site.

So let say I have some db table:
LANG_ID - language ID (like, EN, FR etc)
LAND_Text - text for appropriated language.

so I can easy create different TEXT for different selected LANG_ID and show it on the page. I know, that Default language is, let say, EN.

now problem.

Scenario 1.
I have text for all lang.

EN - English text here
FR - french text here

so if user selects FR - then I can SELECT LANG_ID='FR' and then show LAND_Text row.
if use selects EN or nothing - I show default (=EN) text.


Scenario 2.
I have text for just EN lang.

EN - English text here

if user selects EN or nothing - I show default (=EN) text.

so if use selects FR - then I need to show LAND_Text row for EN.

and so on.

The question is, how to easy implement this using standard GRID?
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/28/2011, 6:24 AM

Suggestions:

1. For your languages table, use the word 'locale' as the PK, with data
looking like the locale code (en, fr, etc.).

2. For tables that need translated data, your definition will have a
combo primary key comprising of whatever unique identifier you use,
along with the second key field being 'locale'.

rec_id: 1
locale: en
rec_id: 1
locale: fr
rec_id: 2
locale: en
rec_id: 2
locale: fr
etc.

Of course, with the above scenario, you'll need to create custom inserts
whenever new records are created to write the other languages. Gets a
bit tricky to deal with, but the end result is a true dynamic
multi-lingual site.
jjrjr2


Posts: 131
Posted: 06/28/2011, 6:48 AM

Hi

Maybe this will help a little

http://forums.yessoftware.com/posts.php?post_id=103166&s_keyword=language

John8-) 8-)
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
Gena

Posts: 591
Posted: 06/28/2011, 7:12 AM

thank you, guys!
_________________
Gena
View profile  Send private message
Gena

Posts: 591
Posted: 06/28/2011, 8:53 AM

something I am doing wrong.

using MySQL.

I want to save into TEXT field some information in non-english language (like russian), so I put text field into Record and when I save a form I get

?????? ???????

instead of russian characters.

my field defined as
ContactsNotes text utf8_unicode_ci

and table
ENGINE=InnoDB DEFAULT CHARSET=utf8

what's wrong?

_________________
Gena
View profile  Send private message
Gena

Posts: 591
Posted: 06/28/2011, 8:54 AM

btw from the same Record I sent email, and email goes good, it consists UTF characters and text is OK.

so something happened during database input/update???

ccs4
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/28/2011, 9:10 AM

When you say "when I save a form I get", what does that mean exactly?
When the form returns from the insert/update operation, is that what's
displayed in the fields on the form? Or, are you using some sort of
MySQL client software to view the data in the table directly?
Gena

Posts: 591
Posted: 06/28/2011, 10:04 AM

datadoit,

I use standard Record, so when I push OK button it saves info from the fields into db table.
_________________
Gena
View profile  Send private message
Gena

Posts: 591
Posted: 06/28/2011, 10:19 AM

strange...

this doesn't work with russian characters but works with italian!

(let's check if it works here :-) )
russia - русский текст
italian - già abastanza èòàù
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/28/2011, 1:36 PM

I'm trying to help you understand the difference between what is
"displayed" and what is actually "saved" into the database. Look at the
data directly using some MySQL client software, the CLI or otherwise,
then report back here what you see. That will help us determine whether
it's a CodeCharge problem or not.

If you're not familiar with MySQL's CLI:

http://dev.mysql.com/doc/refman/5.5/en/mysql.html

Gena

Posts: 591
Posted: 06/29/2011, 3:04 AM

datadoit,
as I said, this is actually "saved" into the database.
so if I use russian - it SAVES into ?????????????
if other languages - it saves correctly.
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/29/2011, 6:10 AM

Okay. The next step I would take would be to (using the CLI) update a
record using Russian characters to see if it'll 'stick'.
Gena

Posts: 591
Posted: 06/29/2011, 6:24 AM

I was used mySQL manager and have tried UPDATE and INSERT statements.
yes! it works and field contains Russian characters! so I thing table itself is OK.
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/29/2011, 8:55 AM

Excellent. Now you know it's either CodeCharge writing bad data or the
browser.

Double check your project settings to make sure you're using UTF8
Unicode for not only the pages, but have also specified this in the
locale settings.

I also recall there possibly being an issue with Russian characters
mentioned in the forum before, and Yes acknowledging it and providing a
patch. I'll search and verify.
scarvello

Posts: 64
Posted: 06/29/2011, 9:07 AM

Try with:
@mysql_query("SET NAMES utf8", $this->Link_ID);
in db_mysql.php

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.