![]() |
|
Multilanguage for database fields - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: Multilanguage for database fields (/thread-3285.html) |
Multilanguage for database fields - NicoD - 15-07-2008 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. Multilanguage for database fields - sbillard - 15-07-2008
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: Then you can have your custom functions map the field into the appropriate destinations:
Multilanguage for database fields - NicoD - 15-07-2008 Thank you very much sbillard for your answer, I will try to do it. Multilanguage for database fields - NicoD - 16-07-2008 After a long reflection, I have decided to use unnecessary fields for my application (like credit and the city) for the translations FR/ENG concerning the title field and the descriptions field. 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. Multilanguage for database fields - sbillard - 16-07-2008 OK, but be aware that each upgrade the positions and names of these will revert. Multilanguage for database fields - NicoD - 16-07-2008 Yes, I will have to redo the modifications each time I will upgrade ZP but there is not a lot of code changes. 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 ... :/ Multilanguage for database fields - sbillard - 17-07-2008 When do you intend to go live? This discussion caused me to do some thinking. I am working on adding multi-lingual to the database items. I have a proof of concept working now, but not all fields are converted. If you can wait, you may save a bit of effort. Multilanguage for database fields - NicoD - 17-07-2008 It would be great if the title and the description fields could be translated. In fact they are the only fields that I need to translate... 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. Multilanguage for database fields - sbillard - 17-07-2008 Just a little testing to do and these changes will be in the development build. Should make the end of July easily. I trust you will help with the testing! Multilanguage for database fields - NicoD - 17-07-2008 Ok for the testing ;-) |