Hi,
I would like to modify the database scheme to have the multilanguage support (2 languages in fact) for some fields of "albums" and "images" tables like the title and the description fields. I would like use the "dynamic-locale" plugins to switch between the 2 languages.
It's specify in the dynamic-locale documentation page that I have to create a set of custom functions to handle database strings and need a scheme for storing multiple versions of texts.
My questions...
1/ Is it possible to modify Zen Photo without lost the possibility to upgrade it in the futur ?
2/ In which file could I modify the database scheme and add title_fr and description_fr fields in the tables ?
3/ Where could I code a set of custom functions to handle database strings ?
Thank you by advance for your help.
Nico.
Comments
2. You modify the database schema directly with a tool like phpMyAdmin. You do have the "custom data" fields already in zenphoto that you could use for a second language. However that is just one field per object.
3. You can create custom function in a file in your theme or you can create a zenphoto plugin (http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/) if the functions are to be generally used. Generally you can use the class get() and put() functions with any database field so your custom functions could do things like `return $get('title_fr');` to return your French title.
Your biggest challenge is that there is no Admin support for editing your new fields. Perhaps you could consider the following idea:
Use the custom data fields that are already present. They can be edited with the admin interface. Setup a convention for how your data will be placed: for instance it could be:
`title` | `description` | `...`.
Then you can have your custom functions map the field into the appropriate destinations:
`$translations = explode('|', getAlbumCustomData());`
Then `$translations[0]` would be the title, `$translations[1]` the descriptions, etc.
I have just changed the file admin.php of the zp-core to rename and move the labels for a better comprehension in the administration.
I also have to code some functions like printImageCity() and getImageCredit() to have access to this informations from the image template. I have found it nowhere ...
If you can wait, you may save a bit of effort.
With your work could I use the "dynamic-locale" plugins to switch between the 2 languages ?
If you publish it before the end of July, I could be interested by your modifications.
Please report problems through the ticket system so we can keep tabs on them. Remember that this is a brand new feature. There may be some things that don't quite work right. Let us know.
I have no time to test it before monday, so I will keep you in touch during the next week.
Thank you by advance.
Generally it is a better choice to use the nightly builds. In your case that is my recommendaton. All the language changes are in the build from 2008-07-20.
It's exactly what I need !
I will test more seriously and tell you if I found some problem.
I am afraid that the multi-lingual titles interfere with the printImageStatistic() function. On albums whithout multi titles it works fine.
BO > Back Office, admin
Sorry for the abbreviation...
I have not sure is there other language have similar case, but for chinese, there is got zh_HK, zh_TW, zh_CN, zh_sg. They may have different wording/written form, but basically the people could understand each other wording.
So that if only have zh_TW installed, I can set something like (zh_HK|zh_CN|zh_sg) equal to zh_TW, zenphoto will output zh_TW translation for those 3 defined in browser.
Other languages, specially Spanish have a similar situation. ez_ES displays simply as Spanish.
BTW, our tables do not include zh_sg, should it be added?