Documentation/HowTo/Impress/Make template language independent

Description of the problem
When you create a template (for Impress for example), many informations are stored in your file. If you want to share it in an international environment (propose it to template site for instance), you need to remove all information about your localization (language, money unit, date format...). Otherwise, user need to modify language of many styles in each master page. If template was created by a German speaking user, orthography checking will be done in German.

This how-to explains how to remove all these informations (plus some extras), so that a new user opening this template will have orthography checking in his own language, whatever the language of the template's creator.

Prepare your template
Edit your template in Impress:
 * Remove all written text, such as "Write your text here"
 * Let only empty layout boxes
 * Remove date, footer text
 * Remove unused styles; user defined styles won't be translated. Refrain from using them and prefer predefined styles
 * Remove text in Notes also
 * Save it as template

Choose your preview image
In the template manager, a preview of the template is visible. You may want a clean preview, without reference to any language:
 * Open the template to create a new presentation
 * Choose the slide you want to see in the preview
 * if you have several slides in your template, move to first position the slide you want to see in preview


 * Insert "Lorem Ipsum" text in title and text to have an overview of the font used in your template. "Lorem Ipsum" text may be generated in Writer, thanks to an autotext: hit
 * Save your presentation as standard ODP file. Let's name it.

XML code
Templates have file extension as .OT?, with ? standing for: See What is the file format used by LibreOffice? question to have more details, but in a nutshell, these files formats are simply zipped archive containing a structure with XML files (See LibreOffice and XML). So to access XML code, you need first to unzip OT? file. Use your favorite archive software to unzip. You may need to rename file extension to .ZIP or not depending of your software.
 * T = .OTT template for Writer
 * S = .OTS template for Calc
 * P = .OTP template for Impress
 * G = .OTG template for Draw

Content and modification of a template file
For an Impress template you will get a structure like this: application/vnd.oasis.opendocument.presentation-template
 *   directory should be removed. It may be empty or contain modifications of the configuration in menu bars or short keys. User may prefer to keep his own configuration when using your template
 *   directory contains only one file  . This file contains the list of files in the template. Edit it and remove any reference to  if you removed it.
 *   directory contains all images used in the template. Check if you really need all these images. If you remove some, update.
 *   directory contains preview image. We will update it later.
 *   file should not need to be modified if you correctly clean your template in Impress. You may check if there is no text.
 *   file contains general information of file: date of creation, authors, version used to build it... Nothing to change here.
 *   is a text file describing the type of the file. It should contains:
 * It is useful for OS detecting type of the file

The main part of cleaning is to be done in the two following files. If your file has a long history, you may find many useless things.
 *   file contains the settings of many option you used when you created the template. However, many of these settings are useless for the user, or the user may prefer different options (printer settings, grid and snap options...). Check all options if you want to impose some. Otherwise you may safely remove the file (update ) to let user uses its own settings.
 *   file contains all styles used in the template.
 * Search and remove language and country tags:
 * Complete font size, weight and style for Asian and complex tags (these tags need to be duplicate; see ):
 * Add  for each
 * Add  for each
 * Add  for each
 * Complete font size, weight and style for Asian and complex tags (these tags need to be duplicate; see ):
 * Add  for each
 * Add  for each
 * Add  for each
 * Add  for each
 * Add  for each

Change preview picture

 * Unzip
 * Copy  file in   directory
 * Paste it in the directory of the template to replace it

Build template file
Simply zipping all directories and files of the template in a zip file will create a template that LibreOffice will be able to open. However this file would not be valid as  file will be zipped and randomly placed in the file. To get a valid OpenDocument file, you need to place it at the beginning of the file without compression.

Under Windows
To obtain such file, you may read How to of Regina Henschel.

Under Linux
Unzip is simply done from file manager: right clic on file.

To re-zip, you can use following commands in console in the directory containing  file: zip -0 -X ../template2.otp mimetype zip -r ../template2.otp * -x mimetype First line creates a new zip file, with only  file, without compression. Second line adds all other files recursively, except  file, with standard compression

Test your template
Your template is now ready to be tested before diffusion. Make sure it is valid against ODF 1.3.extended, as far as possible. Validator is https://odfvalidator.documentfoundation.org/.

Contribution to LibreOffice code
Procedure to contribute your template is described in README file here.