summaryrefslogtreecommitdiff
path: root/forms/source/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /forms/source/inc
parentfa987cbb813cfd729fe490f2f1258b7c8d7fb174 (diff)
migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
Diffstat (limited to 'forms/source/inc')
-rw-r--r--forms/source/inc/frm_resource.hrc94
-rw-r--r--forms/source/inc/frm_resource.hxx30
2 files changed, 3 insertions, 121 deletions
diff --git a/forms/source/inc/frm_resource.hrc b/forms/source/inc/frm_resource.hrc
deleted file mode 100644
index e3a4eb04af90..000000000000
--- a/forms/source/inc/frm_resource.hrc
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FORMS_SOURCE_INC_FRM_RESOURCE_HRC
-#define INCLUDED_FORMS_SOURCE_INC_FRM_RESOURCE_HRC
-
-#include <svl/solar.hrc>
-
-#define RID_FRM_STRINGS_START RID_FORMLAYER_START
-
-//- String-IDs
-#define RID_BASELISTBOX_ERROR_FILLLIST ( RID_FRM_STRINGS_START + 0 )
-#define RID_STR_IMPORT_GRAPHIC ( RID_FRM_STRINGS_START + 1 )
-#define RID_STR_CONTROL_SUBSTITUTED_NAME ( RID_FRM_STRINGS_START + 2 )
-#define RID_STR_CONTROL_SUBSTITUTED_EPXPLAIN ( RID_FRM_STRINGS_START + 3 )
-#define RID_STR_READERROR ( RID_FRM_STRINGS_START + 4 )
-#define RID_STR_CONNECTERROR ( RID_FRM_STRINGS_START + 5 )
-#define RID_ERR_LOADING_FORM ( RID_FRM_STRINGS_START + 6 )
-#define RID_ERR_REFRESHING_FORM ( RID_FRM_STRINGS_START + 7 )
-#define RID_STR_ERR_INSERTRECORD ( RID_FRM_STRINGS_START + 8 )
-#define RID_STR_ERR_UPDATERECORD ( RID_FRM_STRINGS_START + 9 )
-#define RID_STR_ERR_DELETERECORD ( RID_FRM_STRINGS_START + 10 )
-#define RID_STR_ERR_DELETERECORDS ( RID_FRM_STRINGS_START + 11 )
-#define RID_STR_NEED_NON_NULL_OBJECT ( RID_FRM_STRINGS_START + 12 )
-#define RID_STR_OPEN_GRAPHICS ( RID_FRM_STRINGS_START + 13 )
-#define RID_STR_CLEAR_GRAPHICS ( RID_FRM_STRINGS_START + 14 )
-#define RID_STR_INVALIDSTREAM ( RID_FRM_STRINGS_START + 15 )
-#define RID_STR_SYNTAXERROR ( RID_FRM_STRINGS_START + 16 )
-#define RID_STR_INCOMPATIBLE_TYPES ( RID_FRM_STRINGS_START + 17 )
-#define RID_STR_INVALID_VALIDATOR ( RID_FRM_STRINGS_START + 18 )
-#define RID_STR_LABEL_RECORD ( RID_FRM_STRINGS_START + 19 )
-#define RID_STR_LABEL_OF ( RID_FRM_STRINGS_START + 20 )
-
-#define RID_STR_XFORMS_NO_BINDING_EXPRESSION ( RID_FRM_STRINGS_START + 21 )
-#define RID_STR_XFORMS_INVALID_BINDING_EXPRESSION (RID_FRM_STRINGS_START + 22)
-#define RID_STR_XFORMS_INVALID_VALUE ( RID_FRM_STRINGS_START + 23 )
-#define RID_STR_XFORMS_REQUIRED ( RID_FRM_STRINGS_START + 24 )
-#define RID_STR_XFORMS_INVALID_CONSTRAINT ( RID_FRM_STRINGS_START + 25 )
-#define RID_STR_XFORMS_VALUE_IS_NOT_A ( RID_FRM_STRINGS_START + 26 )
-#define RID_STR_XFORMS_VALUE_MAX_INCL ( RID_FRM_STRINGS_START + 27 )
-#define RID_STR_XFORMS_VALUE_MAX_EXCL ( RID_FRM_STRINGS_START + 28 )
-#define RID_STR_XFORMS_VALUE_MIN_INCL ( RID_FRM_STRINGS_START + 29 )
-#define RID_STR_XFORMS_VALUE_MIN_EXCL ( RID_FRM_STRINGS_START + 30 )
-#define RID_STR_XFORMS_VALUE_TOTAL_DIGITS ( RID_FRM_STRINGS_START + 32 )
-#define RID_STR_XFORMS_VALUE_FRACTION_DIGITS ( RID_FRM_STRINGS_START + 33 )
-#define RID_STR_XFORMS_VALUE_LENGTH ( RID_FRM_STRINGS_START + 34 )
-#define RID_STR_XFORMS_VALUE_MIN_LENGTH ( RID_FRM_STRINGS_START + 35 )
-#define RID_STR_XFORMS_VALUE_MAX_LENGTH ( RID_FRM_STRINGS_START + 36 )
-
-#define RID_STR_DATATYPE_STRING ( RID_FRM_STRINGS_START + 37 )
-#define RID_STR_DATATYPE_URL ( RID_FRM_STRINGS_START + 38 )
-#define RID_STR_DATATYPE_BOOLEAN ( RID_FRM_STRINGS_START + 39 )
-#define RID_STR_DATATYPE_DECIMAL ( RID_FRM_STRINGS_START + 40 )
-#define RID_STR_DATATYPE_FLOAT ( RID_FRM_STRINGS_START + 41 )
-#define RID_STR_DATATYPE_DOUBLE ( RID_FRM_STRINGS_START + 42 )
-#define RID_STR_DATATYPE_DATE ( RID_FRM_STRINGS_START + 43 )
-#define RID_STR_DATATYPE_TIME ( RID_FRM_STRINGS_START + 44 )
-#define RID_STR_DATATYPE_DATETIME ( RID_FRM_STRINGS_START + 45 )
-#define RID_STR_DATATYPE_YEAR ( RID_FRM_STRINGS_START + 47 )
-#define RID_STR_DATATYPE_MONTH ( RID_FRM_STRINGS_START + 49 )
-#define RID_STR_DATATYPE_DAY ( RID_FRM_STRINGS_START + 50 )
-
-#define RID_STR_XFORMS_CANT_EVALUATE ( RID_FRM_STRINGS_START + 51 )
-#define RID_STR_XFORMS_PATTERN_DOESNT_MATCH ( RID_FRM_STRINGS_START + 52 )
-#define RID_STR_XFORMS_BINDING_UI_NAME ( RID_FRM_STRINGS_START + 53 )
-
-#define RID_STR_QUERY_SAVE_MODIFIED_ROW ( RID_FRM_STRINGS_START + 54 )
-#define RID_STR_COULD_NOT_SET_ORDER ( RID_FRM_STRINGS_START + 55 )
-#define RID_STR_COULD_NOT_SET_FILTER ( RID_FRM_STRINGS_START + 56 )
-#define RID_STR_FEATURE_REQUIRES_PARAMETERS ( RID_FRM_STRINGS_START + 57 )
-#define RID_STR_FEATURE_NOT_EXECUTABLE ( RID_FRM_STRINGS_START + 58 )
-#define RID_STR_FEATURE_UNKNOWN ( RID_FRM_STRINGS_START + 59 )
-
-#define RID_STR_XFORMS_CANT_REMOVE_TYPE ( RID_FRM_STRINGS_START + 60 )
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/forms/source/inc/frm_resource.hxx b/forms/source/inc/frm_resource.hxx
index 6597893ab384..529d0f43b391 100644
--- a/forms/source/inc/frm_resource.hxx
+++ b/forms/source/inc/frm_resource.hxx
@@ -22,42 +22,18 @@
#include <rtl/ustring.hxx>
-class SimpleResMgr;
-
namespace frm
{
#define FRM_RES_STRING(id) ResourceManager::loadString(id)
// handling resources within the FormLayer library
- class ResourceManager
+ namespace ResourceManager
{
- static SimpleResMgr* m_pImpl;
- private:
- // no instantiation allowed
- ResourceManager() = delete;
- ~ResourceManager() { }
-
- // we'll instantiate one static member of the following class, which, in its dtor,
- // ensures that m_pImpl will be deleted
- class EnsureDelete
- {
- public:
- EnsureDelete() { }
- ~EnsureDelete();
- };
- friend class EnsureDelete;
-
- protected:
- static void ensureImplExists();
-
- public:
- /** loads the string with the specified resource id from the FormLayer resource file
+ /** loads the string with the specified resource id from the FormLayer mo file
*/
- static OUString loadString(sal_uInt16 _nResId);
+ OUString loadString(const char* pResId);
};
-
-
}