summaryrefslogtreecommitdiff
path: root/accessibility/source
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 /accessibility/source
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 'accessibility/source')
-rw-r--r--accessibility/source/extended/accessibleeditbrowseboxcell.cxx2
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx2
-rw-r--r--accessibility/source/helper/accessiblestrings.src75
-rw-r--r--accessibility/source/helper/accresmgr.cxx17
-rw-r--r--accessibility/source/standard/accessiblemenuitemcomponent.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblebox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblebutton.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblecheckbox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibledropdowncombobox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibledropdownlistbox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibleedit.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblemenuitem.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibleradiobutton.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblescrollbar.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletoolboxitem.cxx2
15 files changed, 19 insertions, 99 deletions
diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
index 8f240b20795f..b2741e246df1 100644
--- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
+++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
@@ -18,7 +18,7 @@
*/
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <extended/accessibleeditbrowseboxcell.hxx>
#include <svtools/editbrowsebox.hxx>
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 3c17f1675909..2eef354aa240 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -42,7 +42,7 @@
#include <comphelper/accessibleeventnotifier.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <com/sun/star/accessibility/XAccessibleValue.hpp>
#define ACCESSIBLE_ACTION_COUNT 1
diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src
deleted file mode 100644
index 127c336ff1b8..000000000000
--- a/accessibility/source/helper/accessiblestrings.src
+++ /dev/null
@@ -1,75 +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 .
- */
-
-#include <helper/accessiblestrings.hrc>
-
-String RID_STR_ACC_NAME_BROWSEBUTTON
-{
- Text [ en-US ] = "Browse";
-};
-
-String STR_SVT_ACC_ACTION_EXPAND
-{
- Text [ en-US ] = "Expand" ;
-};
-
-String STR_SVT_ACC_ACTION_COLLAPSE
-{
- Text [ en-US ] = "Collapse";
-};
-
-String STR_SVT_ACC_LISTENTRY_SELCTED_STATE
-{
- Text [ en-US ] = "(Selected)";
-};
-
-String RID_STR_ACC_ACTION_CHECK
-{
- Text [ en-US ] = "Check";
-};
-String RID_STR_ACC_ACTION_UNCHECK
-{
- Text [ en-US ] = "Uncheck";
-};
-
-String RID_STR_ACC_SCROLLBAR_NAME_VERTICAL
-{
- Text [ en-US ] = "Vertical scroll bar";
-};
-String RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL
-{
- Text [ en-US ] = "Horizontal scroll bar";
-};
-
-String RID_STR_ACC_PANEL_DESCRIPTION
-{
- Text [ en-US ] = "Please press enter to go into child control for more operations";
-};
-
-String RID_STR_ACC_COLUMN_NUM
-{
- Text [ en-US ] = "Column %COLUMNNUMBER";
-};
-
-String RID_STR_ACC_ROW_NUM
-{
- Text [ en-US ] = "Row %ROWNUMBER";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx
index ca09872bc8c3..a7d57156df95 100644
--- a/accessibility/source/helper/accresmgr.cxx
+++ b/accessibility/source/helper/accresmgr.cxx
@@ -19,7 +19,7 @@
#include <helper/accresmgr.hxx>
-#include <tools/simplerm.hxx>
+#include <tools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -27,22 +27,19 @@ using namespace accessibility;
// TkResMgr
-
-SimpleResMgr* TkResMgr::m_pImpl = nullptr;
-
+std::locale* TkResMgr::m_pImpl = nullptr;
TkResMgr::EnsureDelete::~EnsureDelete()
{
delete TkResMgr::m_pImpl;
}
-
void TkResMgr::ensureImplExists()
{
if (m_pImpl)
return;
- m_pImpl = SimpleResMgr::Create("acc", Application::GetSettings().GetUILanguageTag() );
+ m_pImpl = new std::locale(Translate::Create("acc", Application::GetSettings().GetUILanguageTag()));
if (m_pImpl)
{
@@ -51,17 +48,15 @@ void TkResMgr::ensureImplExists()
}
}
-
-OUString TkResMgr::loadString( sal_uInt16 nResId )
+OUString TkResMgr::loadString(const char *pResId)
{
OUString sReturn;
ensureImplExists();
- if ( m_pImpl )
- sReturn = m_pImpl->ReadString( nResId );
+ if (m_pImpl)
+ sReturn = Translate::get(pResId, *m_pImpl);
return sReturn;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
index 32fec8247a8c..8e6f69423af3 100644
--- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx
+++ b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
@@ -21,7 +21,7 @@
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <toolkit/awt/vclxwindows.hxx>
#include <toolkit/helper/convert.hxx>
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index b5a4a168ed48..c1df7719f323 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -32,7 +32,7 @@
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include "strings.hxx"
using namespace ::com::sun::star;
diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx b/accessibility/source/standard/vclxaccessiblebutton.cxx
index 2bfa5611d2d3..f26e56d972cb 100644
--- a/accessibility/source/standard/vclxaccessiblebutton.cxx
+++ b/accessibility/source/standard/vclxaccessiblebutton.cxx
@@ -19,7 +19,7 @@
#include <standard/vclxaccessiblebutton.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/accessiblekeybindinghelper.hxx>
diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
index 5e4adfc6d6c4..0e01a6680e82 100644
--- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
@@ -21,7 +21,7 @@
#include <toolkit/awt/vclxwindows.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/accessiblekeybindinghelper.hxx>
diff --git a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
index e8aa7e599b2c..fd8a3599d48e 100644
--- a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
@@ -22,7 +22,7 @@
#include <standard/vclxaccessibletextfield.hxx>
#include <standard/vclxaccessiblelist.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
diff --git a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
index ca8ae7ee981b..c61cd74fdab3 100644
--- a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
@@ -21,7 +21,7 @@
#include <standard/vclxaccessibledropdownlistbox.hxx>
#include <standard/vclxaccessiblelistbox.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index fb4aa77132ea..005ddac8e4d6 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -22,7 +22,7 @@
#include <toolkit/awt/vclxwindows.hxx>
#include <toolkit/helper/convert.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 70ade57c927f..60de73778696 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -19,7 +19,7 @@
#include <standard/vclxaccessiblemenuitem.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <toolkit/helper/convert.hxx>
#include <helper/characterattributeshelper.hxx>
#include <comphelper/accessiblekeybindinghelper.hxx>
diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
index 576f03fb75df..9606092e92f4 100644
--- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx
+++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
@@ -21,7 +21,7 @@
#include <toolkit/awt/vclxwindows.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <unotools/accessiblerelationsethelper.hxx>
#include <unotools/accessiblestatesethelper.hxx>
diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
index 9de2f42e1477..8624de5b6c4d 100644
--- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx
+++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
@@ -21,7 +21,7 @@
#include <toolkit/awt/vclxwindows.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <unotools/accessiblestatesethelper.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index 325db82a8891..2a575760dd12 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -20,7 +20,7 @@
#include <standard/vclxaccessibletoolboxitem.hxx>
#include <toolkit/helper/convert.hxx>
#include <helper/accresmgr.hxx>
-#include <helper/accessiblestrings.hrc>
+#include <strings.hrc>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>