How do I change or set a language on a page?

Hello all,

So I have my wiki configured to only allow 1 language, English. However, some pages don’t seem to be getting any language assigned at all. These are normal wiki pages without any special code or scripting.

How do I change the page language of an existing page?

I’m hoping I can do this to my templates as I believe these are the root cause. Then update the existing pages with a script or something.


So you mean the <defaultLanguage> field is empty in the XML representation of the page? For example if I go to I can see <defaultLanguage>en</defaultLanguage>.

At the API level there’s a XWikiDocument#setDefaultLocale(Locale locale) API.

Also I’ve checked and it seems that this field is set when a page is edited for the 1st time. I can see the following in the Edit Action: xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/ at a91776de0b7bd2b851e56b0cc6bb8c78be2e7bdb · xwiki/xwiki-platform · GitHub. This indicates IMO that those pages you mention have been created programmatically and no default language has been set for them.

So yes you can use XWikiDocument#setDefaultLocale(Locale locale) or XWikiDocument#setDefaultLanguage(String language) (Deprecated) to set a default language.

There’s no UI to set the default language AFAIK.

Note that this requires PR since there’s currently no API to set the language in the Document class… We need to fix this.

Note: another user reported Loading... today :wink:

@Enygma also pointed me to

Thanks for your responses Vincent and sorry for the late reply.

I’ve checked a few things and it seems something is overriding the default language as set under the administration panel. Is there a setting in the config files I should be aware of?

I turned on multilingual support as shown below,

And then whenever I create a page the right hand panel has a blank default language:

I tried checking the xml as you suggested but my wiki instance doesn’t seem to like it, my browser just hangs. Note that most of my pages are terminal, but did try with Main/WebHome and got the same problem. Any idea what might cause this?