Translated metadata in database


While writing a WordPress plugin for Zenphoto I noticed that some of the database entries contain localized metadata.
For example for some images EXIFExposureTime is "1/250 sec" while for others (newer ones) it is "1/250 sek". Other metadata fields are affected as well (e.g. EXIFMeteringMode may contain translated text).

Is this expected behaviour? I think this makes parsing of and working with metadata unnecessarily complex.



  • acrylian Administrator, Developer
    Yes, seems you are right. There are some values `gettext`ed in the exif handler that should not. Basically you get the language stored you had Zenphoto set to when the values are imported. These values are not multilingual anway so that should not be there.

    I have removed those I found quickly in the master (support build). Not sure if those are really all currently though.
  • Thank you for the quick reply, acrylian!
    I found localized entries for at least the following metadata fields in my Zenphoto database:

    - EXIFExposureTime
    - EXIFFNumber
    - EXIFMeteringMode
    - EXIFFlash
    - EXIFImageWidth
    - EXIFImageHeight
    - EXIFFocalLength
    - EXIFGPSLatitude
    - EXIFGPSLongitude

    My guess is there are more.

  • acrylian Administrator, Developer
    It may very well be the one function I changed but I have to look further the next days.
  • Acrylian,

    One has to be careful about strings that need to be translated and strings that need NOT to be.

    For instance, EXIFExposureTime is a variable name and should not be translated so the EXIF data is parsed properly. The same should apply to exported strings – when pictures are exported, for example.

    On the other hand, when the information is _displayed_ on the webpage, it needs to be displayed in readable language and translated accordingly.
  • acrylian Administrator, Developer
    Values like EXIFExposureTime are not translated at all as that is the name of the table row on storage. Only the actual values that contained "sec" were as that was appended gettexted. Which I fixed. So now it is always "sec" as it is stored.

    Meta data fields are not multilingual capable so you get what is stored. I think it would be some overhead to changed that just for this. We might take out the "sec" value alltogether later and use it only on display. Have to look at this as I am not a photographer myself so I rarely use meta data like this actually.
Sign In or Register to comment.