0

So, I am using Google Doc Viewer to show .docx documents and it works fine, but it sometimes takes too much time to load and times out. I tried the Microsoft one and it looks pretty fast, but my problem is I need it to be in Spanish.

In the case of Google Doc Viewer I am using this syntax:

<iframe src="https://docs.google.com/gview?embedded=true&hl=es_LA&url=https://myserver/file.docx" width="100%" height="350" style="border: solid 1px #DDD; margin-bottom: 1rem;"></iframe>

As you can see the hl=es_LA indicates the language. The final result shows something like this in terms of language: enter image description here

The syntax for the Microsoft one is:

<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=https://myserver/file.docx&amp;wdStartOn=1&amp;wdPrint=0&amp;wdEmbedCode=0" width="100%" height="350px" frameborder="0"></iframe>

I tried adding lang or language to the query parameters, but it didn't make any difference. I always get it in English.

Is there a way to configure the language the way it's configured with Google Doc Viewer or does it take the default OS language / Browser Language for the embedding?

Mihail Minkov
  • 2,463
  • 2
  • 24
  • 41
  • 1
    You may try this [Office Online Integration Documentation](https://buildmedia.readthedocs.org/media/pdf/wopi/dev/wopi.pdf) – Joshua Ooi May 07 '21 at 04:09
  • @JingXian could you expand on this? I found the `UI_LLCC` option, but I can't seem to find how to add it to my URL, I tried in different ways, but it's not working. The locale I need is `es-ES` so I tried things like `?UI_LLCC=es-ES&url=...` but it didn't work. In the examples I see this `` but I am not sure how to use it in the URL. Any ideas? I am not using any integration or ASP, I'm just using the iframe embed. – Mihail Minkov May 07 '21 at 17:19

1 Answers1

1

To change the language of Office Online Doc Viewer via URL parameters you need to add ui=your_locale.

In your case, the URL would be https://view.officeapps.live.com/op/embed.aspx?src=https://myserver/file.docx&amp;wdStartOn=1&amp;wdPrint=0&amp;wdEmbedCode=0&amp;ui=es-ES

Boneus
  • 356
  • 2
  • 7
  • I tried this, but it's not doing anything about the locale of the viewer. – Mihail Minkov Sep 29 '21 at 19:08
  • @MihailMinkov Hmm, I used `ui=ru-Ru` and it worked for me. Try this example: https://view.officeapps.live.com/op/embed.aspx?src=https://okdent-spb.ru/wp-content/uploads/2021/09/prejskurant-2021.09.26.xlsx&ui=ru-Ru The interface should be in Russian. Then try to remove `ui=ru-Ru` and it should become in English. – Boneus Oct 01 '21 at 09:16
  • Ok, this does work, apparently the issue are the url-encoded `&` I changed them to `&` and it worked. Thanks! – Mihail Minkov Oct 01 '21 at 17:00
  • where can I find a list of parameters for this Office Web Viewer product? I can't find its documentation anywhere – Duc Nguyen Jun 21 '22 at 02:46
  • @DucNguyen sorry, I can't remember where I found it – Boneus Jun 28 '22 at 08:15