This plugin allows the admin to add titles and descriptions for albums/pictures/categories in multiple langauages. The visitor can then see them in mulitple langauges when he/she changes the language.
This plugin requires to add hooks in index.php and include/functions.inc.php files. For this you will need to edit these filesDetailed instructions on how to install and use the plugin are given in the readme.txt which is present in the attached zip file. Also i am attaching the readme.txt separately for newbies.
How to install
- First enable the plugin from cpg config if they are disbaled. Then install the plugin from plugin manager page. (As you would do for any other plugin)
- During installation you will be asked to select the languages you want to support i.e. langauges in which you want to input the titles and descriptions.
- Move the mod_lang.php file which is present in the plugin directory to the coppermine root directory i.e. parallel to index.php of coppermine.
- Then edit index.php and include/functions.inc.php to add hooks for the plugin. This is the most important step and should be done carefully.
How to Use
- You should add titles and descriptions for categories/albums/pictures as you normally do.
- After the plugin is installed and files have been modified open http://yoursite.com/cpg_folder/mod_lang.php in a browser. You need admin perms to access this page.
- Before adding texts for multi languages you should always synchronize the categories, albums and pictures. There are links provided on this page for the same
- Then chose the categories, albums and pictures, for which you want to add language texts, from the drop down provided.
- Input the language texts and press submit. You can use bbcodes.
- The visitors will then be able to see the titles and descriptions in the language they selected.(Provided you have entered the translation in that language)
- Whenever categories/albums/pictures are added/edited/deleted, the language table needs to be synchronized. This can be done from mod_lang.php page. This is very important to make plugin work.
How to add hooks in index.php and include/functions.inc.phpEdit index.php
Add (in function get_subcat_data)
$subcat['description'] = CPGPluginAPI::filter('lang_convert', $subcat['description']);
$subcat['name'] = CPGPluginAPI::filter('lang_convert', $subcat['name']);
just after
foreach ($rowset as $subcat) {
then Add (in function list_albums)
$alb_thumb['description'] = CPGPluginAPI::filter('lang_convert', $alb_thumb['description']);
$alb_thumb['title'] = CPGPluginAPI::filter('lang_convert', $alb_thumb['title']);
just before
if (isset($cross_ref[$aid])) {
then Add (in function list_cat_albums)
$alb_thumb['description'] = CPGPluginAPI::filter('lang_convert', $alb_thumb['description']);
$alb_thumb['title'] = CPGPluginAPI::filter('lang_convert', $alb_thumb['title']);
just before
if (isset($cross_ref[$aid])) {
-----------------------------------------------------
Edit functions.inc.php
Add (in function build_caption)
$row['caption'] = CPGPluginAPI::filter('lang_convert', $row['caption']);
$row['title'] = CPGPluginAPI::filter('lang_convert', $row['title']);
just before
$caption='';
then Add (in function breadcrumb)
$category[1] = CPGPluginAPI::filter('lang_convert', $category[1]);
just before
$breadcrumb_links[$cat_order] = "<a href=\"index.php?cat={$category[0]}\">{$category[1]}</a>";
and Add
$CURRENT_ALBUM_DATA['title'] = CPGPluginAPI::filter('lang_convert', $CURRENT_ALBUM_DATA['title']);
just before
$breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
then Add (in function get_pic_data)
$album_name = CPGPluginAPI::filter('lang_convert', $album_name);
just after
if ((is_numeric($album))) {
$album_name_keyword = get_album_name($album);
$album_name = $album_name_keyword['title'];
That's it. The plugin is now ready for the use.
Note: This is experimental plugin and is in a very early (alpha) stage. Also this is not recommended for large galleries where there are thousands and millions of pictures.Abbas
[Edit GauGau 2010-03-05]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/
It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.
Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_multilingual_v1.1.zip/download
[/Edit]
I am going to test this plugin and i will tell my modifications
Thanks a lot
Hello
It seems to be a great plugin, it is easy to setup and to use.
During the setup of plugin :
Select the languages you want to use :
No french file ? ;)
Can you explain why we have to synchronize ?
My origin lang were english, i have to check "french" to add the french language, correct ?
Here mod_lang.php, in album, i see "select category" or "User gallery". How to add the french translation on a album ?
Because here there is not my album list.
To add a lang for an album name : I think it could be easier to have the lang in this modification album page modifyalb.php?album=13 in a drop-down list (choose the langage we have setup before and fill here the new translation)
Thanks
Isa
Quote from: antisa33 on July 18, 2006, 05:29:31 PM
Select the languages you want to use :
No french file ? ;)
The lang files shown on configuration page are taken from the lang directory. So if french.php is not there in lang directory then french won't be shown for selection. Only those langs are shown for selection whose corresponding lang files are present in lang directory.
Quote
Can you explain why we have to synchronize ?
The translations are stored in a separate table. We need to add category/album/picture titles and descriptions to this new table. For this we need to synchronize the original tables with the translation tables.
Quote
My origin lang were english, i have to check "french" to add the french language, correct ?
Yes. You can check any number of langauges in which you want the titles to be translated.
Quote
Here mod_lang.php, in album, i see "select category" or "User gallery". How to add the french translation on a album ?
First synchronize the categories/albums/pictures. Then to enter translation for albums select the category from the middle drop down box. All the albums in that category will be shown and you can then enter the translations for the albums.
Quote
To add a lang for an album name : I think it could be easier to have the lang in this modification album page modifyalb.php?album=13 in a drop-down list (choose the langage we have setup before and fill here the new translation)
For this modifyalb.php will needed to be hacked. I wanted to create a plugin instead of hack hence nothing modified on modifyalb.php
Ok i understand how it works. I am very happy to have your plugin.
The first time i went on mod_lang.php, it was possible to choose the langage to add, after running it one time, is it possible to add langages more ?
- I can't modify any album name, i have a lot of english albums, i clic on the 3 synchronise button, it works, but in the middle albums dropdown list, i just see : Albums : I can choose between "Select category" or "user galleries", but i dont see any albums.
I have the lastest version of coppermine.
- Is it possible to say to the browser to autodetect the langage of the user ?
- Is it possible than when a french user will come on my website, that english and spanish comments dont show ?
Thanks very much Abbas Ali, when your plugin will works for me, Coppermine is the best gallery i have ever seen.
Thanks
Isa
You have originally requested this plugin on the paid support board (Mod Multi langage ? (http://forum.coppermine-gallery.net/index.php?topic=33851.0)), so you might consider paying Abbas Ali a fee. Please discuss payment on the other thread I refered to. If Abbas should refuse to accept money, there are other methods of giving something back - see We need your help (http://forum.coppermine-gallery.net/index.php?topic=14227.0). Thanks.
Sure, i know that i will pay Abbas or give something !
But before i would like the plugin to work, because now, i cant modify album name and picture titles
Thanks a lot
May be i dont see my album list because i dont have any categorie ?
When i clic in the drop down list "Pictures of Album", i see the list of my albums, when i clic in one, there is nothing, i see Manage multiple language strings but nothing behind.
Thanks
Isa
@Isa: I forgot to include the zeroth category albums... that means you found a bug in the plugin ;). I will update my first post with the new plugin soon.
As far as comments are concerned, this plugin doesn't handles them. Also browser detection and things like that are not in the scope of this plugin.
Lastly (as of now) you cannot change the languages once the plugin is installed. If you want to change the languages then uninstall the plugin and while doing so it will ask whether to keep the database table or delete. Select the option to delete the database table. And then reinstall the plugin and choose the languages you want to support.
I have updated my first post with new plugin. Replace current mod_lang.php with the new one from the zip file.
Also if you could PM me your cpg admin un/pass, i will also take a look.
Hello Abbas Ali !
Thanks for the no category support :) ! It works very well !
It is ok, but i made a mistake, and i didn't select the right langage, i have to unintall the plugin and reinstall it :-\
Do you think in the futur you will change this ?
Because, when i will have the time, i will translate all my cpg website albums name etc in an other langage, i a would be able to add a langage this moment.
If you cant made a modification, could you explain to me, how to add a langage in the table by the hand ? (without a script ) Is it possible ?
What about the comments ? How can we do for a spanish to dont see deutch comments for example ?
Thanks a lot, i send you a private message to discuss in PV.
Isa
Ok i will try to modify the plugin so that languages can be changed later. But this will take time...
As i told you earlier comments won't be that easy to handle. It is difficult to know in what language the user entered the comment. So for now comments are not supported.
Hello Abbas,
For the comments, i think the user choose a flag at the begin, so we know what langage he is using.
I have add some translations now, but if i clic on synchronise button, will it delete my translations ? ==> No it is ok, it keep all translations
Why the synchronise buttons are not automatically loaded ?
Thanks a lot
Isa
If somebody want to add the mod_lang.php in admin menu, in your theme.php in
// HTML template for gallery admin menu
add
Quote
<!-- BEGIN lang -->
<td class="admin_menu"><a href="/mod_lang.php" >Translation</a></td>
<!-- lang -->
Just after
Quote
<!-- BEGIN documentation -->
<td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
I found an other futur request for this great plugin.
When a user want to uload a picture on the website (/upload.php), he doesn't see his album names in his langage.
The title and description that he is adding is not store in the correct langage.
The correct flag is selected at the begin of the website, so we know what is the user langage, to store informations with good langage.
Quote from: antisa33 on July 20, 2006, 02:34:23 PM
If somebody want to add the mod_lang.php in admin menu, in your theme.php in
[...]
Will not work for all themes - this is theme-dependant.
Please don't clutter this thread with feature requests.
Hello Abbas, i have done my french and english translations.
How can i add a langage now in the plugin :-[
Is it possible ?
I can do it in the database if need...
Thanks
Quote from: Abbas Ali on July 20, 2006, 07:12:53 AM
Lastly (as of now) you cannot change the languages once the plugin is installed. If you want to change the languages then uninstall the plugin and while doing so it will ask whether to keep the database table or delete. Select the option to delete the database table. And then reinstall the plugin and choose the languages you want to support.
Yes but it will delete my french and english translations if i desinstall the plugin ?
Yes it will delete your current translations. I will look into it and let you know how to add a new language in few days.
I installed the plugin with japanese. I didn't fill japanese. But i want to add the Dutch langage.
Do you think i can fill the japanese field with dutch and go in the database to find "japanese" and replace by "dutch" in the translation table ?
Ok here you go...
First take a backup of your current database then go to database via phpMyAdmin or any other tool. In the cpg_config table there will be one row with 'name' column as 'mod_active_lang'. The 'value' of that row will be a string with your current languages (something like french,japenese). Edit the value to whatever language you want. Example french,dutch. Note that it is a comma separated string. There should not be any spaces between the commas or lang names.
Attached is the revised mod_lang.php file. Download it and replace your current mod_lang.php with this one. Then open the mod_lang page in browser and click on "Synchronize Languages" tab. This will add/delete the languages as per the settings in config i.e. as per the lang string you edited in the config table.
Hello
Thanks Abbas !! I have done what you said and japanese is become dutch :)
Fortunately i installed the japanese langage more the first time ::)
Thanks
Is it possible to add this plugin on a 132 coppermine version ?
Because i have a 132 version very modified and i can't upgrade it.
If we can and if it is not automatic, i could do it.
Thanks
cpg1.3.x does not support plugins. Plugins were introduced in 1.4. So we cannot add this rather any plugin to cpg132.
Hi,
I installed and edited everything correctly, but when I want to submit the translation I get this error:
Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.
Anyone know what this means?
EDIT: I found that when deleting this in joomla.inc.php it does translate without errors
checkInputArray( $_GET );
checkInputArray( $_POST );
Is this wrong to delete?
Don't have any idea about bridge files.
Hi Abbas
There are a module for Xoops, in that you can translate any thing capable of route interfering form.
very simple to translate: Yo especifi a lang, ([en], [fr], [es])
and in any form, you can post all the content in all langs..., for example: field Title: [en]Photo Title[/en][fr]Foté Titulé[/fr][es]Título Foto[/es]
is very good i think...
well, is a suggestion, maybe is impossible in the cpg core...
or maybe is dangerous, but is a suggestion if you did'nt kewn, i don't know much php
http://www.xoops.org/modules/repository/viewcat.php?cid=111
http://xoops.org.cn/modules/wfdownloads/singlefile.php?lid=314&cid=8
well, greetings
Thanks Quinti for the suggestion. The plugin which i have created is not well designed and i don't like it myself. I will go through the xoops site.
first of all thanks for this great plug!!
worked fine until I upgraded to 1.4.13 applied the mods in index and functions php files... info in the database still there, but it doesnt show the info in the different languages...
Any ideas?? thanks in advance!
Make sure that the plugin is activated from plugin manager page.
This topic has been moved to Looking for Freelancers / Paid help (http://forum.coppermine-gallery.net/index.php?board=30).
http://forum.coppermine-gallery.net/index.php?topic=51507.0
Can I install this plug-in on 1.3.4 version?
Of course not. 1.3 does not have a plugin system. Update your gallery.
I just update gallery, and install this plugin... This is great plug-in!
Very useful for multilingual sites!!! And what important - very simple install)
Can I add new languages to this plug-in after install?
I must confess that though i wrote the plugin - i almost forgot how it works. I think you cannot add new languages after install.
hi there, i have installed your 'Multi Lingual cat/alb/pic titles and descriptions' plug in and it works great. But I have also installed 'title below thumbnail' link > http://forum.coppermine-gallery.net/index.php/topic,25076.0.html (http://forum.coppermine-gallery.net/index.php/topic,25076.0.html)
unfortunately these 2 plug ins do not work together, do you have any suggestions.
i have also requested the same from the other plug in creator.
pixstreet
can someone tell me what's going on... this plugin at my gallery left off to work (((
all was fine, but yesterday, all new additions don't show at the gallery... I try to explain more detailed:
when I add/change description in mod_lang.php and then save changes, this description don't appear at the displayimage page under picture... in original description changes work... but when I add it at mod_lang.php - not. But in mod_lang.php this changes - saved. And in MySQL - saved.
In some languages changes don't work, but one language don't work at all... all descriptions don't show when I click on flag - it shows on original language - english.
Tell me please what can be a reason in?
it works fine , any new version on the way ?
I have created a button in admin menu for mod_lang.php
in ./include/themes.inc.php >> function theme_admin_mode_menu()
after
'{DOCUMENTATION_TITLE}' => $lang_gallery_admin_menu['documentation_title'],
'{DOCUMENTATION_LNK}' => $lang_gallery_admin_menu['documentation_lnk'],
add
'{MULTILANG_TITLE}' => $lang_gallery_admin_menu['multilang_title'],
'{MULTILANG_LNK}' => $lang_gallery_admin_menu['multilang_lnk'],
it works fine , any new version on the way ?
I have created a button in admin menu for mod_lang.php
in ./themes/yourtheme/theme.php
after
<a href="albmgr.php{CATL}" class="admin_menu" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a>
add
<a href="mod_lang.php" class="admin_menu" title="{MULTILANG_TITLE}">{MULTILANG_LNK}</a>
in ./include/themes.inc.php >> function theme_admin_mode_menu()
after
'{DOCUMENTATION_TITLE}' => $lang_gallery_admin_menu['documentation_title'],
'{DOCUMENTATION_LNK}' => $lang_gallery_admin_menu['documentation_lnk'],
add
'{MULTILANG_TITLE}' => $lang_gallery_admin_menu['multilang_title'],
'{MULTILANG_LNK}' => $lang_gallery_admin_menu['multilang_lnk'],
in ./lang/yourlang.php , in $lang_gallery_admin_menu = array(
after
'documentation_lnk' => 'Documentation',
'documentation_title' => 'Manuel de Coppermine',
add
'multilang_lnk' => 'Multi Lang.',
'multilang_title' => 'Languages for Categories Albums Photos',
@anselmej: your profile looks very "familiar". After all, it looks like you're rufus (http://forum.coppermine-gallery.net/index.php?action=profile;u=60451) in disguise (same country, same IP address band, same freemail provider, identical language skills). Therefor, I'll ban the account "anselmej" for 3 days. If you're not rufus in disguise, I apologize for the delay and the wrong assumption.
Joachim
What about upload index.php and functions php?
For beginners it will be much better...
@marw: Didn't understand what you are tying to say. Please elaborate.
I have problems with editing functions.php and index.php...
Please, Be detailed (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270615.html#msg270615)!!
What kind of problems do you have?
Hello,
I hope someone will still read this topic. I'm from the Netherlands so pleas don't mind my english writing...
I've just installed the multiple language plugin. It's working great! This wil be the basic for what i'm looking for.
What i want is that the translation also dissapears on the albmgr.php page. I've made from the dutch albmgr.php a page that is be able to see for te guests as a kind of specieslist (so no thumbnails, only a list of the albums and by clicking on the species/album the page with tumbnails will apeare in an other frame).
Now i also want to do this for some other languages. That's why i need the translation also be able to see on the albmgr.php page. Its oke if i have to make an other page like albmgr_englisch.php, that is wat i finally want.
I hope someone will help me on this.
will there be a similar plugin for version 1.5?
Yesterday I downloaded version 1.5.3 release candidate and the file english_gb.php does not appear to be as big as the previous files (it may be damaged.)
thank you for any help or answers.
No plans to do a plugin for 1.5 as yet. Might happen in future.
Anyway, please don't clutter threads with requests for other versions. We have been through this many times over: every time a new coppermine version comes out, users flood the threads for the old version with requests to see the mod / plugin / theme /whatever ported to the new version. We're not fond of this, as it doesn't help at all and only is confusing. If a developer wants to port a plugin, he will. If you need it badly, you're welcome to port it or hire someone to do that for you. But please don't clutter the board with requests for ports.
Thanks for this plug-in.
Installed it yesterday and it is working perfectly on my Gallery.
Great.
Harald
www.haraldlabout.nl
Hi, thank you for the plugin, it is great.
The only problem is:
in the thumbnails.php it does not change the name of the album.
see:
http://pappel-art.com/Coppermine/thumbnails.php?album=1
Thank you for your help!
Solved, I forgot to update the last line!