I am currently researching the best methods to integrate i18n
into projects.
There's several methods I have thought of doing this, first being a database scheme to store the strings and relevant locale, but the problem with this is that it would not be that easy to select the strings, because i would not like to perform quesries like so:
SELECT text FROM locales WHERE locale = 'en_GB' AND text_id = 245543
Or
SELECT text FROM locales WHERE locale = 'en_GB' AND text_primary = 'hello'
The next method would be to store them within files such as locales/en_gb/login/strings.php
and then try and access them via an class specifically developed like so:
$Language = Registry::Construct('Language',array('en_GB'));
echo $Language->login->strings->hello;
The issue with this is I would have to build a system that would update these files via an administration panel witch is very time consuming, not just building the system to manage the strings but actually managing the strings as the site grows
Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for a specific region or language by translating text and adding locale-specific components.
Internationalization is defined as the process of making sure that your website's platforms, workflows, and architecture accommodated multiple cultural conventions and languages so that you can create localized sites.
In the Translation and Localization framework, Internationalization (or 'i18n' as acronymized by researchers) implies the design and development of a content product or application in order to enable a streamlined localization and adaptation process for target audiences from linguistic, cultural and regional ...
Localization in software engineering is the process of adapting the content of a system to a particular locale so the target audience in that locale can understand it. It is not just about changing content from one language to another.
In addition to gettext
already mentioned, PHP 5.3 has native Internationalization support
If that's not an option, consider using Zend Framework's Zend_Translate
, Zend_Locale
and related components for that. Zend_Translate
supports a number of adapters, including but not limited to simple arrays, gettext, XmlTm and others.
I've implemented a XML translation utility as part of a bigger project. You can find it here, and a sample translation file is here (en_US).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With