Translating the WP time_format

Home Forums Calendar Products Events Calendar PRO Translating the WP time_format

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1285886
    Kate Guy
    Participant

    Is there any way I can change time time_format depending on the language? I want to use a 24 hour clock for French, so instead of g:i A, I would use G:i.

    I’m using WPML, and using String Translations I found two tribe entries relating to this:

    domain: tribe-events-calendar-pro
    string: M j, Y @ G:i

    domain: the-events-calendar
    M j, Y @ G:i

    However, it doesn’t look like these are being used, and they are already the “G” format anyways, which I guess isn’t being used.

    I did notice that tribe uses the get_option(“time_format”) under general settings. But unfortunately I don’t think WPML allows for me to change these for two different languages. If I change the language to French and update the options, it just overrides the English as well.

    Any ideas?

    #1287218
    Cliff
    Member

    This snippet may come in handy: Customizing/Changing any bit of text (actual code snippet is at the very bottom) — or using the Say what? plugin (third-party, not guaranteed or supported by us) might be easier to setup and use to do the same thing as our provided code snippet (although it may not apply in this use case).

    The use of get_option() is filterable. Therefore, you could override the value via the option_{$option} filter hook, like this:

    add_filter( 'option_time_format', 'your_custom_function' );

    If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.

    Please let me know if you need any further assistance.

    #1297269
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Translating the WP time_format’ is closed to new replies.