how to change default UI language for all users in command prompt in ubuntu 18.04?

Hi all , I`m trying to build a new fresh environment for user desktop with libreoffice 6
althrough I install language pack

libreoffice-help-zh-tw/bionic-updates,bionic-updates,now 1:6.0.7-0ubuntu0.18.04.2 all [installed]
libreoffice-l10n-zh-tw/bionic-updates,bionic-updates,now 1:6.0.7-0ubuntu0.18.04.2 all [installed]

but default UI language is still English , that maybe related to client`s locale setting ( which is set to en_UW.UTF8).

is there anyway to change the default UI language to transitional Chinese without change user`s locale ?

I try to update the registrymodifications.xcu , change ooLocale to zh-TW , but it`s not working , UI still in English .

and I also try to update /usr/shares/applications/libreoffice6.1-writer.desktop
append --language=zh-TW after the Exec string . it wroks !
but is there any system wide configuration to set the libreoffice UI language ?

I find there`s a folder in /etc/libreoffice , can I configure the language settings here ?

What you are talking about is post deployment configuration. You’d need to provide relevant settings as .xcd to your installations’ share/registry.

I found there`s a item named UILocale instead of OOLocale , change UILocale value to zh-tw , then UI language will be in zh-tw .

but Im still wondering if theres a system wide configuration to config the UI language for all users ? or otherwise , I have to update all users registrymodifications.xcu …

I have mentioned the post-deployment configuration help; here I gave an answer how to prepare the .xcd, which e.g. on my Ubuntu is to be put to /opt/libreoffice6.1/share/registry. HTH.

Save this as an .xcd into <lo_instdir>/share/registry on your workstations:

<?xml version="1.0"?> 
<oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oor="http://openoffice.org/2001/registry">
  <dependency file="main" />
  <oor:component-data oor:name="Linguistic" oor:package="org.openoffice.Office">
    <node oor:name="General">
      <prop oor:name="UILocale"  oor:op="fuse" oor:type="xs:string">
        <value>zh-TW</value>
      </prop>
    </node>
  </oor:component-data>
</oor:data>

See post deployment configuration.

Steps to create an own .xcd file for a random property (on the UILocale taken as an example):

  • Find the relevant setting in the registrymodifications.xcu. To do that, first backup the registrymodifications.xcu; then launch LibreOffice and make necessary configuration changes in UI; close LibreOffice and compare the new registrymodifications.xcu with its backup.

In this example, it’s

<item oor:path="/org.openoffice.Office.Linguistic/General"><prop oor:name="UILocale" oor:op="fuse"><value>en-US</value></prop></item>
  • Find an existing .xcd in <lo_instdir>/share/registry, where the schema for the setting is defined.

In this example, it’s main.xcd, where the setting is defined like this:

<?xml version="1.0"?>
<oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oor="http://openoffice.org/2001/registry">
    ...
    <oor:component-schema oor:package="org.openoffice.Office" oor:name="Linguistic" xml:lang="en-US">
        ...
        <component>
            ...
            <group oor:name="General">
                <prop oor:name="UILocale" oor:type="xs:string" oor:nillable="false">
                    <value/>
                </prop>
                ...
            </group>
            ...
        </component>
        ...
    </oor:component-schema>
    ...
</oor:data>
  • Create a new .xcd XML file with oor:data top-level element. Add the file with schema (main.xcd in this example) as the dependency for the newly created file by specifying <dependency file="main" /> as direct child of the top-level element.

  • For the oor:component-schema element from the schema file above, add relevant oor:component-data element there, with oor:name and oor:package attributes as in the schema. For each nested group element in schema, add a node element as a direct child of oor:component-data or higher-level node. Add the prop element, with relevant oor:name and oor:type attributes; it should also have oor:op attribute, which typically has fuse value; other possible values are modify, replace and remove. Add the desired value as the text of value element under the prop element.

there is already a file “Languagepack-zh-TW.xcd” in that folder , so it is not about setting UI ?

<?xml version="1.0"?>

<oor:data xmlns:xs=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:oor=“http://openoffice.org/2001/registry”>
<oor:component-data oor:name=“Setup” oor:package=“org.openoffice”>



OpenOffice.org




</oor:component-data></oor:data>

It is about the locale installed (= available for selection), not selected.

and is there any documents about add customized configuration using xcu ? I want to change default MeasureUint too, but I can not find any document about that in post deploymeant configuration about the XML syntax.

thank you so much, I will try to create some xcd file according to your instructions.