diff options
author | Kevin Suo <suokunlong@126.com> | 2022-09-30 18:03:13 +0800 |
---|---|---|
committer | Laurent Balland <laurent.balland@mailo.fr> | 2022-11-04 21:29:33 +0100 |
commit | 5da75fcb400579d11430ec3d4c29b4646797fc5c (patch) | |
tree | a97463f17767ee59bcbae27e4c769db88e71eca2 /sfx2 | |
parent | c400c36018e8d89bbf8e551258a480c8f6571efe (diff) |
Templates: tdf#86483: Add "Localization" category and add a template for zh_CN
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>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/doctempl.hrc | 3 | ||||
-rw-r--r-- | sfx2/inc/strings.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/doctempl.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 3 |
4 files changed, 7 insertions, 2 deletions
diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc index 1e940cc6e1e2..0bd5a1957a78 100644 --- a/sfx2/inc/doctempl.hrc +++ b/sfx2/inc/doctempl.hrc @@ -32,7 +32,8 @@ const TranslateId TEMPLATE_LONG_NAMES_ARY[] = NC_("TEMPLATE_LONG_NAMES_ARY", "Other Business Documents"), NC_("TEMPLATE_LONG_NAMES_ARY", "Personal Correspondence and Documents"), NC_("TEMPLATE_LONG_NAMES_ARY", "Presentations"), - NC_("TEMPLATE_LONG_NAMES_ARY", "Drawings") + NC_("TEMPLATE_LONG_NAMES_ARY", "Drawings"), + NC_("TEMPLATE_LONG_NAMES_ARY", "Localization") }; #endif diff --git a/sfx2/inc/strings.hxx b/sfx2/inc/strings.hxx index 67df9d7dfc80..8d347934c519 100644 --- a/sfx2/inc/strings.hxx +++ b/sfx2/inc/strings.hxx @@ -47,6 +47,7 @@ inline constexpr OUStringLiteral STR_TEMPLATE_NAME29_DEF = u"Modern business let inline constexpr OUStringLiteral STR_TEMPLATE_NAME30_DEF = u"Businesscard with logo"; inline constexpr OUStringLiteral STR_TEMPLATE_NAME31_DEF = u"Simple"; inline constexpr OUStringLiteral STR_TEMPLATE_NAME32_DEF = u"BPMN"; +inline constexpr OUStringLiteral STR_TEMPLATE_NAME33_DEF = u"Simplified Chinese Normal"; inline constexpr OUStringLiteral CMIS_TYPE_STRING = u"String"; #define CMIS_TYPE_INTEGER "Integer" diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 2699f7adaa14..b585e8fef58f 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -496,6 +496,7 @@ OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString) STR_TEMPLATE_NAME30_DEF, STR_TEMPLATE_NAME31_DEF, STR_TEMPLATE_NAME32_DEF, + STR_TEMPLATE_NAME33_DEF }; TranslateId STR_TEMPLATE_NAME[] = @@ -532,6 +533,7 @@ OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString) STR_TEMPLATE_NAME30, STR_TEMPLATE_NAME31, STR_TEMPLATE_NAME32, + STR_TEMPLATE_NAME33 }; static_assert(SAL_N_ELEMENTS(aTemplateNames) == SAL_N_ELEMENTS(STR_TEMPLATE_NAME)); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index e256b50ded6c..d16b5dabf21d 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -488,7 +488,8 @@ const char* TEMPLATE_SHORT_NAMES_ARY[] = "offimisc", "personal", "presnt", - "draw" + "draw", + "l10n", }; void SfxDocTplService_Impl::readFolderList() |