• Resolved clauded007

    (@clauded007)


    I’m using Google Calendar as backend. When adding a Google Meeting to an event, Google adds 2 links in the description:

    Join with Google Meet: https://meet.google.com/zzz-xxxx-xxx

    Learn more about Meet at: https://support.google.com/a/users/9282720

    My web site is in french but the description added by Google is in english. When I extract the calendar from my browser, the description is in french.

    Is there a way with ICS to specify the language?

    • This topic was modified 2 years ago by clauded007.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author room34

    (@room34)

    Unfortunately ICS Calendar can’t translate any of the text that is contained within the feed itself. However, you may be able to change the language Google is using when generating the feed:

    https://support.google.com/calendar/answer/50640

    Thread Starter clauded007

    (@clauded007)

    The calendar is already in french. I was thinking of using something like that in ICS:

    curl_setopt($ch, CURLOPT_HTTPHEADER, [‘Accept-Language: fr’]);

    Plugin Author room34

    (@room34)

    Ah… that’s an interesting idea. If you want to test it out, you could edit the class-r34ics.php file, inserting that line of code into the _url_get_contents() method around line 1926. Note that in this method, the connection variable is $conn not $ch so the code would look like this:

    curl_setopt($conn, CURLOPT_HTTPHEADER, ['Accept-Language: fr']);

    If that works, I can update the plugin to include that line, dynamically inserting the site’s configured language.

    Thread Starter clauded007

    (@clauded007)

    It works. Not sure if you should use the site language or the browser language however…

    Plugin Author room34

    (@room34)

    Thanks… you make a good point about the site language vs. the browser language, but everything else (i.e. month and day names) is getting translated on the server side based on the site language, so I think for consistency that’s probably the best approach. (Also I don’t think there’s a way in this particular context to know the browser language anyway.)

    Thread Starter clauded007

    (@clauded007)

    Maybe months and day names should be based on the browser language (that’s the way GC does it)… Plus an option to use the server language if one really don’t like it.

    Plugin Author room34

    (@room34)

    That’s not really a viable option. ICS Calendar is using built-in WordPress functions to handle all of those translations. It’s all (of functional necessity) server-side logic.

    Plugin Author room34

    (@room34)

    Upon a bit more investigation… it looks like it may be possible to code the plugin to use the browser’s language instead of the site’s configured language, by using the PHP $_SERVER['HTTP_ACCEPT_LANGUAGE'] variable. But it will be a more substantial undertaking than I can quickly roll out in a minor update (which is what I am planning to do with this code change we’ve been discussing so far).

    (One particular example of an issue: this would conflict with any type of caching currently in use, either in ICS Calendar itself or other third-party caching plugins.)

    I’m going to add this to the longer term to-do list for the project.

    • This reply was modified 2 years ago by room34.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Translation problem with Google calendar’ is closed to new replies.