php-i18n Digest 31 Jan 2011 06:29:39 -0000 Issue 453
Topics (messages 1421 through 1427):
Re: How to make the i18n without serious tools?
1421 by: Tom Worster
1422 by: Tex Texin
1423 by: Andre Polykanine
1424 by: Tom Worster
1425 by: Andre Polykanine
1426 by: Tom Worster
1427 by: Tomas Kuliavas
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
take a look at what yii offers:
http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n
for collation you can, in a pinch, put your array in a mysql temporary
table and sort it with a mysql collation.
On 1/17/11 8:49 AM, "Andre Polykanine" <[email protected]> wrote:
>Hello Php-i18n,
>I need to make my projects international. However, my hosting provider
>won't install anything for me, so no GetText, no ICU.
>Could you suggest me something?
>I tried to make constants definitions like this:
><?
>define("MSG0", "Welcome to our website!");
>...
>define(MSG125", "blah blah");
>?>
>But it's reeeally hard to maintain in future.
>Thanks!
>
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
For Web applications you may as well maintain your strings in a database.
The language table will have columns for message key, language identifier, and
string.
MSG0, en-US, Welcome to our website!
MSG0, fr-CA, .....
MSG125, en-US, blah blah...
MSG125, fr-CA, ....
You can be a bit more clever and have keys consist of web page and id, so that
you can easily read into n array all the keys associated with a page for a
single language, and then reference them from the array rather than individual
database calls. But with good database cacheing, it’s not always a significant
optimization.
tex
-----Original Message-----
From: Andre Polykanine [mailto:[email protected]]
Sent: Monday, January 17, 2011 5:49 AM
To: [email protected]
Subject: [PHP-I18N] How to make the i18n without serious tools?
Hello Php-i18n,
I need to make my projects international. However, my hosting provider
won't install anything for me, so no GetText, no ICU.
Could you suggest me something?
I tried to make constants definitions like this:
<?
define("MSG0", "Welcome to our website!");
...
define(MSG125", "blah blah");
?>
But it's reeeally hard to maintain in future.
Thanks!
--
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Tex,
Yes, I'll see this as a way to make it also.
Sorry, I've lost the message that suggested me using Yii.
Actually I've looked into this, and I would like to use the i18n
tools of the framework. But is it possible to use them alone, without
the Yii itself? Because otherwise it'll mess up my folder structure...
Thanks!
--
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
------------ Original message ------------
From: Tex Texin <[email protected]>
To: 'Andre Polykanine'
Date created: , 6:24:16 AM
Subject: [PHP-I18N] How to make the i18n without serious tools?
For Web applications you may as well maintain your strings in a database.
The language table will have columns for message key, language identifier, and
string.
MSG0, en-US, Welcome to our website!
MSG0, fr-CA, .....
MSG125, en-US, blah blah...
MSG125, fr-CA, ....
You can be a bit more clever and have keys consist of web page and id, so that
you can easily read into n array all the keys associated with a page for a
single language, and then reference them from the array rather than individual
database calls. But with good database cacheing, it’s not always a significant
optimization.
tex
-----Original Message-----
From: Andre Polykanine [mailto:[email protected]]
Sent: Monday, January 17, 2011 5:49 AM
To: [email protected]
Subject: [PHP-I18N] How to make the i18n without serious tools?
Hello Php-i18n,
I need to make my projects international. However, my hosting provider
won't install anything for me, so no GetText, no ICU.
Could you suggest me something?
I tried to make constants definitions like this:
<?
define("MSG0", "Welcome to our website!");
...
define(MSG125", "blah blah");
?>
But it's reeeally hard to maintain in future.
Thanks!
--
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
from what i know of yii, which is not a great deal, i would think you can
use it without doing their whole mvc thing. why don't you try it and let
us know? here's your lost email which also mentioned collation:
On 1/17/11 11:12 AM, "Tom Worster" <[email protected]> wrote:
>take a look at what yii offers:
>http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n
>
>for collation you can, in a pinch, put your array in a mysql temporary
>table and sort it with a mysql collation.
On 1/18/11 7:08 AM, "Andre Polykanine" <[email protected]> wrote:
>Hello Tex,
>
>Yes, I'll see this as a way to make it also.
>Sorry, I've lost the message that suggested me using Yii.
>Actually I've looked into this, and I would like to use the i18n
>tools of the framework. But is it possible to use them alone, without
>the Yii itself? Because otherwise it'll mess up my folder structure...
>Thanks!
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>My blog: http://oire.org/menelion (mostly in Russian)
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>------------ Original message ------------
>From: Tex Texin <[email protected]>
>To: 'Andre Polykanine'
>Date created: , 6:24:16 AM
>Subject: [PHP-I18N] How to make the i18n without serious tools?
>
>
> For Web applications you may as well maintain your strings in a
>database.
>
>The language table will have columns for message key, language
>identifier, and string.
>MSG0, en-US, Welcome to our website!
>MSG0, fr-CA, .....
>MSG125, en-US, blah blah...
>MSG125, fr-CA, ....
>
>You can be a bit more clever and have keys consist of web page and id, so
>that you can easily read into n array all the keys associated with a page
>for a single language, and then reference them from the array rather than
>individual database calls. But with good database cacheing, it¹s not
>always a significant optimization.
>
>
>tex
>
>-----Original Message-----
>From: Andre Polykanine [mailto:[email protected]]
>Sent: Monday, January 17, 2011 5:49 AM
>To: [email protected]
>Subject: [PHP-I18N] How to make the i18n without serious tools?
>
>Hello Php-i18n,
>I need to make my projects international. However, my hosting provider
>won't install anything for me, so no GetText, no ICU.
>Could you suggest me something?
>I tried to make constants definitions like this:
><?
>define("MSG0", "Welcome to our website!");
>...
>define(MSG125", "blah blah");
>?>
>But it's reeeally hard to maintain in future.
>Thanks!
>
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello Tom,
Thank you!
Actually... hm... I didn't understand well about putting the array in
a temporary table and sorting by collation... sorry for my ignorance.
Thanks!
--
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
------------ Original message ------------
From: Tom Worster <[email protected]>
To: Andre Polykanine
Date created: , 2:45:21 PM
Subject: [PHP-I18N] How to make the i18n without serious tools?
from what i know of yii, which is not a great deal, i would think you can
use it without doing their whole mvc thing. why don't you try it and let
us know? here's your lost email which also mentioned collation:
On 1/17/11 11:12 AM, "Tom Worster" <[email protected]> wrote:
>take a look at what yii offers:
>http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n
>
>for collation you can, in a pinch, put your array in a mysql temporary
>table and sort it with a mysql collation.
On 1/18/11 7:08 AM, "Andre Polykanine" <[email protected]> wrote:
>Hello Tex,
>
>Yes, I'll see this as a way to make it also.
>Sorry, I've lost the message that suggested me using Yii.
>Actually I've looked into this, and I would like to use the i18n
>tools of the framework. But is it possible to use them alone, without
>the Yii itself? Because otherwise it'll mess up my folder structure...
>Thanks!
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>My blog: http://oire.org/menelion (mostly in Russian)
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>------------ Original message ------------
>From: Tex Texin <[email protected]>
>To: 'Andre Polykanine'
>Date created: , 6:24:16 AM
>Subject: [PHP-I18N] How to make the i18n without serious tools?
>
>
> For Web applications you may as well maintain your strings in a
>database.
>
>The language table will have columns for message key, language
>identifier, and string.
>MSG0, en-US, Welcome to our website!
>MSG0, fr-CA, .....
>MSG125, en-US, blah blah...
>MSG125, fr-CA, ....
>
>You can be a bit more clever and have keys consist of web page and id, so
>that you can easily read into n array all the keys associated with a page
>for a single language, and then reference them from the array rather than
>individual database calls. But with good database cacheing, it¹s not
>always a significant optimization.
>
>
>tex
>
>-----Original Message-----
>From: Andre Polykanine [mailto:[email protected]]
>Sent: Monday, January 17, 2011 5:49 AM
>To: [email protected]
>Subject: [PHP-I18N] How to make the i18n without serious tools?
>
>Hello Php-i18n,
>I need to make my projects international. However, my hosting provider
>won't install anything for me, so no GetText, no ICU.
>Could you suggest me something?
>I tried to make constants definitions like this:
><?
>define("MSG0", "Welcome to our website!");
>...
>define(MSG125", "blah blah");
>?>
>But it's reeeally hard to maintain in future.
>Thanks!
>
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
in MySQL you could do something like:
CREATE TEMPORARY TABLE t
(s VARCHAR(1000) NOT NULL)
CHARACTER SET utf8 COLLATE utf8_slovak_ci;
choosing what you like from MySQL's charsets and collations on your server:
SHOW CHARACTER SET;
SHOW COLLATION;
see also:
http://www.collation-charts.org/mysql60/
now insert each of the strings you want to collate, one strong per row,
INSERT INTO t VALUES ('Sliač'), ('Snina'),
('Sládkovičovo'), ('Skalica'), ('Sobrance');
and then select them ordered by s
SELECT s FROM t ORDER BY s;
which yields your array of strings collated according to the MySQL
collation you specified when you created the table.
this method doesn't give you the control of ICU's collator but it might be
better than nothing.
On 1/18/11 4:34 PM, "Andre Polykanine" <[email protected]> wrote:
>Hello Tom,
>
>Thank you!
>Actually... hm... I didn't understand well about putting the array in
>a temporary table and sorting by collation... sorry for my ignorance.
>Thanks!
>
>
>--
>With best regards from Ukraine,
>Andre
>Skype: Francophile
>My blog: http://oire.org/menelion (mostly in Russian)
>Twitter: http://twitter.com/m_elensule
>Facebook: http://facebook.com/menelion
>
>------------ Original message ------------
>From: Tom Worster <[email protected]>
>To: Andre Polykanine
>Date created: , 2:45:21 PM
>Subject: [PHP-I18N] How to make the i18n without serious tools?
>
>
> from what i know of yii, which is not a great deal, i would think
>you can
>use it without doing their whole mvc thing. why don't you try it and let
>us know? here's your lost email which also mentioned collation:
>
>On 1/17/11 11:12 AM, "Tom Worster" <[email protected]> wrote:
>
>>take a look at what yii offers:
>>http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n
>>
>>for collation you can, in a pinch, put your array in a mysql temporary
>>table and sort it with a mysql collation.
>
>
>
>
>On 1/18/11 7:08 AM, "Andre Polykanine" <[email protected]> wrote:
>
>>Hello Tex,
>>
>>Yes, I'll see this as a way to make it also.
>>Sorry, I've lost the message that suggested me using Yii.
>>Actually I've looked into this, and I would like to use the i18n
>>tools of the framework. But is it possible to use them alone, without
>>the Yii itself? Because otherwise it'll mess up my folder structure...
>>Thanks!
>>
>>
>>--
>>With best regards from Ukraine,
>>Andre
>>Skype: Francophile
>>My blog: http://oire.org/menelion (mostly in Russian)
>>Twitter: http://twitter.com/m_elensule
>>Facebook: http://facebook.com/menelion
>>
>>------------ Original message ------------
>>From: Tex Texin <[email protected]>
>>To: 'Andre Polykanine'
>>Date created: , 6:24:16 AM
>>Subject: [PHP-I18N] How to make the i18n without serious tools?
>>
>>
>> For Web applications you may as well maintain your strings in a
>>database.
>>
>>The language table will have columns for message key, language
>>identifier, and string.
>>MSG0, en-US, Welcome to our website!
>>MSG0, fr-CA, .....
>>MSG125, en-US, blah blah...
>>MSG125, fr-CA, ....
>>
>>You can be a bit more clever and have keys consist of web page and id, so
>>that you can easily read into n array all the keys associated with a page
>>for a single language, and then reference them from the array rather than
>>individual database calls. But with good database cacheing, it¹s not
>>always a significant optimization.
>>
>>
>>tex
>>
>>-----Original Message-----
>>From: Andre Polykanine [mailto:[email protected]]
>>Sent: Monday, January 17, 2011 5:49 AM
>>To: [email protected]
>>Subject: [PHP-I18N] How to make the i18n without serious tools?
>>
>>Hello Php-i18n,
>>I need to make my projects international. However, my hosting provider
>>won't install anything for me, so no GetText, no ICU.
>>Could you suggest me something?
>>I tried to make constants definitions like this:
>><?
>>define("MSG0", "Welcome to our website!");
>>...
>>define(MSG125", "blah blah");
>>?>
>>But it's reeeally hard to maintain in future.
>>Thanks!
>>
>>
>>
>>--
>>With best regards from Ukraine,
>>Andre
>>Skype: Francophile
>>Twitter: http://twitter.com/m_elensule
>>Facebook: http://facebook.com/menelion
>>
>>
>>--
>>PHP Unicode & I18N Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>--
>>PHP Unicode & I18N Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>--
>>PHP Unicode & I18N Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
2011.01.17 15:49, Andre Polykanine rašė:
Hello Php-i18n,
I need to make my projects international. However, my hosting provider
won't install anything for me, so no GetText, no ICU.
Could you suggest me something?
I tried to make constants definitions like this:
<?
define("MSG0", "Welcome to our website!");
...
define(MSG125", "blah blah");
?>
But it's reeeally hard to maintain in future.
If your provider won't enable gettext or required system locales for
you, add php gettext classes to your software. You can do gettext
without PHP gettext extension support. Older php-gettext does not have
dependency on mbstring, if your brain dead provider does not enable it
too. IDN support can be implemented in pure PHP too.
constants, arrays and html templates with translation are not
maintainable (personally went through couple of version upgrades on html
template based translation) and have problems with plurals.
--
Tomas
--- End Message ---