Multilanguage support by jCore is done using PHP's own gettext() and locale() functions. Every text that is written with jCore is translatable using this method, you just have to create your own messages.mo file and translation already works.
Starting from 0.9 If PHP's own gettext isn't working just go to Global Settings -> Functionality Settings and turn on Manual Gettext.
In the admin you can create as many language as you wish for your site and then define menu items for these languages. When creating a new language you will have to define the locale path for your messages.mo file, usually here you should write something like en_US and then your messages.mo file would go into locale/en_US/LC_MESSAGES/ directory.
To create a .mo file you first will have to create a .po file with the text and translations you want and then convert them to .mo files with the following command:
msgfmt messages.po -o messages.mo
You can also use poEdit which is a open source program and will automatically generate .mo files when you save your .mo files and it makes completing translations a lot easier.
There is always an example .po and .mo file in your jCore system so that should give you an exact idea of how to translate a phrase.
The messages.mo file usually is used for the site's content but for modules you can define different .mo files just to keep things clean, to do so just create a .mo file with the name of your module, for e.g. to translate photogallery.class.php you would have to create a .mo file named like photogallery.mo and that fill will be automatically loaded when module gets used.
Using the Languages section in the admin and the translation option with the messages.mo you should be able to create multiple language versions of your site with different contents and even the smallest bit of text translated.
You can download available translations in our Downloads section.
Comments (29)
BTW: there is a sample messages.po and .mo file in both jCore Server and Client in the locale/en_US/LC_MESSAGES directory and the files added to this directory will used by default if no language defined in the admin.
im gonna use that..When a new version will be release i want to make a turkish support site..
if u give me permission..
BTW: all texts echoed out from the code can be translated only that the modules use their own translation files but the rest of the code uses the messages.po (.mo) file and everything that is echoed with _() can be translated.
Thx for the all msg..i have converted the files..
But have some character problems..i tried to use ur lang files,but still have the same character problems..
what we gonna do?
i have tried to make iso-8859-9 (for turkish language file) but, i have the same prblem
http://webtools.live2support.com/misc_htmlcharset.php
while for mysql the right one seems to be
latin5_turkish_ci
utf8_turkish_ci
but be aware that it isn't enough to change the collocation of your mysql db, you will have to do so on the tables too so first set the collocation for your db, then import the jcore sql file and then define the page charset in the admin (Global Settings) and then start to enter your content and see if it works right.
If the problem is with the translation file please send them to me and I will try myself asap and let you know.
But when i convert .po to .mo,.mo file have charset problem..so .mo file does not support utf-8..
im going to send to files,just check it if they true or false
if i want to make full turkish language site,what i have to do..
Not only modules,full of site
i set up a new language in admin section (deutsch, de, de_DE) and placed the .mo, .po files in the directory /locale/de_DE/LC_MESSAGES, but it has no effect. the text does not get translated.
Any idea whats missing?
im using jcore-server 0.2.
btw. you can use poedit (poedit.net) to extract all msg-strings from the source-code :)
BTW: thanks for the poedit.net link, didn't know about it but it's great product if it can do what you say, I will use it for sure, thanks again!
any caching active or so?
I know this means duplicating translations but if I would have added everything only to the messages.po we may end up with translations that aren't needed at all and modules may not be able to provide translations of their own in the future so this was the best thing I could think of.
copied the message.mo to shopping.mo, restarted apache and the text got translated.
thx! :D
how i do that?
i try: admin.po add some strings (just for test) and converted to .mo, restart the wamp, tried again, and again, but not works... some help?
and, by the way... i get a lot of errors in page if i have "display_erros" in php settings, i know why? is about wamp? configuration?
thanks!
Regarding the errors, thanks for letting me know, but those aren't errors, those are notices, maximum a few warnings but I will still have a look on them and fix them for the next release so we won't have any problems with them either.
Cheers,
I want to make a Russian translation.
Thx.
Unfortunately there is no messages.po file with all the text needed to be translated available as there is a lot of changes going on till 1.0 so till then you can get all the texts from the source code using poedit.net (thanks to Sintacs) and then write your own po file.
Cheers,