5da75fcb40
This patch adds a new template category named "Localization", to be used for templates created by our l10n team for each locale, so that languages which requires special layout or formatting (such as CJK or CTL) can have their own templates bundled by default. This patch aslo adds a (general purpose) Writer template for the Simplified Chinese language. Chinese language, by convention, need to format the document to have the first line of the paragraph be indented by 2 characters. The font size, line spacing, paragraph margin etc also need special treatment. If the Chinese users start writing using the current default Writer template, they need to adjust the style formatting every time to meet their needs. Although this template can be provided as an "extension" on the extension website, in practice very few people will go to the extension website and look for such templates. Such bundled templates can also be added by other l10n teams. The extras/README.md will be updated in a separate patch to include documentation on how to add such templates and have their template names translatable on weblate. This does not completely resolve the issue in tdf#86483, which requests to "Implement different default templates per locale". However, with this patch, we are a step closer to set a choosen template when the user switch to a certain UI. Change-Id: Ic295482354f343e981eb20908907bd6a945b7120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140802 Tested-by: Jenkins Reviewed-by: Laurent Balland <laurent.balland@mailo.fr> |
||
---|---|---|
.. | ||
source | ||
util | ||
AllLangPackage_autotextshare.mk | ||
CustomTarget_autocorr.mk | ||
CustomTarget_autotextshare.mk | ||
CustomTarget_autotextuser.mk | ||
CustomTarget_gallsystem.mk | ||
CustomTarget_glade.mk | ||
CustomTarget_opensymbol.mk | ||
CustomTarget_templates.mk | ||
CustomTarget_tplpresnt.mk | ||
CustomTarget_tplwizard.mk | ||
Gallery_backgrounds.mk | ||
Gallery_sound.mk | ||
Makefile | ||
Module_extras.mk | ||
Package_autocorr.mk | ||
Package_autotextuser.mk | ||
Package_cfgsrvnolang.mk | ||
Package_cfgusr.mk | ||
Package_database.mk | ||
Package_databasebiblio.mk | ||
Package_fonts.mk | ||
Package_gallbullets.mk | ||
Package_gallmytheme.mk | ||
Package_gallroot.mk | ||
Package_gallsystem.mk | ||
Package_gallsystemstr.mk | ||
Package_glade.mk | ||
Package_labels.mk | ||
Package_newfiles.mk | ||
Package_palettes.mk | ||
Package_resource_fonts.mk | ||
Package_templates.mk | ||
Package_tplpresnt.mk | ||
Package_tplwizard.mk | ||
Package_tplwizbitmap.mk | ||
Package_tplwizdesktop.mk | ||
Package_wordbook.mk | ||
Personas.mk | ||
README.md |
Extra Modules
Contains templates, clipart galleries, palettes, symbol font, autocorrections, autotexts etc.
-
How-to add a new gallery:
- create a directory
extras/source/gallery/foo/
- create a
.str
fileextras/source/gallery/foo/foo.str
- add a
foo
section toextras/source/gallery/share/gallery_names.ulf
- add a
Gallery_foo.mk
at the top-level (and mention inModule_extra.mk
) - add a new
GALLERY_FILELIST
statement inscp2/
- create a directory
-
How-to add a new autotext category
- create a directory
extras/source/autotext/lang/xx/foo/
wherexx
is your lang code.xx
must exactly fit with an UI lang code. - unzip your
foo.bau
autotext file in this directory (excluding an empty mimetype file) - add
xx/foo.bau
inextras/AllLangPackage_autotextshare.mk
- in
extras/CustomTarget_autotextshare.mk
:- add all files contained in
foo.bau
(except mimetype) inextras_AUTOTEXTSHARE_XMLFILES
- add all files contained in
- create a directory
-
How-to add a new autotext to an existing category
- create a directory
extras/source/autotext/lang/xx/standard/FOO/
to add it in category standard of langxx
- add files of the autotext (at least
FOO.xml
for an unformatted autotext) - add autotext name in
extras/source/autotext/lang/xx/standard/BlockList.xml
- add all files of autotext in
extras/source/autotext/lang/xx/standard/META-INF/manifest.xml
- in
extras/CustomTarget_autotextshare.mk
:- add all files of autotext in
extras_AUTOTEXTSHARE_XMLFILES
- add all files of autotext in
- create a directory
-
How-to add a new template category
- add long category name in TEMPLATE_LONG_NAMES_ARY in sfx2/inc/doctempl.hrc
- add short category name in TEMPLATE_SHORT_NAMES_ARY in sfx2/source/doc/doctemplates.cxx
-
How-to add a new template to an existing category
- clean-up template file as indicated on wiki https://wiki.documentfoundation.org/Documentation/HowTo/Impress/Make_template_language_independent
- recommendation for settings.xml are given on wiki https://wiki.documentfoundation.org/Documentation/CompatibilityFlags#Settings_to_include_in_a_new_template
- add
<dc:title>Foo</dc:title>
inmeta.xml
to make presentation name translatable - choose a template category
<Category>
- unzip
Foo.ot?
(? = p, t, s or g) inextras/source/templates/<Category>/Foo
(no space allowed in any file names) - add
<Category>/Foo.ot? /
inPackage_templates.mk
(orPackage_tplpresnt.mk
if it's a presentation) - in
CustomTarget_templates.mk
(orCustomTarget_tplpresnt.mk
if it's a presentation):- add
<Category>/Foo/meta.xml /
and all files which are not automatically added inextras_TEMPLATES_XMLFILES
(orextras_PRESENTATIONS_XMLFILES
for presentation)
- add
- for translation of template name
- define a new STR_TEMPLATE_NAMExx in include/sfx2/strings.hrc
- define a new STR_TEMPLATE_NAMExx_DEF in sfx2/inc/strings.hxx
- in sfx2/source/doc/doctempl.cxx
- add STR_TEMPLATE_NAMExx_DEF to aTemplateNames
- add STR_TEMPLATE_NAMExx to STR_TEMPLATE_NAME