[Libreoffice-bugs] [Bug 139891] New: Create a (XSLT) script to clean up the locale info from the templates.
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Jan 25 01:27:44 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=139891
Bug ID: 139891
Summary: Create a (XSLT) script to clean up the locale info
from the templates.
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: nnamani.ezinne at collabora.com
Create an XSLT filter to remove the language-specific pieces of LibreOffice
templates, so any random template can be made language-/locale-independent.
The XSLT filter will remove the language-specific details from a .ott file and
then repack it as a new .ott.
Each of the template files needs to be unpacked so that the fo:language="en"
fo:country="US" and other language-related details can be removed from the
files.
Follow the below steps to unpack the template files,
1. Add .zip to the file name.
2. Extract the zip into a folder.
3. Open the folder and remove the string `fo:language="en" fo:country="US"`
from the style.xml file
And finally can also be repacked using:
>from zipfile import ZipFile, ZIP_STORED, ZIP_DEFLATED
>
> with ZipFile('path/to/document.ott', 'w') as myzip:
> myzip.write('path/to/mimetype', 'mimetype', ZIP_STORED)
> myzip.write('path/to/META-INF/manifest.xml', 'META-INF/manifest.xml', ZIP_DEFLATED)
> myzip.write('path/to/content.xml', 'content.xml', ZIP_DEFLATED)
And the result passes https://odfvalidator.org.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210125/5cc98753/attachment.htm>
More information about the Libreoffice-bugs
mailing list