Need Plex developer's help in answering locale question

I'm hoping someone with more plug-in experience can point me in the right direction on this. I have created the extended personal media plug-in and as part of the functionality users can pick a date format to include in the episode title. I'm using the strftime formatting method and it contains a couple of month and day formatting patterns that can be localized. Unfortunately it looks like the metadata agent plug-ins always start-up with their locale set to en-us. This results in the date being formatted using US English month and day names.

 

Is this expected or do the users that are expecting locale specific values have their servers setup incorrectly? I have been looking through the documentation and other plug-ins and haven't been able to find an example of any plug-ins doing anything locale specific.

 

Thanks in advance.

Library sections do have an associated language which agents can access. Away from keyboard but if you look at the tvdb agent you’ll see.

Thanks for the information elan.

I have actually looked through the source of the TVDB plug-in and it doesn't quite match what I'm trying to do. In every other plug-in I look at the metadata agent is actually calling out to another platform to get the information. In my case I am staying on platform and using the locale of the server to format a date string appropriately. I had expected that the Plex agents would know what locale they were in already. When this wasn't happening I used the local.setLocale() call to set the time locale to language that was set on the metadata agent. There are a couple of drawbacks with this solution:

  • the Python documentation does not recommend calling locale.setLocale() multiple times and it is a process wide change
  • calling locale.setLocale() doesn't take the same locale string on different platforms - my current code works fine on Windows but I have had end users report issues on Mac with the same locale strings which are the Plex provided ones (ex: en, fr)

I really do appreciate any assistance that you can provide.

- Mitch

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.